Commit Graph

1959 Commits

Author SHA1 Message Date
Carlos Martín Nieto
b13dbb91ea regex: fix sign warnings 2012-02-18 01:32:13 +01:00
Carlos Martín Nieto
1eaecf2f18 regex: The world uses utf-8 2012-02-18 01:31:48 +01:00
Carlos Martín Nieto
4a1ecba6d9 regex: Move the defines to a config header and include it unconditionally 2012-02-18 01:31:43 +01:00
Carlos Martín Nieto
2b15f61f48 Add GNU LGPL to COPYING 2012-02-17 22:22:12 +01:00
Carlos Martín Nieto
c17b1d0052 Add POSIX regex sources when needed
Windows doesn't support POSIX regex, so we need to include it
ourselves. The sources come from git, which in turn took them from
gawk.
2012-02-17 22:00:17 +01:00
Carlos Martín Nieto
d9da4ccaa0 Document {get,set}_multivar 2012-02-17 19:50:30 +01:00
Carlos Martín Nieto
3005855f7e Implement setting multivars 2012-02-17 19:50:30 +01:00
Carlos Martín Nieto
5e0dc4af01 Support getting multivars 2012-02-17 19:43:43 +01:00
Carlos Martín Nieto
78d65f390f tests: add multivar read test 2012-02-17 19:43:43 +01:00
Carlos Martín Nieto
0774d94d31 Store multivars in the multimap 2012-02-17 19:43:43 +01:00
Carlos Martín Nieto
fefd4551a5 First round of config multimap changes
Move the configuration to use a multimap instead of a list. This
commit doesn't provide any functional changes but changes the support
structures.
2012-02-17 19:43:43 +01:00
Vicent Martí
555c81f335 Merge pull request #563 from schu/notes-fixup
notes: fix assert
2012-02-16 04:22:56 -08:00
schu
0691966a73 notes: fix assert
Hopefully fix issue "Don't sleep and code" - #558.

Signed-off-by: schu <schu-github@schulog.org>
2012-02-16 12:01:09 +01:00
Vicent Martí
6117895fef Merge pull request #558 from schu/notes-api
Notes API
2012-02-15 11:38:40 -08:00
schu
bf477ed4a8 Add git notes API
This commit adds basic git notes support to libgit2, namely:

* git_note_read
* git_note_message
* git_note_oid
* git_note_create
* git_note_remove

In the long run, we probably want to provide some convenience callback
mechanism for merging and moving (filter-branch) notes.

Signed-off-by: schu <schu-github@schulog.org>
2012-02-15 20:32:14 +01:00
Vicent Martí
0c3bae6268 zlib: Remove custom git2/zlib.h header
This is legacy compat stuff for when `deflateBound` is not defined, but
we're not embedding zlib and that function is always available. Kill
that with fire.
2012-02-15 16:56:56 +01:00
schu
905919e63b util: add git__ishex
git__ishex allows to check if a string is a hexadecimal representation.

Signed-off-by: schu <schu-github@schulog.org>
2012-02-15 13:07:50 +01:00
schu
b4b79ac3db commit: actually allow yet to be born update_ref
git_commit_create is supposed to update the given reference
"update_ref", but segfaulted in case of a yet to be born
reference. Fix it.

Signed-off-by: schu <schu-github@schulog.org>
2012-02-15 13:07:41 +01:00
Vicent Martí
66faeb5c5d Merge pull request #557 from schu/copyright
Update Copyright header
2012-02-13 08:19:40 -08:00
schu
5e0de32818 Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Vicent Martí
2c19b5658c Merge pull request #474 from schu/clang-unused
Fix "clang warning: expression result unused"
2012-02-13 07:02:42 -08:00
schu
15f52ae1d6 config_file: fix clang sizeof-pointer-memaccess 2012-02-13 13:30:04 +01:00
Vicent Martí
4ef52315d9 Merge pull request #556 from schu/fix-sign-compare
tests-clar: fix warning sign-compare
2012-02-13 04:21:24 -08:00
schu
90e6c6203d tests-clar: fix warning sign-compare
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 12:13:05 +01:00
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