Commit Graph

2035 Commits

Author SHA1 Message Date
Vicent Martí
6d39c0dd6f Merge pull request #554 from carlosmn/revwalk-reset
revwalk: unmark commits as uninteresting on reset
2012-02-11 06:44:54 -08:00
Vicent Martí
f19e3ca288 odb: Proper symlink hashing 2012-02-10 20:16:42 +01:00
Vicent Martí
18e5b8547d odb: Add internal git_odb__hashfd 2012-02-10 19:47:02 +01:00
Vicent Martí
9b8d56087c makefile: Define _GNU_SOURCE in the embed mkfile 2012-02-09 01:18:26 +01:00
Carlos Martín Nieto
97313ce2a3 revwalk: unmark commits as uninteresting on reset
Not doing so hides commits we want to get at during a second walk.
2012-02-07 11:33:02 +01:00
Vicent Martí
61eba2d836 Merge pull request #553 from nacho/glib
Add libgit2-glib link to README.md
2012-02-07 02:27:17 -08:00
Ignacio Casal Quinteiro
13f7707169 Add libgit2-glib link to README.md 2012-02-07 10:20:03 +01:00
Vicent Martí
242a1cea8d libgit2 v0.16.0 "Dutch Fries"
This lovely and much delayed release of libgit2 ships from the cold city
of Brussels, which is currently hosting FOSDEM 2012.

There's been plenty of changes since the latest stable release, here's a
full summary:

- Git Attributes support (see git2/attr.h)
	There is now support to efficiently parse and retrieve information
	from `.gitattribute` files in a repository. Note that this
	information is not yet used e.g. when checking out files.

- .gitignore support
	Likewise, all the operations that are affected by `.gitignore` files
	now take into account the global, user and local ignores when
	skipping the relevant files.

- Cleanup of the object ownership semantics
	The ownership semantics for all repository subparts (index, odb,
	config files, etc) has been redesigned. All these objects are now
	reference counted, and can be hot-swapped in the middle of
	execution, allowing for instance to add a working directory and an
	index to a repository that was previously opened as bare, or to
	change the source of the ODB objects after initialization.

	Consequently, the repository API has been simplified to remove all
	the `_openX` calls that allowed setting these subparts *before*
	initialization.

- git_index_read_tree()
	Git trees can now be read into the index.

- More reflog functionality
	The reference log has been optimized, and new API calls to rename
	and delete the logs for a reference have been added.

- Rewrite of the References code with explicit ownership semantics
	The references code has been mostly rewritten to take into account
	the cases where another Git application was modifying a repository's
	references while the Library was running.

	References are now explicitly loaded and free'd by the user, and
	they may be reloaded in the middle of execution if the user suspects
	that their values may have changed on disk. Despite the new
	ownership semantics, the references API stays the same.

- Simplified the Remotes API
	Some of the more complex Remote calls have been refactored into
	higher level ones, to facilitate the usual `fetch` workflow of a
	repository.

- Greatly improved thread-safety
	The library no longer has race conditions when loading objects from
	the same ODB and different threads at the same time. There's now
	full TLS support, even for error codes. When the library is built
	with `THREADSAFE=1`, the threading support must be globally
	initialized before it can be used (see `git_threads_init()`)

- Tree walking API
	A new API can recursively traverse trees and subtrees issuing callbacks for
	every single entry.

- Tree diff API
	There is basic support for diff'ing an index against two trees.

- Improved windows support
	The Library is now codepage aware under Windows32: new API calls
	allow the user to set the default codepage for the OS in order to
	avoid strange Unicode errors.
