Commit Graph

1216 Commits

Author SHA1 Message Date
Sebastian Schuberth
49041e78f2 Fix mixed line endings in .gitignore 2011-05-18 17:31:11 +02:00
Romain Muller
d1685ac7e9 Have wscript use the environment-provided CFLAGS as per WAF's documented behavior. 2011-05-18 17:20:08 +02:00
schu
6628c2560c test_lib: add return value to git_test
Save the return value of functions not passing must_pass() and report
the returned error.

Signed-off-by: schu <schu-github@schulog.org>
2011-05-18 12:36:41 +02:00
Carlos Martín Nieto
6421c49a37 Fix variable name normalization
When I changed it over to use different strings for the variable and
the name, cvar_name_normalize was left behind. Fix this and rename to
cvar_normalize_name to reflect the incompatible change.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-17 19:03:42 +02:00
Jakob Pfender
9d27fd3bee index.c: Fix typo
git__rethrow was missing an underscore.
2011-05-17 16:51:37 +02:00
Jakob Pfender
c90bfec7aa Move index.c to new error handling mechanism 2011-05-17 16:21:14 +02:00
Jakob Pfender
050e8877dd Merge branch 'development' into unmerged 2011-05-17 15:31:05 +02:00
Carlos Martín Nieto
f44cbec479 Add documentation for git_config_add_backend 2011-05-17 14:59:23 +02:00
Carlos Martín Nieto
32234541f6 Implement git_config_open_global
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-17 14:31:57 +02:00
Vicent Marti
c9662061f2 t15: Remove unused variable 2011-05-17 15:12:25 +03:00
Vicent Marti
124fbb3d74 tests: Update NAMING file 2011-05-17 15:11:43 +03:00
Vicent Marti
0da2c70067 utils: Move git__str[n]tolower 2011-05-17 15:11:19 +03:00
Vicent Marti
128d37316b config_file: Fix compilation 2011-05-17 15:11:19 +03:00
Vicent Marti
6adcb5f3d2 utils: Implement git__strndup 2011-05-17 15:11:19 +03:00
Vicent Marti
b3d94069b4 repository: Properly free the index on close 2011-05-17 15:11:19 +03:00
Vicent Martí
62845c903e Merge pull request #116 from carlosmn/test-naming
tests: update NAMING file
2011-05-17 05:11:06 -07:00
Vicent Martí
587926efa4 Merge pull request #110 from carlosmn/config
Implement config parsing. Finally!
2011-05-17 04:54:25 -07:00
Carlos Martín Nieto
29dca0883f Move config to the new error methods
Take this opportunity to fix an instance of returning
GIT_EOBJCORRUPTED when malloc failed.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-17 13:41:42 +02:00
Carlos Martín Nieto
94711cad3b Merge upstream/development 2011-05-17 12:12:59 +02:00
Vicent Marti
335d6c9980 cache: Drop cuckoo hashing
Now we use a simple closed-addressing cache. Cuckoo hashing was creating
too many issues with race conditions. Fuck that.

