]> git.proxmox.com Git - libgit2.git/log
libgit2.git
13 years agoMerge pull request #193 from carlosmn/config
Vicent Martí [Thu, 19 May 2011 21:18:57 +0000 (14:18 -0700)]
Merge pull request #193 from carlosmn/config

A couple of config improvements

13 years agoMerge pull request #198 from sschuberth/fix-typos
Vicent Martí [Thu, 19 May 2011 18:21:22 +0000 (11:21 -0700)]
Merge pull request #198 from sschuberth/fix-typos

Fix a few minor typos in comments and error messages

13 years agoindex: Fix issues in the unmerged entries API
Vicent Marti [Thu, 19 May 2011 17:38:17 +0000 (20:38 +0300)]
index: Fix issues in the unmerged entries API

13 years agoFix a few minor typos in comments and error messages
Sebastian Schuberth [Thu, 19 May 2011 07:26:01 +0000 (09:26 +0200)]
Fix a few minor typos in comments and error messages

Regarding "initialize" vs. "initialise", www.dict.cc says the first is American
English whereas the latter in British English. For consistency, we should
stick to American English.

13 years agoMerge pull request #141 from jpfender/unmerged
Vicent Martí [Thu, 19 May 2011 00:04:12 +0000 (17:04 -0700)]
Merge pull request #141 from jpfender/unmerged

index: Add API for unmerged entries

13 years agoMerge pull request #197 from schu/errors
Vicent Martí [Thu, 19 May 2011 00:00:20 +0000 (17:00 -0700)]
Merge pull request #197 from schu/errors

Move odb.c to the new error handling

13 years agoMerge pull request #194 from schu/must-pass-ret
Vicent Martí [Wed, 18 May 2011 23:59:09 +0000 (16:59 -0700)]
Merge pull request #194 from schu/must-pass-ret

test_lib: add return value to git_test

13 years agoMerge pull request #195 from RomainMuller/master
Vicent Martí [Wed, 18 May 2011 23:58:24 +0000 (16:58 -0700)]
Merge pull request #195 from RomainMuller/master

Consider environment-specified CFLAGS

13 years agoMerge pull request #196 from sschuberth/cmake-msvc2010
Vicent Martí [Wed, 18 May 2011 23:57:36 +0000 (16:57 -0700)]
Merge pull request #196 from sschuberth/cmake-msvc2010

Cmake msvc2010

13 years agoMove odb.c to the new error handling
schu [Wed, 18 May 2011 16:00:34 +0000 (18:00 +0200)]
Move odb.c to the new error handling

Add missing free in git_odb_new().

Signed-off-by: schu <schu-github@schulog.org>
13 years agoUse "__inline" instead of "inline" with MSVC
Sebastian Schuberth [Wed, 18 May 2011 15:19:38 +0000 (17:19 +0200)]
Use "__inline" instead of "inline" with MSVC

MSVC supports "inline" only in C++ code, not in C code.

13 years agoDefine str(n)casecmp for MSVC
Sebastian Schuberth [Wed, 18 May 2011 14:46:56 +0000 (16:46 +0200)]
Define str(n)casecmp for MSVC

MSVC has _str(n)icmp instead.

13 years agoIgnore CMake files and generated Visual Studio files
Sebastian Schuberth [Wed, 18 May 2011 14:07:22 +0000 (16:07 +0200)]
Ignore CMake files and generated Visual Studio files

13 years agoFix mixed line endings in .gitignore
Sebastian Schuberth [Wed, 18 May 2011 14:01:01 +0000 (16:01 +0200)]
Fix mixed line endings in .gitignore

13 years agoHave wscript use the environment-provided CFLAGS as per WAF's documented behavior.
Romain Muller [Wed, 18 May 2011 15:20:08 +0000 (17:20 +0200)]
Have wscript use the environment-provided CFLAGS as per WAF's documented behavior.

