Commit Graph

1491 Commits

Author SHA1 Message Date
Jonathan "Duke" Leto
d2b96cf47f Add parrot-libgit2 to the list of language bindings in the readme 2011-07-12 11:19:42 -07:00
Carlos Martín Nieto
75c2002f97 status: plug some leaks
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-07-12 18:25:31 +02:00
Carlos Martín Nieto
55e1609b2f Don't leak the buf when testing it
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-07-12 18:19:56 +02:00
schu
ca6f203c59 reference_rename: make sure old_name gets freed
Signed-off-by: schu <schu-github@schulog.org>
2011-07-12 17:59:22 +02:00
Vicent Marti
b08683ffb2 config: Rename del to `delete 2011-07-12 02:38:20 +02:00
nulltoken
bfbb55628b tag: Add creation of lightweight tag 2011-07-11 19:42:21 +02:00
Vicent Marti
eb1fd1d0cb What the fuck was this doing in src? 2011-07-11 19:42:21 +02:00
Vicent Martí
9b6fccc9ba Merge pull request #315 from belkiss/development
Finish to hide git_pkt from external API.
2011-07-11 04:19:46 -07:00
Lambert CLARA
f6e4a98a95 Finish to hide git_pkt from external API. 2011-07-11 13:05:13 +02:00
Vicent Martí
283eeefb09 Merge pull request #314 from nulltoken/ntk/fix-reflog
reflog: Fix reflog writer/reader
2011-07-10 18:02:33 -07:00
Lambert CLARA
5f35d0ce77 Remove the last reference of git_net_direction enum 2011-07-11 03:00:34 +02:00
Vicent Marti
bdd18829ad Cleanup external API
Some of the WIP API calls have been hidden in preparation for the next
minor release.
2011-07-11 02:59:18 +02:00
Vicent Marti
f27f29b100 include: Fix unmatched params in documentation 2011-07-11 02:59:17 +02:00
nulltoken
7757be33a2 reflog: Fix reflog writer/reader
- Use a space to separate oids and signature
 - Enforce test coverage
 - Make test run in a temporary folder in order not to alter the test repository
2011-07-10 19:17:07 +02:00
Vicent Martí
d37ba6720d Merge pull request #312 from nulltoken/patch-2
Fix MSVC compilation warning
2011-07-09 06:45:30 -07:00
nulltoken
b21fb8496f Fix MSVC compilation warning 2011-07-09 06:36:18 -07:00
Vicent Marti
c52736fa52 status: Cleanup
The `hashfile` function has been moved to ODB, next to `git_odb_hash`.

Global state has been removed from the dirent call in `status.c`,
because global state is killing the rainforest and causing global
warming.
2011-07-09 15:05:14 +02:00
Jason Penny
3b2a423c3f status: nonexistent file with git_status_file()
Throws GIT_ENOTFOUND error if given a filename that is not in
HEAD, index, nor the work tree.
2011-07-09 13:49:50 +02:00
Jason Penny
2b90cc26de status: consolidate some test code
Refactored copy of test repo to a function.
2011-07-09 13:49:50 +02:00
Jason Penny
34dfea2774 status: handle subdirs for git_status_file 2011-07-09 13:49:50 +02:00
Jason Penny
6b251490a8 status: add subdir to test repo 2011-07-09 13:49:50 +02:00
Jason Penny
20361b2f69 status: get status for single file
Add git_status_file to be able to retrieve status of single file by
supplying a path.
2011-07-09 13:49:50 +02:00
Jason Penny
3af6b34a76 status: get file statuses and run callback
Add git_status_foreach() to run a callback on each file passing the path
and a status value.
2011-07-09 13:49:50 +02:00
Jason Penny
210940da84 status: new test repo 2011-07-09 13:49:50 +02:00
Jason Penny
205166d27c status: get blob object id of file on disk
Add git_status_hashfile() to get blob's object id for a file without adding
it to the object database or needing a repository at all.
This functionality is similar to `git hash-object` without '-w'.
2011-07-09 13:49:50 +02:00
Jason Penny
7361857c50 Update tests/NAMING 2011-07-09 13:49:49 +02:00
Vicent Marti
c2db984b1c tsort: Remove unused CLZ methods 2011-07-09 13:27:08 +02:00
Vicent Martí
0448310f73 Merge pull request #311 from nulltoken/ntk/fix-win32-specs
Ntk/fix win32 specs
2011-07-09 04:24:23 -07:00
nulltoken
ae2e4c6a06 win32: replace usage of _MSV_VER with _MSC_VER 2011-07-09 08:41:02 +02:00
nulltoken
38ce60f091 Fix MSVC compilation warning 2011-07-09 08:36:37 +02:00
Vicent Marti
06c43821b9 Remove unused methods
The direct-writes commit left some (slow) internals methods that
were no longer needed. These have been removed.

Also, the Reflog code was using the old `git_signature__write`, so
it has been rewritten to use a normal buffer and the new `writebuf`
signature writer. It's now slightly simpler and faster.
2011-07-09 02:40:16 +02:00
Vicent Marti
afeecf4f26 odb: Direct writes are back
DIRECT WRITES ARE BACK AND FASTER THAN EVER. The streaming writer to the
ODB was an overkill for the smaller objects like Commit and Tags; most
of the streaming logic was taking too long.

This commit makes Commits, Tags and Trees to be built-up in memory, and
then written to disk in 2 pushes (header + data), instead of streaming
everything.

This is *always* faster, even for big files (since the git_filebuf class
still does streaming writes when the memory cache overflows). This is
also a gazillion lines of code smaller, because we don't have to
precompute the final size of the object before starting the stream (this
was kind of defeating the point of streaming, anyway).

Blobs are still written with full streaming instead of loading them in
memory, since this is still the fastest way.

A new `git_buf` class has been added. It's missing some features, but
it'll get there.
2011-07-09 02:40:16 +02:00
Vicent Marti
2fc78e700c posix: Portable vsnprintf
Our good, lovely folks at Microsoft decided that there was no good
reason to make `vsnprintf` compilant with the C standard, so that
function in Windows returns -1 on overflow, instead of returning the
actual byte count needed to write the full string.

We now handle this situation more gracefully with the POSIX
compatibility layer, by returning the needed byte size using an
auxiliary method instead of blindly resizing the target buffer until it
fits.

This means we can now support `printf`s of any size by allocating a
temporary buffer. That's good.
2011-07-09 02:40:16 +02:00
Vicent Marti
d483a911b8 signature: Fix optional header 2011-07-09 02:40:16 +02:00
schu
27df4275f2 reflog: add API to read or write a reference log
So far libgit2 didn't support reference logs (reflog). Add a new
git_reflog_* API for basic reading and writing of reflogs:

* git_reflog_read
* git_reflog_write
* git_reflog_free

Signed-off-by: schu <schu-github@schulog.org>
2011-07-09 02:40:16 +02:00
schu
6727e30028 git_signature__write: make header optionally
Signed-off-by: schu <schu-github@schulog.org>
2011-07-09 02:40:16 +02:00
Vicent Marti
f0ab9fda8b index: Return GIT_ENOTFOUND when an entry cannot be opened 2011-07-09 02:40:15 +02:00
Vicent Martí
d102bbba46 Merge pull request #309 from schu/rr-flaw
reference_rename: fix flaw in force-renaming
2011-07-08 09:21:30 -07:00
Vicent Martí
44b75a13ff Merge pull request #308 from schu/unused-but-set-var
tsort: remove unused but set variable
2011-07-08 09:21:13 -07:00
schu
7329433944 reference_rename: fix flaw in force-renaming
reference_rename didn't respect the force flag. Fixed.

Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
2011-07-07 21:31:59 +02:00
nulltoken
6d4f090df6 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>
2011-07-07 21:29:14 +02:00
schu
d4cb0ee85c tsort: remove unused but set variable
Signed-off-by: schu <schu-github@schulog.org>
2011-07-07 18:14:53 +02:00
Vicent Marti
da5b1e1c73 index: Fix memory leak on OOM 2011-07-07 17:56:10 +02:00
nulltoken
2b5af615e1 tag: add pattern based retrieval of list of tag names 2011-07-07 15:37:07 +02:00
nulltoken
417a581d92 tsort: fix wrong header inclusion 2011-07-07 15:36:58 +02:00
Vicent Marti
c1e857484e test-core: Fix warning in uniq test 2011-07-07 12:23:47 +02:00
nulltoken
bdcc46111c Fix MSVC compilation warnings 2011-07-07 12:12:34 +02:00
Vicent Marti
de18f27668 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.
2011-07-07 02:54:07 +02:00
Vicent Marti
c63aa49459 test: Abort when the temp workdir cannot be created 2011-07-07 02:54:07 +02:00
Vicent Martí
dbede305bf Merge pull request #306 from carlosmn/development
Fix network MSYS compilation
2011-07-06 16:58:06 -07:00