Let's see what happens performance wise, we may have to roll back or
come up with another way to implement an efficient multi-threaded cache.
2011-05-17 01:46:07 +03:00
Vicent Marti
3de79280e3 cache: Fix deadlock
Do not try to adquire the same node lock twice when the cuckoo hashing
resolves to the same node.
2011-05-17 00:51:52 +03:00
Vicent Martí
1e70b96e66 Merge pull request #190 from alco/patch-1
Fix a typo in README.md
2011-05-16 08:05:10 -07:00
Alexei Sholik
cce225bfac Fix a typo in README.md 2011-05-16 01:56:20 -07:00
Vicent Marti
5ca2f58057 Do not set error message on GIT_EREVWALKOVER
This is not really an error, just a special return code to mark the end
of an iteration.
2011-05-15 23:48:05 +03:00
Vicent Marti
f87d9beb8d Change error codes from DEFINEs to an enum 2011-05-15 23:46:39 +03:00
Vicent Marti
7cadd1f6a7 Check error code from git_cache_init 2011-05-15 23:46:22 +03:00
Vicent Marti
4edf3e099a Return success code on git_cache_init 2011-05-15 23:45:24 +03:00
Vicent Martí
3fe2e770ca Merge pull request #184 from nulltoken/repo-error-handling
Updated fileops.c and repository.c to new error handling mechanism
2011-05-15 13:34:43 -07:00
Vicent Martí
b12b77231f Merge pull request #185 from chobie/development
fix git_otype typo when calling `git_odb_read_header`.
2011-05-15 10:16:36 -07:00
Shuhei Tanuma
71747bcae0 fix git_otype typo when calling git_odb_read_header. 2011-05-15 20:07:54 +09:00
nulltoken
81201a4c4d Move cache.c to the new error handling 2011-05-15 06:57:34 +02:00
nulltoken
3abe3bba5a Move repository.c to the new error handling 2011-05-14 16:05:33 +02:00
nulltoken
77c3999ca9 Move fileops.c to the new error handling 2011-05-14 14:46:22 +02:00
Vicent Martí
f02f4b536c Merge pull request #183 from schu/errors
Replace errors
2011-05-13 15:25:19 -07:00
Vicent Marti
098173c52a Check Redis replies for NULL 2011-05-13 04:19:53 +03:00
Vicent Marti
f31bd03f7e Include "common.h" in "errors.h" 2011-05-13 04:19:50 +03:00
Vicent Martí
c4ddcb7812 Merge pull request #182 from darkhelmet/patch-1
Add --with-redis flag to list of available build flags in README.
2011-05-11 11:49:45 -07:00
schu
b51c92693d Move revwalk.c to the new error handling
Signed-off-by: schu <schu-github@schulog.org>
2011-05-11 14:44:44 +02:00
schu
86f5fa7810 Move vector.c to the new error handling
Remove "redundant" check for v->_cmp in wrapper function
git_vector_bsearch().

Signed-off-by: schu <schu-github@schulog.org>
2011-05-11 14:00:53 +02:00
schu
d6de92b6fe Move tree.c to the new error handling
Signed-off-by: schu <schu-github@schulog.org>
2011-05-11 12:40:04 +02:00
schu
cbcaf0c09c Move blob.c to the new error handling
Signed-off-by: schu <schu-github@schulog.org>
2011-05-11 12:39:31 +02:00
Daniel Huckstep
0e0f4fdeee Add --with-redis flag to list of available build flags in README. 2011-05-10 15:33:07 -07:00
Vicent Marti
40774549e1 libgit2 v0.12.0 "absolutely no reason"
Hey, welcome to yet another minor libgit2 release. Sorry for the delay from
the last one. As you'll see the changelog is quite extensive -- hopefully from
now on we'll stick to more frequent minor releases.

Together with the usual bugfixes, here's a list of the new key features:

* Distfiles

	This version comes with proper distfiles as requested in #131. These are
	available in the Downloads section of the GitHub project.

* Error handling

	A new error handling API has been implemented that allows the library to
	return detailed error messages together with the generic error codes. We
	hope this will be a great when wrapping and integrating the library

	New external method to get the last detailed error message:

		+ git_lasterror(void)

	The old `git_strerror` still exists, but will be deprecated in the future
	as soon as every method in the library returns a valid error message.

	The task of writing error messages for every method is quite daunting.
	We appreciate pull requests with more error messages. Check the new error
	handling documentation in the following commit:

	fa59f18d0d

* Redis backend

	We now have a Redis backend courtesy of Dmitry Kovega. Just like the
	SQLite backend, this allows the library to store Git objects in a Redis
	key-value store.

	The backend requires the `hiredis` library. Use `--with-redis` when
	building libgit2 to enable building the backend if `hiredis` is available.

* Commits

	New methods to access tree and parent data as a raw OID value
	instead of forcing a repository lookup

		+ git_commit_tree_oid(git_commit *commit)
		+ git_commit_parent_oid(git_commit *commit, unsigned int n)

* Index

	The `git_index_add` method has been split into 4 different calls
	which allow for appending and replacing in-memory entries and on-disk
	files to the index.

		+ git_index_add(git_index *index, const char *path, int stage)
		+ git_index_add2(git_index *index, const git_index_entry *source_entry)
		+ git_index_append(git_index *index, const char *path, int stage)
		+ git_index_append2(git_index *index, const git_index_entry *source_entry)

	Index entries can now also be efficiently removed from the index:

		+ git_index_remove(git_index *index, int position)