13 years agotest_lib: add return value to git_test
schu [Wed, 18 May 2011 10:35:57 +0000 (12:35 +0200)]
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>
13 years agoFix variable name normalization
Carlos Martín Nieto [Tue, 17 May 2011 16:55:52 +0000 (18:55 +0200)]
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>
13 years agoindex.c: Fix typo
Jakob Pfender [Tue, 17 May 2011 14:51:37 +0000 (16:51 +0200)]
index.c: Fix typo

git__rethrow was missing an underscore.

13 years agoMove index.c to new error handling mechanism
Jakob Pfender [Tue, 17 May 2011 14:18:56 +0000 (16:18 +0200)]
Move index.c to new error handling mechanism

13 years agoMerge branch 'development' into unmerged
Jakob Pfender [Tue, 17 May 2011 13:31:05 +0000 (15:31 +0200)]
Merge branch 'development' into unmerged

13 years agoAdd documentation for git_config_add_backend
Carlos Martín Nieto [Tue, 17 May 2011 12:59:23 +0000 (14:59 +0200)]
Add documentation for git_config_add_backend

13 years agoImplement git_config_open_global
Carlos Martín Nieto [Tue, 17 May 2011 12:18:42 +0000 (14:18 +0200)]
Implement git_config_open_global

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agot15: Remove unused variable
Vicent Marti [Tue, 17 May 2011 12:12:25 +0000 (15:12 +0300)]
t15: Remove unused variable

13 years agotests: Update NAMING file
Vicent Marti [Tue, 17 May 2011 12:11:43 +0000 (15:11 +0300)]
tests: Update NAMING file

13 years agoutils: Move git__str[n]tolower
Vicent Marti [Tue, 17 May 2011 12:09:30 +0000 (15:09 +0300)]
utils: Move git__str[n]tolower

13 years agoconfig_file: Fix compilation
Vicent Marti [Tue, 17 May 2011 12:05:41 +0000 (15:05 +0300)]
config_file: Fix compilation

13 years agoutils: Implement git__strndup
Vicent Marti [Tue, 17 May 2011 12:04:18 +0000 (15:04 +0300)]
utils: Implement git__strndup

13 years agorepository: Properly free the index on close
Vicent Marti [Tue, 17 May 2011 11:51:42 +0000 (14:51 +0300)]
repository: Properly free the index on close

13 years agoMerge pull request #116 from carlosmn/test-naming
Vicent Martí [Tue, 17 May 2011 12:11:06 +0000 (05:11 -0700)]
Merge pull request #116 from carlosmn/test-naming

tests: update NAMING file

13 years agoMerge pull request #110 from carlosmn/config
Vicent Martí [Tue, 17 May 2011 11:54:25 +0000 (04:54 -0700)]
Merge pull request #110 from carlosmn/config

Implement config parsing. Finally!

13 years agoMove config to the new error methods
Carlos Martín Nieto [Tue, 17 May 2011 11:38:19 +0000 (13:38 +0200)]
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>
13 years agoMerge upstream/development
Carlos Martín Nieto [Tue, 17 May 2011 10:12:59 +0000 (12:12 +0200)]
Merge upstream/development

13 years agocache: Drop cuckoo hashing
Vicent Marti [Mon, 16 May 2011 22:46:07 +0000 (01:46 +0300)]
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.

13 years agocache: Fix deadlock
Vicent Marti [Mon, 16 May 2011 21:51:52 +0000 (00:51 +0300)]
cache: Fix deadlock

Do not try to adquire the same node lock twice when the cuckoo hashing
resolves to the same node.

13 years agoMerge pull request #190 from alco/patch-1
Vicent Martí [Mon, 16 May 2011 15:05:10 +0000 (08:05 -0700)]
Merge pull request #190 from alco/patch-1

Fix a typo in README.md

13 years agoFix a typo in README.md
Alexei Sholik [Mon, 16 May 2011 08:56:20 +0000 (01:56 -0700)]
Fix a typo in README.md

