|
af5cd936
|
2017-10-13T13:12:10
|
|
tag: implement function to parse raw data
Currently, parsing objects is strictly tied to having an ODB object
available. This makes it hard to parse an object when all that is
available is its raw object and size. Furthermore, hacking around that
limitation by directly creating an ODB structure either on stack or on
heap does not really work that well due to ODB objects being reference
counted and then automatically free'd when reaching a reference count of
zero.
Implement a function `git_tag__parse_raw` to parse a tag object from a
pair of `data` and `size`.
|
|
ecf4f33a
|
2018-02-08T11:14:48
|
|
Convert usage of `git_buf_free` to new `git_buf_dispose`
|
|
0c7f49dd
|
2017-06-30T13:39:01
|
|
Make sure to always include "common.h" first
Next to including several files, our "common.h" header also declares
various macros which are then used throughout the project. As such, we
have to make sure to always include this file first in all
implementation files. Otherwise, we might encounter problems or even
silent behavioural differences due to macros or defines not being
defined as they should be. So in fact, our header and implementation
files should make sure to always include "common.h" first.
This commit does so by establishing a common include pattern. Header
files inside of "src" will now always include "common.h" as its first
other file, separated by a newline from all the other includes to make
it stand out as special. There are two cases for the implementation
files. If they do have a matching header file, they will always include
this one first, leading to "common.h" being transitively included as
first file. If they do not have a matching header file, they instead
include "common.h" as first file themselves.
This fixes the outlined problems and will become our standard practice
for header and source files inside of the "src/" from now on.
|
|
909d5494
|
2016-12-29T12:25:15
|
|
giterr_set: consistent error messages
Error messages should be sentence fragments, and therefore:
1. Should not begin with a capital letter,
2. Should not conclude with punctuation, and
3. Should not end a sentence and begin a new one
|
|
eb39284b
|
2016-04-25T12:16:05
|
|
tag: ignore extra header fields
While no extra header fields are defined for tags, git accepts them by
ignoring them and continuing the search for the message. There are a few
tags like this in the wild which git parses just fine, so we should do
the same.
|
|
91f0d186
|
2015-12-21T20:49:14
|
|
typos in comments
|
|
659cf202
|
2015-01-07T12:23:05
|
|
Remove the signature from ref-modifying functions
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.
In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
|
|
f1453c59
|
2015-02-12T12:19:37
|
|
Make our overflow check look more like gcc/clang's
Make our overflow checking look more like gcc and clang's, so that
we can substitute it out with the compiler instrinsics on platforms
that support it. This means dropping the ability to pass `NULL` as
an out parameter.
As a result, the macros also get updated to reflect this as well.
|
|
392702ee
|
2015-02-09T23:41:13
|
|
allocations: test for overflow of requested size
Introduce some helper macros to test integer overflow from arithmetic
and set error message appropriately.
|
|
b874629b
|
2014-12-04T21:06:59
|
|
Spelling fixes
|
|
1ad15540
|
2014-10-24T08:23:14
|
|
Fixed memory leak in git_tag_delete()
|
|
a37aa82e
|
2014-05-13T15:54:23
|
|
Some coverity inspired cleanups
|
|
0b28217b
|
2014-01-15T12:51:31
|
|
refs: remove the _with_log differentiation
Any well-behaved program should write a descriptive message to the
reflog whenever it updates a reference. Let's make this more prominent
by removing the version without the reflog parameters.
|
|
26c1cb91
|
2013-12-09T09:44:03
|
|
One more rename/cleanup for callback err functions
|
|
25e0b157
|
2013-12-06T15:07:57
|
|
Remove converting user error to GIT_EUSER
This changes the behavior of callbacks so that the callback error
code is not converted into GIT_EUSER and instead we propagate the
return value through to the caller. Instead of using the
giterr_capture and giterr_restore functions, we now rely on all
functions to pass back the return value from a callback.
To avoid having a return value with no error message, the user
can call the public giterr_set_str or some such function to set
an error message. There is a new helper 'giterr_set_callback'
that functions can invoke after making a callback which ensures
that some error message was set in case the callback did not set
one.
In places where the sign of the callback return value is
meaningful (e.g. positive to skip, negative to abort), only the
negative values are returned back to the caller, obviously, since
the other values allow for continuing the loop.
The hardest parts of this were in the checkout code where positive
return values were overloaded as meaningful values for checkout.
I fixed this by adding an output parameter to many of the internal
checkout functions and removing the overload. This added some
code, but it is probably a better implementation.
There is some funkiness in the network code where user provided
callbacks could be returning a positive or a negative value and
we want to rely on that to cancel the loop. There are still a
couple places where an user error might get turned into GIT_EUSER
there, I think, though none exercised by the tests.
|
|
dab89f9b
|
2013-12-04T21:22:57
|
|
Further EUSER and error propagation fixes
This continues auditing all the places where GIT_EUSER is being
returned and making sure to clear any existing error using the
new giterr_user_cancel helper. As a result, places that relied
on intercepting GIT_EUSER but having the old error preserved also
needed to be cleaned up to correctly stash and then retrieve the
actual error.
Additionally, as I encountered places where error codes were not
being propagated correctly, I tried to fix them up. A number of
those fixes are included in the this commit as well.
|
|
376e6c9f
|
2013-08-15T13:48:35
|
|
odb: wrap the stream reading and writing functions
This is in preparation for moving the hashing to the frontend, which
requires us to handle the incoming data before passing it to the
backend's stream.
|
|
ec24e542
|
2013-05-29T22:47:37
|
|
What are the chances, really
|
|
b81cc1d6
|
2013-05-18T16:52:16
|
|
tag: Introduce git_tag_annotation_create()
|
|
2b562c3a
|
2013-05-04T16:32:58
|
|
refs: remove the OID/SYMBOLIC filtering
Nobody should ever be using anything other than ALL at this level, so
remove the option altogether.
As part of this, git_reference_foreach_glob is now implemented in the
frontend using an iterator. Backends will later regain the ability of
doing the glob filtering in the backend.
|
|
0b726701
|
2013-04-30T13:13:38
|
|
object: Explicitly define helper API methods for all obj types
|
|
203d5b0e
|
2013-04-29T18:20:58
|
|
Some cleanups
Removed useless prototype and renamed object typecast functions
declaration macro.
|
|
d7761102
|
2013-04-29T14:22:06
|
|
Standardize cast versions of git_object accessors
This removes the GIT_INLINE versions of the simple git_object
accessors and standardizes them with a helper macro in src/object.h
to build the function bodies.
|
|
3f27127d
|
2013-04-16T11:51:02
|
|
Simplify object table parse functions
This unifies the object parse functions into one signature that
takes an odb_object.
|
|
78606263
|
2013-04-15T00:05:44
|
|
Add callback to git_objects_table
This adds create and free callback to the git_objects_table so
that more of the creation and destruction of objects can be table
driven instead of using switch statements. This also makes the
semantics of certain object creation functions consistent so that
we can make better use of function pointers. This also fixes a
theoretical error case where an object allocation fails and we
end up storing NULL into the cache.
|
|
badd85a6
|
2013-04-10T17:10:17
|
|
Use git_odb_object_data/_size whereever possible
This uses the odb object accessors so we can change the internals
more easily...
|
|
8842c75f
|
2013-04-03T22:30:07
|
|
What has science done.
|
|
83cc70d9
|
2013-04-19T12:48:33
|
|
Move odb_backend implementors stuff into git2/sys
This moves some of the odb_backend stuff that is related to the
internals of an odb_backend implementation into include/git2/sys.
Some of the stuff related to streaming I left in include/git2
because it seemed like it would be reasonably needed by a normal
user who wanted to stream objects into and out of the ODB.
Also, I added APIs for traversing the list of backends so that
some of the tests would not need to access ODB internals.
|
|
24cb87e2
|
2013-03-31T13:27:43
|
|
tag: Fix parsing when no tagger nor message
|
|
d00d5464
|
2013-03-01T15:37:33
|
|
immutable references and a pluggable ref database
|
|
359fc2d2
|
2013-01-08T17:07:25
|
|
update copyrights
|
|
de70aea6
|
2012-12-03T12:41:50
|
|
Remove GIT_SIGNATURE_VERSION and friends
|
|
18d6f120
|
2012-11-12T15:55:38
|
|
tag: Deploy EINVALIDSPEC usage
|
|
c7231c45
|
2012-11-30T16:31:42
|
|
Deploy GITERR_CHECK_VERSION
|
|
4ec197f3
|
2012-11-30T12:52:42
|
|
Deploy GIT_SIGNATURE_INIT
|
|
d9023dbe
|
2012-11-20T17:06:54
|
|
API updates for tag.h
|
|
2508cc66
|
2012-11-18T21:38:08
|
|
Rename ref and reflog apis for consistency
|
|
aa8a76ef
|
2012-11-17T05:12:14
|
|
tag: rename git_tag_type to git_tag_target_type
|
|
6bb9fea1
|
2012-11-02T10:28:17
|
|
tags: Fixed the tag parser to correctly treat the message field as optional.
This fix makes libgit2 capable of parsing annotated tag objects that lack
the optional message/description field.
Previously, libgit2 treated this field as mandatory and raised a tag_error on
such tags. However, the message field is optional.
An example of such a tag is refs/tags/v2.6.16.31-rc1 in Linux:
$ git cat-file tag refs/tags/v2.6.16.31-rc1
object afaa018cefb6af63befef1df7d8febaae904434f
type commit
tag v2.6.16.31-rc1
tagger Adrian Bunk <bunk@stusta.de> 1162716505 +0100
$
|
|
2f05339e
|
2012-07-10T08:53:05
|
|
Add git_tag_foreach
|
|
3af06254
|
2012-09-20T22:42:22
|
|
Tags: teach git_tag_list not to include the 'refs/tags/' prefix
Since quite a while now, git_branch_foreach has learnt to list branches
without the 'refs/heads/' or 'refs/remotes' prefixes.
This patch teaches git_tag_list to do the same for listing tags.
|
|
d8057a5b
|
2012-08-27T11:53:59
|
|
Make git_object_peel a bit smarter
This expands the types of peeling that `git_object_peel` knows
how to do to include TAG -> BLOB peeling, and makes the errors
slightly more consistent depending on the situation. It also
adds a new special behavior where peeling to ANY will peel until
the object type changes (e.g. chases TAGs to a non-TAG).
Using this expanded peeling, this replaces peeling code that was
embedded in `git_tag_peel` and `git_reset`.
|
|
743a4b3b
|
2012-06-15T22:24:59
|
|
message: Expose git_message_prettify()
git_commit() and git_tag() no longer prettify the
message by default. This has to be taken care of
by the caller.
This has the nice side effect of putting the
caller in position to actually choose to strip
the comments or not.
|
|
904b67e6
|
2012-05-18T01:48:50
|
|
errors: Rename error codes
|
|
e172cf08
|
2012-05-18T01:21:06
|
|
errors: Rename the generic return codes
|
|
458b9450
|
2012-03-01T17:03:32
|
|
commit/tag: ensure the message is cleaned up
'git commit' and 'git tag -a' enforce some conventions, like cleaning up excess whitespace and making sure that the last line ends with a '\n'. This fix replicates this behavior.
Fix libgit2/libgit2sharp#117
|
|
3fbcac89
|
2012-05-02T19:56:38
|
|
Remove old and unused error codes
|
|
3aa351ea
|
2012-04-26T15:05:07
|
|
error handling: move the missing parts over to the new error handling
|
|
44ef8b1b
|
2012-04-13T13:00:10
|
|
Fix warnings on 64-bit windows builds
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
|
|
3f46f313
|
2012-04-06T14:34:26
|
|
tag: Add git_tag_peel() which recursively peel a tag until a non tag git_object is met
|
|
cb8a7961
|
2012-03-07T00:02:55
|
|
error-handling: Repository
This also includes droping `git_buf_lasterror` because it makes no sense
in the new system. Note that in most of the places were it has been
dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so
instead it should return a generic `-1` and obviously not throw
anything.
|
|
b60deb02
|
2012-02-22T04:41:08
|
|
Export parse_tag_buffer as git_tag__parse_buffer.
|
|
5e0de328
|
2012-02-13T17:10:24
|
|
Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
|
|
97769280
|
2011-11-30T11:27:15
|
|
Use git_buf for path storage instead of stack-based buffers
This converts virtually all of the places that allocate GIT_PATH_MAX
buffers on the stack for manipulating paths to use git_buf objects
instead. The patch is pretty careful not to touch the public API
for libgit2, so there are a few places that still use GIT_PATH_MAX.
This extends and changes some details of the git_buf implementation
to add a couple of extra functions and to make error handling easier.
This includes serious alterations to all the path.c functions, and
several of the fileops.c ones, too. Also, there are a number of new
functions that parallel existing ones except that use a git_buf
instead of a stack-based buffer (such as git_config_find_global_r
that exists alongsize git_config_find_global).
This also modifies the win32 version of p_realpath to allocate whatever
buffer size is needed to accommodate the realpath instead of hardcoding
a GIT_PATH_MAX limit, but that change needs to be tested still.
|
|
45e79e37
|
2011-11-26T04:59:21
|
|
Rename all `_close` methods
There's no difference between `_free` and `_close` semantics: keep
everything with the same name to avoid confusions.
|
|
9462c471
|
2011-11-25T08:16:26
|
|
repository: Change ownership semantics
The ownership semantics have been changed all over the library to be
consistent. There are no more "borrowed" or duplicated references.
Main changes:
- `git_repository_open2` and `3` have been dropped.
- Added setters and getters to hotswap all the repository owned
objects:
`git_repository_index`
`git_repository_set_index`
`git_repository_odb`
`git_repository_set_odb`
`git_repository_config`
`git_repository_set_config`
`git_repository_workdir`
`git_repository_set_workdir`
Now working directories/index files/ODBs and so on can be
hot-swapped after creating a repository and between operations.
- All these objects now have proper ownership semantics with
refcounting: they all require freeing after they are no longer
needed (the repository always keeps its internal reference).
- Repository open and initialization has been updated to keep in
mind the configuration files. Bare repositories are now always
detected, and a default config file is created on init.
- All the tests affected by these changes have been dropped from the
old test suite and ported to the new one.
|
|
75abd2b9
|
2011-08-11T19:38:13
|
|
Free all used references in the source tree
Since references are not owned by the repository anymore we have to free
them manually now.
Signed-off-by: schu <schu-github@schulog.org>
|
|
3286c408
|
2011-10-28T14:51:13
|
|
global: Properly use `git__` memory wrappers
Ensure that all memory related functions (malloc, calloc, strdup, free,
etc) are using their respective `git__` wrappers.
|
|
15b0bed2
|
2011-08-11T16:12:29
|
|
tag: allow the tagger field to be missing when parsing tags
Instead of bailing out with an error, this sets tagger to NULL when
the field is missing from the object.
This makes it possible to inspect tags like this one:
http://git.kernel.org/?p=git/git.git;a=tag;h=f25a265a342aed6041ab0cc484224d9ca54b6f41
|
|
cf7b13f3
|
2011-08-11T14:05:55
|
|
tag: avoid a double-free when parsing tags without a tagger field
The v0.99 tag in the Git repo triggers this behavior:
http://git.kernel.org/?p=git/git.git;a=tag;h=d6602ec5194c87b0fc87103ca4d67251c76f233a
Ideally, we'd allow the tag to be instantiated even though the tagger
field is missing, but this at the very least prevents libgit2 from
crashing.
To test this bug, a new repository has been added based on the test
branch in testrepo.git. It contains a "e90810b" tag that looks like
this:
object e90810b8df3e80c413d903f631643c716887138d
type commit
tag e90810b
This is a very simple tag.
|
|
87d9869f
|
2011-09-19T03:34:49
|
|
Tabify everything
There were quite a few places were spaces were being used instead of
tabs. Try to catch them all. This should hopefully not break anything.
Except for `git blame`. Oh well.
|
|
bb742ede
|
2011-09-19T01:54:32
|
|
Cleanup legal data
1. The license header is technically not valid if it doesn't have a
copyright signature.
2. The COPYING file has been updated with the different licenses used in
the project.
3. The full GPLv2 header in each file annoys me.
|
|
932669b8
|
2011-08-25T14:22:57
|
|
Drop STRLEN() macros
There is no need in STRLEN macros. Compilers can do this trivial
optimization on its own.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
46a78f79
|
2011-07-20T11:36:05
|
|
tag.c: fix tiny typo
Signed-off-by: schu <schu-github@schulog.org>
|
|
bfbb5562
|
2011-07-11T16:30:46
|
|
tag: Add creation of lightweight tag
|
|
7757be33
|
2011-07-10T07:48:52
|
|
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
|
|
d483a911
|
2011-07-08T18:31:05
|
|
signature: Fix optional header
|
|
06c43821
|
2011-07-09T02:37:16
|
|
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.
|
|
afeecf4f
|
2011-07-09T02:10:46
|
|
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.
|
|
2b5af615
|
2011-07-07T13:47:45
|
|
tag: add pattern based retrieval of list of tag names
|
|
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.
|
|
932d1baf
|
2011-06-30T19:52:34
|
|
cleanup: remove trailing spaces
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
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.
|
|
3101a3e5
|
2011-06-23T02:28:29
|
|
refs: Do not overflow when normalizing refnames
|
|
43521d06
|
2011-06-16T02:27:43
|
|
refs: Rename git_referece_listcb to _foreach
Same name as `git_config_foreach`
|
|
e3f56a2b
|
2011-06-08T08:11:26
|
|
Merge pull request #216 from glesserd/development
git_tag_create{,_o,_frombuffer} correction and improvement
|
|
1c68d27d
|
2011-06-07T10:15:31
|
|
Fix the error pointed out by tanoku.
Now the code shoulb be c89.
|
|
fbfc7580
|
2011-05-31T18:38:59
|
|
Fix tag and signature parsing
Before this commit, malformed tag and signature were considered as
valid by the parser. See the test t3800-mktag.sh of git to see example
of malformed tag and signature.
|
|
ac4fcf17
|
2011-05-31T11:56:39
|
|
Modify git_tag_create_frombuffer: the buffer is not modified when
writen to the odb
libgit2 has now the same behaviour of git when adding a tag with a
buffer.
|
|
3ecdf910
|
2011-05-31T11:53:09
|
|
Modify create_tag : verifications are now done in an another function
This commit create a function called tag_valid_in_odb which validate a
tag before its creation. This function will be needed by my next commit.
|
|
23123151
|
2011-05-30T09:03:55
|
|
Set the oid when a tag already exists.
When a tag already exists, it can be useful to directly have the oid
of the existed tag, just after trying to add it.
|
|
448c4d01
|
2011-05-30T08:46:48
|
|
Add an error message when a tag already exists.
Before this commit, no message is shown when doing a git_lasterror().
|
|
6e34ee61
|
2011-05-19T15:07:41
|
|
tag.c: Move to new error handling mechanism
|
|
44dc0d26
|
2011-05-10T18:56:44
|
|
Move tag.c to the new error handling
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
def3fef1
|
2011-04-12T15:52:34
|
|
Add `git_tag_list`
Lists all the tag references in a repository using a custom callback.
Includes unit tests courtesy of Emeric Fermas <3
|
|
076141a1
|
2011-04-07T14:38:03
|
|
Add a few malloc checks
Add checks to see if malloc failed when allocating the tag members and
signature members.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
6ac247b3
|
2011-04-06T11:59:40
|
|
tag: don't check twice if an object exists
Remove the check in git_tag_create_frombuffer as it's done by
tag_create already.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
81234673
|
2011-04-05T16:53:32
|
|
tag: discover the target type if needed
Don't blindly pass the target type to git_tag_type2string as it will
give an empty string on GIT_OBJ_ANY which would cause us to create an
invalid tag object.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
7bc66a79
|
2011-04-06T10:58:14
|
|
tag: don't allow tags to non-existent objects
These indicate an inconsistency in the repository which we've created,
so don't allow them.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
3e3e4631
|
2011-04-02T12:49:14
|
|
Merge branch 'tagging' of https://github.com/nulltoken/libgit2 into development
Conflicts:
include/git2/tag.h
src/tag.c
|
|
720d5472
|
2011-04-02T12:42:04
|
|
Change `parse` methods to const buffer
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
ac26e245
|
2011-03-30T23:46:54
|
|
Rename git_tag_create_o_f() to git_tag_create_fo()
|
|
9e680bcc
|
2011-03-30T23:26:36
|
|
Add git_tag_delete()
|
|
a50c1458
|
2011-03-30T23:16:30
|
|
Add git_tag_create_o_f() and git_tag_create_f() which overwrite existing tag reference, if any
|
|
bf4c39f9
|
2011-03-30T22:30:55
|
|
Prevent tag_create() from creating a conflicting reference
|
|
7b4a16e2
|
2011-03-28T13:59:48
|
|
Add git_tag_create_frombuffer API
Expose the tag parsing capabilities already present in the
library.
Exporting this function makes it possible to implement the
mktag command without duplicating this functionality.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
c15e0db5
|
2011-03-28T13:58:44
|
|
Fix memory leak in parse_tag_buffer
Free the allocated memory if the signature parsing reports an error.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
72a3fe42
|
2011-03-18T19:38:49
|
|
I broke your bindings
Hey. Apologies in advance -- I broke your bindings.
This is a major commit that includes a long-overdue redesign of the
whole object-database structure. This is expected to be the last major
external API redesign of the library until the first non-alpha release.
Please get your bindings up to date with these changes. They will be
included in the next minor release. Sorry again!
Major features include:
- Real caching and refcounting on parsed objects
- Real caching and refcounting on objects read from the ODB
- Streaming writes & reads from the ODB
- Single-method writes for all object types
- The external API is now partially thread-safe
The speed increases are significant in all aspects, specially when
reading an object several times from the ODB (revwalking) and when
writing big objects to the ODB.
Here's a full changelog for the external API:
blob.h
------
- Remove `git_blob_new`
- Remove `git_blob_set_rawcontent`
- Remove `git_blob_set_rawcontent_fromfile`
- Rename `git_blob_writefile` -> `git_blob_create_fromfile`
- Change `git_blob_create_fromfile`:
The `path` argument is now relative to the repository's working dir
- Add `git_blob_create_frombuffer`
commit.h
--------
- Remove `git_commit_new`
- Remove `git_commit_add_parent`
- Remove `git_commit_set_message`
- Remove `git_commit_set_committer`
- Remove `git_commit_set_author`
- Remove `git_commit_set_tree`
- Add `git_commit_create`
- Add `git_commit_create_v`
- Add `git_commit_create_o`
- Add `git_commit_create_ov`
tag.h
-----
- Remove `git_tag_new`
- Remove `git_tag_set_target`
- Remove `git_tag_set_name`
- Remove `git_tag_set_tagger`
- Remove `git_tag_set_message`
- Add `git_tag_create`
- Add `git_tag_create_o`
tree.h
------
- Change `git_tree_entry_2object`:
New signature is `(git_object **object_out, git_repository *repo, git_tree_entry *entry)`
- Remove `git_tree_new`
- Remove `git_tree_add_entry`
- Remove `git_tree_remove_entry_byindex`
- Remove `git_tree_remove_entry_byname`
- Remove `git_tree_clearentries`
- Remove `git_tree_entry_set_id`
- Remove `git_tree_entry_set_name`
- Remove `git_tree_entry_set_attributes`
object.h
------------
- Remove `git_object_new
- Remove `git_object_write`
- Change `git_object_close`:
This method is now *mandatory*. Not closing an object causes a
memory leak.
odb.h
-----
- Remove type `git_rawobj`
- Remove `git_rawobj_close`
- Rename `git_rawobj_hash` -> `git_odb_hash`
- Change `git_odb_hash`:
New signature is `(git_oid *id, const void *data, size_t len, git_otype type)`
- Add type `git_odb_object`
- Add `git_odb_object_close`
- Change `git_odb_read`:
New signature is `(git_odb_object **out, git_odb *db, const git_oid *id)`
- Change `git_odb_read_header`:
New signature is `(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id)`
- Remove `git_odb_write`
- Add `git_odb_open_wstream`
- Add `git_odb_open_rstream`
odb_backend.h
-------------
- Change type `git_odb_backend`:
New internal signatures are as follows
int (* read)(void **, size_t *, git_otype *, struct git_odb_backend *, const git_oid *)
int (* read_header)(size_t *, git_otype *, struct git_odb_backend *, const git_oid *)
int (* writestream)(struct git_odb_stream **, struct git_odb_backend *, size_t, git_otype)
int (* readstream)( struct git_odb_stream **, struct git_odb_backend *, const git_oid *)
- Add type `git_odb_stream`
- Add enum `git_odb_streammode`
Signed-off-by: Vicent Marti <tanoku@gmail.com>
|
|
b5c5f0f8
|
2011-03-16T23:59:09
|
|
Fix headers for the new Revision Walker
The "oid.h" header is now included instead of "object.h".
The old "revwalk.h" header has been removed; it was empty.
|
|
6b2a1941
|
2011-03-12T23:09:16
|
|
Fix the retarded object interdependency system
It's no longer retarded. All object interdependencies are stored as OIDs
instead of actual objects. This should be hundreds of times faster,
specially on big repositories. Heck, who knows, maye it doesn't even
segfault -- wouldn't that be awesome?
What has changed on the API?
`git_commit_parent`, `git_commit_tree`, `git_tag_target` now return
their values through a pointer-to-pointer, and have an error code.
`git_commit_set_tree` and `git_tag_set_target` now return an error
code and may fail.
`git_repository_free__no_gc` has been deprecated because it's
stupid. Since there are no longer any interdependencies between
objects, we don't need internal reference counting, and GC
never fails or double-free's pointers.
`git_object_close` now does a very sane thing: marks an object
as unused. Closed objects will be eventually free'd from the
object cache based on LRU. Please use `git_object_close` from
the garbage collector `destroy` method on your bindings. It's
100% safe.
`git_repository_gc` is a new method that forces a garbage collector
pass through the repo, to free as many LRU objects as possible.
This is useful if we are running out of memory.
|