* References

	Methods to force the creation and renaming of references, even if those already
	exist on the repository.

		+ git_reference_create_symbolic_f(git_reference **ref_out, git_repository *repo,
				const char *name, const char *target)
		+ git_reference_create_oid_f(git_reference **ref_out, git_repository *repo,
				const char *name, const git_oid *id)
		+ git_reference_rename_f(git_reference *ref, const char *new_name)

* Repository

	New auxiliary methods with repository information

		+ git_repository_is_empty(git_repository *repo)
		+ git_repository_path(git_repository *repo)
		+ git_repository_workdir(git_repository *repo)

* Signatures

	New method to create a signature with the current date/time

		+ git_signature_now(const char *name, const char *email)

* Tags

	Several wrappers to automate tag creation.

		+ git_tag_create_frombuffer(git_oid *oid, git_repository *repo,
				const char *buffer)
		+ git_tag_create_f(git_oid *oid, git_repository *repo,
				const char *tag_name, const git_oid *target,
				git_otype target_type, const git_signature *tagger,
				const char *message);
		+ git_tag_create_fo(git_oid *oid, git_repository *repo,
				const char *tag_name, const git_object *target,
				const git_signature *tagger, const char *message)

	New functionality to delete and list tags in a repository without
	having to resort to the `references` API.

		+ git_tag_delete(git_repository *repo, const char *tag_name)

		+ git_tag_list(git_strarray *tag_names, git_repository *repo)

* Trees

	All instances of `git_tree_entry` are now returned and handled
	as constant, to remind the user that these opaque types are not
	supposed to be manually free'd.

	The `git_tree_entry_2object` method now takes a `git_repository`
	argument which defines in which repository the resolved object
	should be looked up. (It is expected to be the same repository
	that contains the parent `git_tree` for the entry).

		+ git_tree_entry_2object(git_object **object_out, git_repository *repo,
				const git_tree_entry *entry)

	New opaque type `git_treebuilder` with functionality to create and
	write trees on memory

		+ git_treebuilder_create(git_treebuilder **builder_p, const git_tree *source)
		+ git_treebuilder_clear(git_treebuilder *bld)
		+ git_treebuilder_free(git_treebuilder *bld)
		+ git_treebuilder_get(git_treebuilder *bld, const char *filename)
		+ git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld,
				const char *filename, const git_oid *id, unsigned int attributes)
		+ git_treebuilder_remove(git_treebuilder *bld, const char *filename)
		+ git_treebuilder_filter(git_treebuilder *bld,
				int (*filter)(const git_tree_entry *, void *), void *payload)
		+ git_treebuilder_write(git_oid *oid, git_repository *repo, git_treebuilder *bld)

	New method to write an index file as a tree to the ODB.

		+ git_tree_create_fromindex(git_oid *oid, git_index *index)

Thanks to the usual guility parties that make this this happen, to
all the new contributors who are starting to submit pull requests, and
to the bindings developers who have to keep up with our shit.

Feedback and questions welcome on libgit2@librelist.org

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-05-11 00:47:51 +03:00
Vicent Marti
6810bf28f8 Move all error-related defines to git2/errors.h 2011-05-11 00:40:07 +03:00
Vicent Marti
f4a936b56a Bring back git_strerror
We cannot totally deprecate this until the new error handling mechanisms
are all in place.
2011-05-11 00:35:40 +03:00
Vicent Martí
86b74ea0ab Merge pull request #180 from kellypleahy/bug/fix_issue_79
Fix issue #79 - git_lasterror() isn't appearing in git2.dll in windows.
2011-05-10 14:26:16 -07:00
Vicent Martí
97ce36e700 Merge pull request #181 from carlosmn/errors
Move signature.c and tag.c to the new error handling
2011-05-10 14:23:01 -07:00
Carlos Martín Nieto
44dc0d261b Move tag.c to the new error handling
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-10 18:56:44 +02:00
Carlos Martín Nieto
5de24ec736 Move signature.c to the new error handling
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-10 17:38:41 +02:00
Carlos Martín Nieto
c033500549 Move config to a backend structure
Configuration options can come from different sources. Currently,
there is only support for reading them from a flat file, but it might
make sense to read it from a database at some point.

Move the parsing code into src/config_file.c and create an include
file include/git2/config_backend.h to allow for other backends to be
developed.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-10 14:47:20 +02:00