13 years agoDo not set error message on `GIT_EREVWALKOVER`
Vicent Marti [Sun, 15 May 2011 20:48:05 +0000 (23:48 +0300)]
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.

13 years agoChange error codes from DEFINEs to an enum
Vicent Marti [Sun, 15 May 2011 20:46:39 +0000 (23:46 +0300)]
Change error codes from DEFINEs to an enum

13 years agoCheck error code from `git_cache_init`
Vicent Marti [Sun, 15 May 2011 20:46:22 +0000 (23:46 +0300)]
Check error code from `git_cache_init`

13 years agoReturn success code on `git_cache_init`
Vicent Marti [Sun, 15 May 2011 20:45:24 +0000 (23:45 +0300)]
Return success code on `git_cache_init`

13 years agoMerge pull request #184 from nulltoken/repo-error-handling
Vicent Martí [Sun, 15 May 2011 20:34:43 +0000 (13:34 -0700)]
Merge pull request #184 from nulltoken/repo-error-handling

Updated fileops.c and repository.c to new error handling mechanism

13 years agoMerge pull request #185 from chobie/development
Vicent Martí [Sun, 15 May 2011 17:16:36 +0000 (10:16 -0700)]
Merge pull request #185 from chobie/development

fix git_otype typo when calling `git_odb_read_header`.

13 years agofix git_otype typo when calling `git_odb_read_header`.
Shuhei Tanuma [Sun, 15 May 2011 11:07:54 +0000 (20:07 +0900)]
fix git_otype typo when calling `git_odb_read_header`.

13 years agoMove cache.c to the new error handling
nulltoken [Sun, 15 May 2011 04:57:34 +0000 (06:57 +0200)]
Move cache.c to the new error handling

13 years agoMove repository.c to the new error handling
nulltoken [Sat, 14 May 2011 14:05:33 +0000 (16:05 +0200)]
Move repository.c to the new error handling

13 years agoMove fileops.c to the new error handling
nulltoken [Sat, 14 May 2011 12:40:56 +0000 (14:40 +0200)]
Move fileops.c to the new error handling

13 years agoMerge pull request #183 from schu/errors
Vicent Martí [Fri, 13 May 2011 22:25:19 +0000 (15:25 -0700)]
Merge pull request #183 from schu/errors

Replace errors

13 years agoCheck Redis replies for NULL
Vicent Marti [Fri, 13 May 2011 01:17:24 +0000 (04:17 +0300)]
Check Redis replies for NULL

13 years agoInclude "common.h" in "errors.h"
Vicent Marti [Fri, 13 May 2011 01:15:46 +0000 (04:15 +0300)]
Include "common.h" in "errors.h"

13 years agoMerge pull request #182 from darkhelmet/patch-1
Vicent Martí [Wed, 11 May 2011 18:49:45 +0000 (11:49 -0700)]
Merge pull request #182 from darkhelmet/patch-1

Add --with-redis flag to list of available build flags in README.

13 years agoMove revwalk.c to the new error handling
schu [Wed, 11 May 2011 12:44:44 +0000 (14:44 +0200)]
Move revwalk.c to the new error handling

Signed-off-by: schu <schu-github@schulog.org>
13 years agoMove vector.c to the new error handling
schu [Wed, 11 May 2011 12:00:38 +0000 (14:00 +0200)]
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>
13 years agoMove tree.c to the new error handling
schu [Wed, 11 May 2011 10:40:04 +0000 (12:40 +0200)]
Move tree.c to the new error handling

Signed-off-by: schu <schu-github@schulog.org>
13 years agoMove blob.c to the new error handling
schu [Wed, 11 May 2011 10:09:40 +0000 (12:09 +0200)]
Move blob.c to the new error handling

