|
6d4f090d
|
2011-07-07T17:49:55
|
|
reference_renaming: add additional tests
Add some more test checking forced reference renaming.
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Acked-by: schu <schu-github@schulog.org>
|
|
da5b1e1c
|
2011-07-07T17:56:10
|
|
index: Fix memory leak on OOM
|
|
2b5af615
|
2011-07-07T13:47:45
|
|
tag: add pattern based retrieval of list of tag names
|
|
417a581d
|
2011-07-07T13:38:47
|
|
tsort: fix wrong header inclusion
|
|
c1e85748
|
2011-07-07T12:23:47
|
|
test-core: Fix warning in uniq test
|
|
bdcc4611
|
2011-07-07T10:11:00
|
|
Fix MSVC compilation warnings
|
|
c63aa494
|
2011-07-07T01:04:14
|
|
test: Abort when the temp workdir cannot be created
|
|
de18f276
|
2011-07-07T01:46:20
|
|
vector: Timsort all of the things
Drop the GLibc implementation of Merge Sort and replace it with Timsort.
The algorithm has been tuned to work on arrays of pointers (void **),
so there's no longer a need to abstract the byte-width of each element
in the array.
All the comparison callbacks now take pointers-to-elements, not
pointers-to-pointers, so there's now one less level of dereferencing.
E.g.
int index_cmp(const void *a, const void *b)
{
- const git_index_entry *entry_a = *(const git_index_entry **)(a);
+ const git_index_entry *entry_a = (const git_index_entry *)(a);
The result is up to a 40% speed-up when sorting vectors. Memory usage
remains lineal.
A new `bsearch` implementation has been added, whose callback also
supplies pointer-to-elements, to uniform the Vector API again.
|
|
dbede305
|
2011-07-06T16:58:06
|
|
Merge pull request #306 from carlosmn/development
Fix network MSYS compilation
|
|
1af935a3
|
2011-07-06T12:29:22
|
|
Merge pull request #307 from nulltoken/patch-1
Fix MSVC compilation warnings
|
|
26911cbd
|
2011-07-06T12:27:51
|
|
Fix MSVC compilation warnings
|
|
bf9a2e98
|
2011-07-06T10:55:06
|
|
Merge pull request #296 from kiryl/index-optimization
Index optimization
|
|
c68dee2a
|
2011-07-06T19:46:41
|
|
revwalk: Properly mark uninteresting commits
|
|
858dba58
|
2011-07-06T18:08:13
|
|
refs: Cleanup reference renaming
`git_futils_rmdir_r`: rename, clean up.
`git_reference_rename`: cleanup. Do not use 3x4096 buffers on the stack
or things will get ugly very fast. We can reuse the same buffer.
|
|
b8e2db5f
|
2011-07-06T06:54:11
|
|
Merge pull request #303 from schu/ref-rename
reference_rename: git compliant reference renaming v2
|
|
39cdf272
|
2011-07-06T09:11:03
|
|
Fix network MSYS compilation
MSYS/MinGW uses winsock but obviously doesn't set _MSC_VER. Use _WIN32
to decide whether to use winsock or BSD headers. Also remove these
headers from src/transport_git.c altogether, as they are not needed.
MSYS is very conservative, so we have to tell it that we don't care
about versions of Windows lower than WindowsXP. We also need to tell
CMake to add ws2_32 to the libraries list and we shouldn't add the
-fPIC option, to MSYS because it complains that it does it anyway.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
1b938a58
|
2011-07-03T22:27:05
|
|
Remove duplicated recursive directory removal related code
|
|
1ee5fd90
|
2011-07-03T14:42:32
|
|
Fix windows specific issues
- msvc compilation warnings
- not released file handle that prevents file removal
|
|
0ffcf78a
|
2011-06-14T15:16:43
|
|
reference_rename: git compliant reference renaming
So far libgit2 didn't handle the following scenarios:
* Rename of reference m -> m/m
* Rename of reference n/n -> n
Fixed.
Since we don't write reflogs, we have to delete any old reflog for the
renamed reference. Otherwise git.git will possibly fail when it finds
invalid logs.
Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
|
|
7ea50f60
|
2011-06-09T19:56:42
|
|
Add tests for git_futils_rmdir_resurs()
Signed-off-by: schu <schu-github@schulog.org>
|
|
42b3a460
|
2011-06-09T19:51:33
|
|
fileops: add git_futils_rmdir_recurs()
git_futils_rmdir_recurs() shall remove the given directory and all
subdirectories. This happens only if the directories are empty.
Signed-off-by: schu <schu-github@schulog.org>
|
|
e190da78
|
2011-06-09T18:11:11
|
|
fileops: add convenience function is_dot_or_dotdot()
Signed-off-by: schu <schu-github@schulog.org>
|
|
a6e0f315
|
2011-05-29T16:46:24
|
|
Add test case checking renaming of a branch to a new name prefixed with
the old name succeeds, e.g. refs/heads/foo -> refs/heads/foo/bar
Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
|
|
e1bf24c8
|
2011-07-06T02:14:30
|
|
build: Add simple Makefile for embedding the library
Run `make -f Makefile.embed` to get a `libgit2.a` with no dependencies
and no configuration on any Unix-like system.
The generated library can be linked with any piece of software without
licensing issues.
Have fun.
|
|
1e3300d8
|
2011-07-06T01:44:15
|
|
fnmatch: Fix compilation under Windows
|
|
e9c6571d
|
2011-07-06T01:04:04
|
|
fnmatch: Use native on Unix, emulate on Win32
|
|
65077434
|
2011-07-05T21:15:03
|
|
Also update local_connect's unused var name for MSVC
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3827c923
|
2011-07-05T12:32:20
|
|
Merge pull request #305 from nulltoken/patch-6
repository: fix typo'ed assert
|
|
7a44cc41
|
2011-07-05T11:00:32
|
|
repository: fix typo'ed assert
|
|
0838ccc2
|
2011-07-05T10:50:13
|
|
Merge pull request #304 from carlosmn/config
Restore config10 test file
|
|
7a7ef2dc
|
2011-07-05T17:44:51
|
|
Restore config10 test file
Removing a section variable doesn't remove its section
header. Overwrite the config10 file so there are no changes after the
test is run.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
245adf4f
|
2011-07-02T01:08:42
|
|
index: introduce git_index_uniq() function
It removes all entries with equal path except last added.
On large indexes git_index_append() + git_index_uniq() before writing is
*much* faster, than git_index_add().
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
476c42ac
|
2011-07-02T00:41:49
|
|
vector: implement git_vector_uniq()
The routine remove duplictes from the vector. Only the last added element
of elements with equal keys remains in the vector.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
0b0a6b11
|
2011-07-01T00:48:37
|
|
vector, index: use git__msort() for vector sorting
Index operation use git_vector_sort() to sort index entries. Since index
support adding duplicates (two or more entries with the same path), it's
important to preserve order of elements. Preserving order of elements
allows to make decisions based on order. For example it's possible to
implement function witch removes all duplicates except last added.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
c20ffa61
|
2011-07-01T00:34:23
|
|
util: introduce merge sort routine
In some cases it's important to preserve order of elements with equal
keys (stable sort). qsort(3) doesn't define order of elements with
equal keys.
git__msort() implements merge sort which is stable sort.
Implementation taken from git. Function renamed git_qsort() -> git__msort().
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
8cc16e29
|
2011-06-30T23:22:42
|
|
index: speedup git_index_append()/git_index_append2()
git_index_find() in index_insert() is useless if replace is not
requested (append). Do not call it in this case.
It speedup git_index_append() *dramatically* on large indexes.
$ cat index_test.c
int main(int argc, char **argv)
{
git_index *index;
git_repository *repo;
git_odb *odb;
struct git_index_entry entry;
git_oid tree_oid;
char tree_hex[41];
int i;
git_repository_init(&repo, "/tmp/myrepo", 0);
odb = git_repository_database(repo);
git_repository_index(&index, repo);
memset(&entry, 0, sizeof(entry));
git_odb_write(&entry.oid, odb, "", 0, GIT_OBJ_BLOB);
entry.path = "test.file";
for (i = 0; i < 50000; i++)
git_index_append2(index, &entry);
git_tree_create_fromindex(&tree_oid, index);
git_oid_fmt(tree_hex, &tree_oid);
tree_hex[40] = '\0';
printf("tree: %s\n", tree_hex);
git_index_free(index);
git_repository_free(repo);
return 0;
}
Before:
$ time ./index_test
tree: 43f73659c43b651588cc81459d9e25b08721b95d
./index_test 151.19s user 0.05s system 99% cpu 2:31.78 total
After:
$ time ./index_test
tree: 43f73659c43b651588cc81459d9e25b08721b95d
./index_test 0.05s user 0.00s system 94% cpu 0.059 total
About 2573 times speedup on this test :)
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
17837602
|
2011-07-05T15:38:26
|
|
repository: Fix unused parameter in Unix systems
|
|
2f3f28b4
|
2011-07-05T06:35:45
|
|
Merge pull request #302 from carlosmn/development
Small fixes in pack_window_open
|
|
e45e548a
|
2011-07-05T06:33:28
|
|
Merge pull request #299 from kiryl/examples-general-warnings
Fix warning in examples/general.c
|
|
71a8e484
|
2011-07-05T06:32:58
|
|
Merge pull request #297 from nulltoken/patch-5
Fix MSVC compilation issue
|
|
2ee318a7
|
2011-07-05T15:09:17
|
|
Small fixes in pack_window_open
Check if the window structure has actually been allocated before
trying to access it, and don't leak said structure if the map fails.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
d830919a
|
2011-07-05T06:27:56
|
|
Merge pull request #301 from carlosmn/hashtable-include-fix
Include common.h in hashtable.h
|
|
8f63d54c
|
2011-07-05T14:36:22
|
|
Include common.h in hashtable.h
Without this, hashtable.h doesn't know what uint32_t is and the
compiler thinks that it's a function type.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
f12aa9dc
|
2011-07-05T04:31:37
|
|
Merge pull request #300 from carlosmn/gsoc2011/master
A bit of networking
|
|
6f2b0a3a
|
2011-07-05T12:00:18
|
|
examples/general: fix misc warnings
examples/general.c:393:25: warning: unused variable ‘reftarget’ [-Wunused-variable]
examples/general.c:357:19: warning: unused variable ‘e’ [-Wunused-variable]
examples/general.c:444:1: warning: control reaches end of non-void function [-Wreturn-type]
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
d6d877d2
|
2011-07-05T11:54:16
|
|
examples/general: fix warnings on not handled reference type in switch
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_INVALID’ not handled in switch [-Wswitch]
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_PACKED’ not handled in switch [-Wswitch]
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_HAS_PEEL’ not handled in switch [-Wswitch]
examples/general.c:402:5: warning: enumeration value ‘GIT_REF_LISTALL’ not handled in switch [-Wswitch]
Signe-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
51cc50a3
|
2011-07-05T11:43:21
|
|
examples/general: fix git_commit_create_v() arguments type
general.c:208: warning: passing argument 7 of 'git_commit_create_v' from incompatible pointer type
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
ed72182b
|
2011-07-05T01:09:37
|
|
Fix MSVC compilation issue
|
|
7d69f788
|
2011-06-28T16:48:04
|
|
Add variable writing tests
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
156af801
|
2011-06-28T16:27:16
|
|
Add test for section header at end of file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
f58c53ce
|
2011-06-28T16:24:51
|
|
Correctly detect truncated input in header parsing
If the section header is the last line in the file,
parse_section_header would incorrectly decide that the input had been
truncated.
Fix this by checking whether the actual input line is correctly
formatted.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
86b5ab16
|
2011-06-28T16:08:46
|
|
git_config_add_file should rethrow
Otherwise, the information about why there was an error gets lost.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
2601fcfc
|
2011-06-28T15:21:44
|
|
Add tests for deleting a config var
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
6d4b6097
|
2011-06-28T15:20:42
|
|
Add git_config_del to delete a variable
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
9f86ec52
|
2011-07-05T02:28:18
|
|
signature: Fix warnings
Add extra braces to avoid ambiguous if-else.
Also, free() doesn't need a check.
|
|
a01acc47
|
2011-07-03T14:03:43
|
|
signature: straighten the creation of a signature
- Fails on empty name and/or email
- Trims leading and trailing spaces of name and email
|
|
42a1b5e1
|
2011-07-01T17:59:10
|
|
signature: enhance relaxed parsing of bogus signatures
Final fix for issue #278
|
|
60caf024
|
2011-06-28T17:06:06
|
|
t04-commit: add tests for git_signature__parse
git_signature__parse used to be very strict about what's a well-formed
signature. Add tests checking git_signature__parse can stick with
"unexpected" signatures (IOW no author name and / or no email, etc).
Signed-off-by: schu <schu-github@schulog.org>
|
|
8b2c913a
|
2011-06-29T14:48:09
|
|
git_signature__parse: make parsing less strict
git_signature__parse used to be very strict about what's a well-formed
signature. Since git_signature__parse is used only when reading already
existing signatures, we should not care about if it's a valid signature
too much but rather show what we got.
Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
|
|
1bc83ff1
|
2011-07-05T01:33:39
|
|
repository: Cleanup initialization
|
|
eec3fe39
|
2011-07-05T01:11:33
|
|
fileutils: Finish dropping the old `prettify_path`
|
|
19ac1ed7
|
2011-07-04T21:33:26
|
|
fileops: Fix stat() on directories for W32
The `stat` methods were having issues when called with a trailing slash
in Windows platforms.
We now use GetFileAttributes() where possible, which doesn't have this
restriction.
|
|
5ad739e8
|
2011-07-04T20:05:11
|
|
fileops: Drop `git_fileops_prettify_path`
The old `git_fileops_prettify_path` has been replaced with
`git_path_prettify`. This is a much simpler method that uses the OS's
`realpath` call to obtain the full path for directories and resolve
symlinks.
The `realpath` syscall is the original POSIX call in Unix system and
an emulated version under Windows using the Windows API.
|
|
f79026b4
|
2011-07-04T11:43:34
|
|
fileops: Cleanup
Cleaned up the structure of the whole OS-abstraction layer.
fileops.c now contains a set of utility methods for file management used
by the library. These are abstractions on top of the original POSIX
calls.
There's a new file called `posix.c` that contains
emulations/reimplementations of all the POSIX calls the library uses.
These are prefixed with `p_`. There's a specific posix file for each
platform (win32 and unix).
All the path-related methods have been moved from `utils.c` to `path.c`
and have their own prefix.
|
|
678e9e04
|
2011-07-03T13:33:43
|
|
build: Move OS-specific compat to their own folders
|
|
932d1baf
|
2011-06-30T19:52:34
|
|
cleanup: remove trailing spaces
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
1f4f4d17
|
2011-07-01T17:39:03
|
|
cmake: Use system zlib if found on non-Windows systems
|
|
ec626853
|
2011-07-01T17:34:27
|
|
zlib: Declare preprocessor directives at build time
|
|
17d52304
|
2011-07-01T17:26:23
|
|
build: Simplify build structure
This will make libgit2 more suitable for embedding.
|
|
b2cef77c
|
2011-06-30T21:29:42
|
|
common: Force 64 bit fileops at compile time
|
|
8a062003
|
2011-06-30T21:10:16
|
|
zlib: No visualization attributes.
The visibility attribute is a headache on many platforms like Solaris,
and not even supported on Windows.
|
|
637edc9c
|
2011-06-30T20:53:59
|
|
refs: Remove bogus assertion
The assertion in line 360 was there to check that only loose refs were
being written as loose, but there are times when we need to re-write a
packed reference as loose.
|
|
e0fc39da
|
2011-06-29T15:11:34
|
|
config: Fix unmatched parameters in docs
|
|
1f61e301
|
2011-06-30T07:12:42
|
|
Merge pull request #287 from kiryl/development
filebuf: fix endless loop on writing buf > WRITE_BUFFER_SIZE
|
|
02bc2d2f
|
2011-06-30T07:11:04
|
|
Merge pull request #288 from nulltoken/patch-4
GIT_EXTERN'd head_detached() and head_orphan()
|
|
408d733b
|
2011-06-30T06:56:58
|
|
repository: Make head_detached() and head_orphan() convenience methods accessible to bindings
|
|
fe5babac
|
2011-06-30T00:16:23
|
|
filebuf: fix endless loop on writing buf > WRITE_BUFFER_SIZE
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
2dfc0887
|
2011-06-29T12:14:29
|
|
Merge pull request #284 from nulltoken/topic/hide-git-dir
Hide ".git" directory on Windows upon creation of a non bare repository
|
|
6ac91dfe
|
2011-06-29T14:06:18
|
|
Hide ".git" directory on Windows upon creation of a non bare repository
Directory which name starts with a dot are hidden on Linux platforms. This patch makes libgit2 behaves similarly on Windows.
|
|
cfef5fb7
|
2011-06-29T15:09:21
|
|
config: `foreach` now returns variable values too
|
|
7376ad99
|
2011-06-29T11:01:35
|
|
refs: Remove duplicate rename method
`git_reference_rename` now takes a `force` flag
|
|
5f25149e
|
2011-06-28T22:04:27
|
|
sig: allow empty names
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
0f489fb2
|
2011-06-28T21:30:15
|
|
repo: Fix git_repository_is_empty
|
|
ab7941b5
|
2011-06-28T21:04:59
|
|
test: Properly show error messages
|
|
5cf1f909
|
2011-06-28T20:27:38
|
|
test: Print last error message properly
|
|
c682886e
|
2011-06-28T21:09:22
|
|
repo: Rename HEAD-related methods
|
|
e053c911
|
2011-06-28T19:52:41
|
|
commit: Allow spaces inside email addresses
Core Git doesn't care when people use spaces in the email address, even
though this kind of foolery receives the capital punishment in several
states of the USA.
We must obey.
|
|
ccd59372
|
2011-06-28T10:44:19
|
|
Merge pull request #279 from carlosmn/detached-orphan
Add detached and orphan convenience functions
|
|
9525e47d
|
2011-06-28T19:43:36
|
|
refs: Remove unused declarations
|
|
2fb520f1
|
2011-06-28T10:39:07
|
|
Merge pull request #277 from schu/sign-compare
Fix warning: signed and unsigned type in cond expr
|
|
d5afc039
|
2011-06-28T19:15:48
|
|
Remove redundant methods from the API
A bunch of redundant methods have been removed from the external API.
- All the reference/tag creation methods with `_f` are gone. The force
flag is now passed as an argument to the normal create methods.
- All the different commit creation methods are gone; commit creation
now always requires a `git_commit` pointer for parents and a `git_tree`
pointer for tree, to ensure that corrupted commits cannot be generated.
- All the different tag creation methods are gone; tag creation now
always requires a `git_object` pointer to ensure that tags are not
created to inexisting objects.
|
|
f5e09d60
|
2011-06-28T14:11:24
|
|
Add tests for detached and orphan
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
35502d2e
|
2011-06-28T13:55:00
|
|
Add git_repository_is_detached, git_repository_is_orphan
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
0ac2726f
|
2011-06-27T20:23:47
|
|
Slim down git_transport
Remove the unused repo and private pointers and make the direction a
flag, as it can only have two states. Change the connect signature to
use an int instead of git_net_direction and remove that enum.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
5da5321d
|
2011-06-27T20:01:57
|
|
Initialize memory in git transport
At the same time, do mark the transport as connected.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
7b608b3b
|
2011-06-26T17:57:40
|
|
git_blob_create_fromfile: remove old code
Remove call of gitfo_size, since we call gitfo_lstat anyway; remove some
old workaround code for gitfo_read, which is obsolete now.
Signed-off-by: schu <schu-github@schulog.org>
|
|
9ba49bb5
|
2011-06-23T03:04:23
|
|
Add git_remote_connect and git_remote_ls
These allow you to implement git-ls-remote when given a reference name
and a repository.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
c7c787ce
|
2011-06-24T18:19:00
|
|
Use gitno_buffer in the git transport
This allows us to leave out the buffer handling logic.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
ea7a5452
|
2011-06-24T16:25:26
|
|
Add gitno_buffer as a recv wrapper
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
ce90a407
|
2011-06-22T15:34:37
|
|
Remove the repo param from git_transport_new
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|