2012-02-05 17:14:14 +01:00
Vicent Martí
199b7d940d Merge pull request #551 from schu/treebuilder-entries
treebuilder: remove needless variable entry_count
2012-02-05 07:42:06 -08:00
schu
b3408e3e66 treebuilder: remove needless variable entry_count
Signed-off-by: schu <schu-github@schulog.org>
2012-02-05 14:59:45 +01:00
Vicent Martí
1f0c198468 Merge pull request #549 from nulltoken/fix/open-repo-with-workdir-path
Fix trailing slash issue to the gitdir path when the repo is opened through a workdir
2012-02-04 08:38:46 -08:00
nulltoken
99abb79d53 repository: ensure that the path to the .git directory ends with a forward slash when opening a repository through a working directory path
This fixes an issue which was detected while using one of the libgit2 bindings [0]. The lack of the trailing forward slash led the name of references returned by git_reference_listall() to be prefixed with a forward slash.

  [0]: https://github.com/libgit2/libgit2sharp/pull/108
2012-02-03 12:46:50 +01:00
Vicent Martí
0a4aebb097 Merge pull request #548 from ehsan/build_fix
Fix the build on Emscripten
2012-02-02 04:35:58 -08:00
Ehsan Akhgari
31ffc141c3 Fix the build on Emscripten
struct timeval is used in this file, which requires <sys/time.h> to be
included.
2012-02-02 00:14:59 -05:00
Russell Belfer
38691ffc67 Compile with _GNU_SOURCE when appropriate
On non-Windows builds, we will now use _GNU_SOURCE so header
files will include modern API extensions.  This should resolve
issue #547.
2012-02-01 13:20:47 -08:00
Russell Belfer
e8c96ed2a7 Add unit tests for recent bug fixes
Add unit tests to confirm ignore directory pattern matches and
to confirm that ignore and attribute files are loaded properly
into the attribute file cache.
2012-02-01 12:30:35 -08:00
Russell Belfer
62a1f713de Fix memory leak in attr file cache
Actually look for the file by the same cache key that we
store it under.  Rocket science!
2012-02-01 11:54:42 -08:00
Vicent Martí
4ea79a9d6e status: Document submodule TODOs 2012-02-01 17:42:26 +01:00
Vicent Martí
bf0107d1ec Merge remote-tracking branch 'arrbee/status-bugs' into development 2012-02-01 17:35:11 +01:00
Carlos Martín Nieto
771cde4318 tests: free the remotes temp buffer 2012-02-01 04:41:42 +01:00
Vicent Martí
f82d996e75 Merge pull request #544 from nulltoken/fix/thread-tests
threads: Make the old test suite TLS aware...
2012-01-31 14:58:40 -08:00
Russell Belfer
e4eb94a255 Fix issue with ignoring whole directories
Now that is_dir is calculated correctly for attr/ignore paths,
it is possible to use it so that ignoring "dir/" will properly
match the directory name and ignore the entire directory.
2012-01-31 14:02:52 -08:00
Russell Belfer
adc9bdb3b1 Fix attr path is_dir check
When building an attr path object, the code that checks if the
file is a directory was evaluating the file as a relative path
to the current working directory, instead of using the repo root.
This lead to inconsistent behavior.
2012-01-31 13:59:32 -08:00
Russell Belfer
5d3cd4e309 Convert status assert to skip file
When status encounters a submodule, right now it is asserting.
This changes it to just skip the file that it can't deal with.
2012-01-31 13:09:39 -08:00
Carlos Martín Nieto
279afd2a51 refspec: a ref name includes the refs/ prefix
git_refspec_transform_r assumed that the reference name passed would
be only a branch or tag name. This is not the case, and we need to
take into consideration what's in the refspec's source to know how
much of the prefix to ignore.
2012-01-31 17:29:53 +01:00
nulltoken
1e53b52eb9 threads: Make the old test suite TLS aware 2012-01-29 15:11:09 +01:00
Vicent Martí
f25cc58d5c clar: Remove pregenerated files
Those were re-added on the move. Ops!
2012-01-27 18:29:03 -08:00
Vicent Martí
e4b4da1406 cache: Simplify locking mechanics
The object cache is mostly IO-bound, so it makes no sense to have a lock
per node.
2012-01-27 18:28:02 -08:00
Vicent Martí
7a6f51de6d win32: Use the Windows Atomic API on MinGW too 2012-01-26 18:03:14 -08:00
Vicent Martí
a53420e4b0 msvc: Move ssize_t typedef to MSVC-only
This is a MSVC-only issue. All other compilers we support work properly.
2012-01-26 17:53:46 -08:00
Vicent Martí
99a07f0f4d Merge pull request #541 from nulltoken/topic/repo-reinit
Repository re-initialization
2012-01-25 16:45:46 -08:00
nulltoken
5663e61a06 repository: add minimal reinitialization of repository
This currently only ensures that the version of the repository format isn't greater than zero.
2012-01-25 23:05:06 +01:00
nulltoken
9b84447a80 clay: migrate a test initializing a repository which path escapes the current working directory
A non migrated yet test has been removed as well as it's mostly redundant.
2012-01-25 23:02:08 +01:00
Vicent Martí
911ff94eb9 Merge pull request #540 from libgit2/clay-rename
Rename the Clay test suite to Clar
2012-01-25 13:58:40 -08:00
Vicent Martí
32dc20b5af gitignore: Add clar data 2012-01-25 13:57:31 -08:00
Vicent Martí
3fd1520cd4 Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
2012-01-24 20:35:15 -08:00
Carlos Martín Nieto
a9fe8ae0ee config: don't use 'section "subsection"' internal form on config_set
This had been left over from a time when I believed what the git
documentation had to say about case-sensitivity. The rest of the code
doesn't recognize this form and we hadn't noticed because most tests
don't try to get a recently-set variable but free and reload the
configuration, causing the right format to be used.
2012-01-23 22:14:04 +01:00
nulltoken
19313a76b6 remote: add test which creates a basic remote entry in the repository configuration then loads the remote 2012-01-23 21:27:29 +01:00
Russell Belfer
63ab73bec0 Merge branch 'fix-subdir-attr-paths' into development
This resolves issue #535 and issue #533.
2012-01-20 11:13:17 -08:00
Carlos Martín Nieto
9269ccce14 diff-index: fix leak
The buffer wasn't getting freed if the last difference was a deletion.
2012-01-19 23:47:15 +01:00
Carlos Martín Nieto
860de00459 http: use PRIuZ
MSVC doesn't think %zd is a valid specifier.
2012-01-19 23:36:27 +01:00
Vicent Martí
881e3da012 Merge pull request #538 from carlosmn/ref-noleak
Don't leak when deleting or removing refs
2012-01-19 11:38:09 -08:00
Carlos Martín Nieto
20c50b9e16 refs: don't leak the packref when deleting/renaming
When we remove the ref from the hashtable, we need to free the
packref.
2012-01-19 19:09:47 +01:00
Carlos Martín Nieto
3f2bf4d659 hashtable: add remove2 to retrieve the value that was removed 2012-01-19 19:06:15 +01:00
Carlos Martín Nieto
d0ec3fb8f0 indexer: save the pack index with the right name
Truncate at the slash; otherwise we get ppack-*.idx filenames.
2012-01-19 17:07:49 +01:00
Carlos Martín Nieto
585a2eb75a remote: don't try to free the ref on error
On error, the pointer could be pointing anywhere.
2012-01-19 17:05:16 +01:00
Vicent Martí
43c6dd6fb0 Merge pull request #537 from nulltoken/fix/download-segfault
Fix download segfault
2012-01-18 15:29:51 -08:00
nulltoken
c3ec2ec262 transport: prevent git_remote_download() from segfaulting when being passed a lightweight remote built with git_remote_new() 2012-01-19 00:09:47 +01:00
Russell Belfer
1744fafec0 Move path related functions from fileops to path
This takes all of the functions that look up simple data about
paths (such as `git_futils_isdir`) and moves them over to path.h
(becoming `git_path_isdir`).  This leaves fileops.h just with
functions that actually manipulate the filesystem or look at
the file contents in some way.

As part of this, the dir.h header which is really just for win32
support was moved into win32 (with some minor changes).
2012-01-17 15:49:47 -08:00
Vicent Martí
d1317f1b69 Merge pull request #536 from nulltoken/fix/transport-segfault
Fix transport segfault
2012-01-17 11:01:04 -08:00