Signed-off-by: schu <schu-github@schulog.org>
13 years agoAdd --with-redis flag to list of available build flags in README.
Daniel Huckstep [Tue, 10 May 2011 22:33:07 +0000 (15:33 -0700)]
Add --with-redis flag to list of available build flags in README.

13 years agolibgit2 v0.12.0 "absolutely no reason"
Vicent Marti [Tue, 10 May 2011 21:42:43 +0000 (00:42 +0300)]
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:

https://github.com/libgit2/libgit2/commit/fa59f18d0ddbbb98d45e33934fb0efc3e2bf1557

* 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>
13 years agoMove all error-related defines to `git2/errors.h`
Vicent Marti [Tue, 10 May 2011 21:40:07 +0000 (00:40 +0300)]
Move all error-related defines to `git2/errors.h`

13 years agoBring back `git_strerror`
Vicent Marti [Tue, 10 May 2011 21:35:05 +0000 (00:35 +0300)]
Bring back `git_strerror`

We cannot totally deprecate this until the new error handling mechanisms
are all in place.

13 years agoMerge pull request #180 from kellypleahy/bug/fix_issue_79
Vicent Martí [Tue, 10 May 2011 21:26:16 +0000 (14:26 -0700)]
Merge pull request #180 from kellypleahy/bug/fix_issue_79

Fix issue #79 - git_lasterror() isn't appearing in git2.dll in windows.

13 years agoMerge pull request #181 from carlosmn/errors
Vicent Martí [Tue, 10 May 2011 21:23:01 +0000 (14:23 -0700)]
Merge pull request #181 from carlosmn/errors

Move signature.c and tag.c to the new error handling

13 years agoMove tag.c to the new error handling
Carlos Martín Nieto [Tue, 10 May 2011 16:56:44 +0000 (18:56 +0200)]
Move tag.c to the new error handling

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMove signature.c to the new error handling
Carlos Martín Nieto [Tue, 10 May 2011 15:38:41 +0000 (17:38 +0200)]
Move signature.c to the new error handling

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMove config to a backend structure
Carlos Martín Nieto [Fri, 6 May 2011 10:42:47 +0000 (12:42 +0200)]
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>
13 years agoFix issue #79 - git_lasterror() isn't appearing in git2.dll in windows.
kelly.leahy [Tue, 10 May 2011 06:39:32 +0000 (23:39 -0700)]
Fix issue #79 - git_lasterror() isn't appearing in git2.dll in windows.

The GIT_EXPORT macro is used to declare a function to be externally
accessible to other libraries.  This commit uses GIT_EXPORT to declare
the git_lasterror() function as externally exported.  I verified with
depends.exe that the function is available to external callers (i.e.
in the exports table of the PE file).

13 years agoMerge branch 'error-handling' into development
Vicent Marti [Mon, 9 May 2011 18:58:26 +0000 (21:58 +0300)]
Merge branch 'error-handling' into development

13 years agoChange error handling mechanism once again
Vicent Marti [Mon, 9 May 2011 17:54:04 +0000 (20:54 +0300)]
Change error handling mechanism once again

Ok, this is the real deal. Hopefully. Here's how it's going to work:

- One main method, called `git__throw`, that sets the error
code and error message when an error happens.

This method must be called in every single place where an error
code was being returned previously, setting an error message
instead.

Example, instead of:

return GIT_EOBJCORRUPTED;

Use:

return git__throw(GIT_EOBJCORRUPTED,
"The object is missing a finalizing line feed");

And instead of:

[...] {
error = GIT_EOBJCORRUPTED;
goto cleanup;
}

Use:

[...] {
error = git__throw(GIT_EOBJCORRUPTED, "What an error!");
goto cleanup;
}

The **only** exception to this are the allocation methods, which
return NULL on failure but already set the message manually.

/* only place where an error code can be returned directly,
   because the error message has already been set by the wrapper */
if (foo == NULL)
return GIT_ENOMEM;

- One secondary method, called `git__rethrow`, which can be used to
fine-grain an error message and build an error stack.

Example, instead of:

if ((error = foobar(baz)) < GIT_SUCCESS)
return error;

You can now do:

if ((error = foobar(baz)) < GIT_SUCCESS)
return git__rethrow(error, "Failed to do a major operation");

The return of the `git_lasterror` method will be a string in the
shape of:

"Failed to do a major operation. (Failed to do an internal
operation)"

E.g.

"Failed to open the index. (Not enough permissions to access
'/path/to/index')."

NOTE: do not abuse this method. Try to write all `git__throw`
messages in a descriptive manner, to avoid having to rethrow them to
clarify their meaning.

This method should only be used in the places where the original
error message set by a subroutine is not specific enough.

It is encouraged to continue using this style as much possible to
enforce error propagation:

if ((error = foobar(baz)) < GIT_SUCCESS)
return error; /* `foobar` has set an error message, and
 we are just propagating it */

The error handling revamp will take place in two phases:

- Phase 1: Replace all pieces of code that return direct error codes
with calls to `git__throw`. This can be done semi-automatically
using `ack` to locate all the error codes that must be replaced.

- Phase 2: Add some `git__rethrow` calls in those cases where the
original error messages are not specific enough.

Phase 1 is the main goal. A minor libgit2 release will be shipped once
Phase 1 is ready, and the work will start on gradually improving the
error handling mechanism by refining specific error messages.

OTHER NOTES:

- When writing error messages, please refrain from using weasel
words. They add verbosity to the message without giving any real
information. (<3 Emeric)

E.g.

"The reference file appears to be missing a carriage return"
Nope.

"The reference file is missing a carriage return"
Yes.

- When calling `git__throw`, please try to use more generic error
codes so we can eventually reduce the list of error codes to
something more reasonable. Feel free to add new, more generic error
codes if these are going to replace several of the old ones.

E.g.

return GIT_EREFCORRUPTED;

Can be turned into:

return git__throw(GIT_EOBJCORRUPTED,
"The reference is corrupted");

13 years agoerrors: Update external API with new `git_lasterror`
Vicent Marti [Wed, 4 May 2011 22:49:27 +0000 (01:49 +0300)]
errors: Update external API with new `git_lasterror`

13 years agoerrors: Set error messages on memory allocation
Vicent Marti [Wed, 4 May 2011 22:20:27 +0000 (01:20 +0300)]
errors: Set error messages on memory allocation

13 years agoerrors: Add error handling function
Vicent Marti [Wed, 4 May 2011 22:12:17 +0000 (01:12 +0300)]
errors: Add error handling function

13 years agoMerge pull request #170 from jasonrm/development
Vicent Martí [Sun, 8 May 2011 21:00:57 +0000 (14:00 -0700)]
Merge pull request #170 from jasonrm/development

Fix misspelling of git_index_append2 (was git_index_apppend2).

13 years agoMerge pull request #172 from carlosmn/valgrind
Vicent Martí [Sun, 8 May 2011 21:00:06 +0000 (14:00 -0700)]
Merge pull request #172 from carlosmn/valgrind

ref test: update a forgotten repo -> repo2

13 years agoMerge pull request #174 from carlosmn/backend-static
Vicent Martí [Sun, 8 May 2011 20:59:47 +0000 (13:59 -0700)]
Merge pull request #174 from carlosmn/backend-static

odb backend_sort_cmp should be static

13 years agoMerge pull request #177 from kellypleahy/topic/fix-delete-mutex
Vicent Martí [Sun, 8 May 2011 20:56:09 +0000 (13:56 -0700)]
Merge pull request #177 from kellypleahy/topic/fix-delete-mutex

Fix bug in the way pthead_mutex_t was being destroyed in win32.

13 years agoMerge pull request #176 from kellypleahy/topic/force-line-endings
Scott Chacon [Sun, 8 May 2011 19:39:21 +0000 (12:39 -0700)]
Merge pull request #176 from kellypleahy/topic/force-line-endings

Add git attributes settings for *.c and *.h to force line endings to LF.

13 years agoFix bug in the way pthead_mutex_t was being destroyed in win32.
kelly.leahy [Sun, 8 May 2011 19:32:35 +0000 (12:32 -0700)]
Fix bug in the way pthead_mutex_t was being destroyed in win32.

Win32 critical section objects (CRITICAL_SECTION) are not kernel objects.
Only kernel objects are destroyed by using CloseHandle.  Critical sections
are supposed to be deleted with the DeleteCriticalSection API
(http://msdn.microsoft.com/en-us/library/ms682552(VS.85).aspx).

13 years agoAdd git attributes settings for *.c and *.h to force line endings to LF.
kelly.leahy [Sun, 8 May 2011 19:30:16 +0000 (12:30 -0700)]
Add git attributes settings for *.c and *.h to force line endings to LF.

13 years agoMerge pull request #175 from carlosmn/analyzer
Vicent Martí [Fri, 6 May 2011 16:09:50 +0000 (09:09 -0700)]
Merge pull request #175 from carlosmn/analyzer

Fix two warnings from Clang.

Fixes issue #173

13 years agoFix two warnings from Clang
Carlos Martín Nieto [Fri, 6 May 2011 10:47:21 +0000 (12:47 +0200)]
Fix two warnings from Clang

Both are about not reading the value stored in a variable.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoodb backend_sort_cmp should be static
Carlos Martín Nieto [Fri, 6 May 2011 10:43:37 +0000 (12:43 +0200)]
odb backend_sort_cmp should be static

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMerge remote-tracking branch 'upstream/development' into config
Carlos Martín Nieto [Thu, 5 May 2011 14:22:06 +0000 (16:22 +0200)]
Merge remote-tracking branch 'upstream/development' into config

13 years agoconfig: store the section name separately
Carlos Martín Nieto [Thu, 5 May 2011 13:16:15 +0000 (15:16 +0200)]
config: store the section name separately

The section and variable names use different rules, so store them as
two different variables internally.

This will simplify the configuration-writing code as well later on,
but even with parsing, the code is simpler.

Take this opportunity to add a variable to the list directly when
parsing instead of passing through config_set.

13 years agoref test: update a forgotten repo -> repo2
Carlos Martín Nieto [Thu, 5 May 2011 09:38:23 +0000 (11:38 +0200)]
ref test: update a forgotten repo -> repo2

Commit 34e5d87e0512f2a3dfd6 left one of these unchanged we're trying
to read from a free'd repository.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoFix misspelling of git_index_append2 (was git_index_apppend2).
Jason R. McNeil [Wed, 4 May 2011 05:22:42 +0000 (22:22 -0700)]
Fix misspelling of git_index_append2 (was git_index_apppend2).

13 years agoMerge pull request #151 from carlosmn/root-commit.
Vicent Martí [Mon, 2 May 2011 22:29:50 +0000 (15:29 -0700)]
Merge pull request #151 from carlosmn/root-commit.

Support root commits

13 years agoMerge pull request #146 from nordsturm/fix_subtrees.
Vicent Martí [Mon, 2 May 2011 22:26:16 +0000 (15:26 -0700)]
Merge pull request #146 from nordsturm/fix_subtrees.

Fix tree-entry attribute convertion (fix corrupted trees)

13 years agoRe-apply missing patches
Vicent Marti [Sun, 1 May 2011 22:12:53 +0000 (01:12 +0300)]
Re-apply missing patches

13 years agoMerge pull request #145 from schu/fix-unused-warnings.
Vicent Martí [Sun, 1 May 2011 21:59:50 +0000 (14:59 -0700)]
Merge pull request #145 from schu/fix-unused-warnings.

Fix -Wunused-but-set-variable warnings

13 years agoMerge pull request #147 from nordsturm/fix_pack_backend_leak.
Vicent Martí [Sun, 1 May 2011 21:59:11 +0000 (14:59 -0700)]
Merge pull request #147 from nordsturm/fix_pack_backend_leak.

Fix memory leak in pack_backend__free

13 years agoMerge pull request #168 from nulltoken/isolate_refs_tests.
Vicent Martí [Sun, 1 May 2011 19:43:30 +0000 (12:43 -0700)]
Merge pull request #168 from nulltoken/isolate_refs_tests.

Isolate "writing" refs tests in a temporary folder

13 years agoChange implementation of refs tests that alter the current repository to make them...
nulltoken [Sun, 1 May 2011 19:35:32 +0000 (21:35 +0200)]
Change implementation of refs tests that alter the current repository to make them run against a temporary clone of the test repository

13 years agopack-odb: Check `mtime` instead of folder size
Vicent Marti [Sun, 1 May 2011 18:31:58 +0000 (21:31 +0300)]
pack-odb: Check `mtime` instead of folder size

Do not check the folder's size to detect new packfiles at runtime. This
doesn't work on Win32.

13 years agoAdd root commit test
Carlos Martín Nieto [Thu, 28 Apr 2011 16:30:50 +0000 (18:30 +0200)]
Add root commit test

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agocommit: support a root commits
Carlos Martín Nieto [Wed, 27 Apr 2011 12:59:59 +0000 (14:59 +0200)]
commit: support a root commits

A root commit is a commit whose branch (usually what HEAD points to)
doesn't exist (yet). This situation can happen when the commit is the
first after 1) a repository is initialized or 2) a orphan checkout has
been performed.

Take this opportunity to remove the symbolic link check, as
git_reference_resolve works on OID refs as well.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agorefs: don't loose info on resolve error
Carlos Martín Nieto [Fri, 29 Apr 2011 09:45:42 +0000 (11:45 +0200)]
refs: don't loose info on resolve error

Typical use is git_reference_resolve(&ref, ref). Currently, if there is
an error, ref will point to NULL, causing the user to lose that
reference.

Always update resolved_ref instead of just on finding an OID ref,
storing the last valid reference in it.

This change helps simplify the code for allowing root commits.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoindex.c: Remove duplicate function declaration
Jakob Pfender [Thu, 28 Apr 2011 15:31:13 +0000 (17:31 +0200)]
index.c: Remove duplicate function declaration

read_unmerged_internal() was present twice.

13 years agoFix memory leak in pack_backend__free
Sergey Nikishin [Wed, 27 Apr 2011 13:30:45 +0000 (17:30 +0400)]
Fix memory leak in pack_backend__free

13 years agoFix git__strntolower
Carlos Martín Nieto [Wed, 27 Apr 2011 09:20:38 +0000 (11:20 +0200)]
Fix git__strntolower

Obviously, the whole string should be lower-cased and not just the
last char.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoFix tree-entry attribute convertion (fix corrupted trees)
Sergey Nikishin [Tue, 26 Apr 2011 09:22:45 +0000 (13:22 +0400)]
Fix tree-entry attribute convertion (fix corrupted trees)

Magic constant replaced by direct to-string covertion because of:
1) with value length 6 (040000 - subtree) final tree will be corrupted;
2) for wrong values length <6 final tree will be corrupted too.

13 years agoFix -Wunused-but-set-variable warnings
schu [Tue, 26 Apr 2011 09:29:05 +0000 (11:29 +0200)]
Fix -Wunused-but-set-variable warnings

As of gcc 4.6 -Wall includes -Wunused-but-set-variable. Use GIT_UNUSED
or remove actually unused variables to prevent those warnings.

13 years agoMerged pull request #115 from jpfender/index-flags.
Vicent Martí [Sat, 23 Apr 2011 21:39:04 +0000 (14:39 -0700)]
Merged pull request #115 from jpfender/index-flags.

index.h: Add IDXENTRY flags needed for index operations