|
8d3b39a6
|
2017-01-21T23:50:38
|
|
Merge branch 'pr/3912'
|
|
28d0ba0b
|
2017-01-21T23:45:23
|
|
symbolic ref target validation: fixups
Fixups requested in #3912.
|
|
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
|
|
452bf57c
|
2016-08-27T13:42:53
|
|
Make symbolic ref target validation optional
Introduce GIT_OPT_ENABLE_SYMBOLIC_REF_TARGET_VALIDATION option.
Setting this option to 0 allows
validation of a symbolic ref's target to be bypassed.
This option is enabled by default.
This mechanism is added primarily to address a discrepancy between git
behaviour and libgit2 behaviour, whereby the former allows the symbolic
ref target to carry an arbitrary string and the latter does not, so:
$ git symbolic-ref refs/heads/foo bar
$ cat .git/refs/heads/foo
ref: bar
where as attempting the same via libgit2 raises an error:
The given reference name 'bar' is not valid
this mechanism also allows those that might want to make use of
git's more lenient treatment of symbolic ref targets to do so.
|
|
908f24fd
|
2016-04-22T10:34:17
|
|
Allow creating copies of `git_reference` objects.
|
|
77965c68
|
2016-04-11T17:43:07
|
|
refs: provide a more general error message for dwim
If we cannot dwim the input, set the error message to be explicit about
that. Otherwise we leave the error for the last failed lookup, which
can be rather unexpected as it mentions a remote when the user thought
they were trying to look up a branch.
|
|
98c34149
|
2016-02-28T15:11:15
|
|
refs: honor strict object creation
|
|
0f4d9c03
|
2015-06-15T09:52:40
|
|
Fixed Xcode 6.1 build warnings
|
|
78db0239
|
2015-03-24T20:58:00
|
|
squash some leaks
|
|
fe21d708
|
2015-03-04T00:29:37
|
|
Plug a few leaks
|
|
4e498646
|
2015-01-15T16:50:31
|
|
repository: remove log message override for switching the active branch
We want to use the "checkout: moving from ..." message in order to let
git know when a change of branch has happened. Make the convenience
functions for this goal write this message.
|
|
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.
|
|
c8e02b87
|
2015-02-15T21:07:05
|
|
Remove extra semicolon outside of a function
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
|
|
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.
|
|
2884cc42
|
2015-02-11T09:39:38
|
|
overflow checking: don't make callers set oom
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the
case where a computation would overflow, so that callers don't
need to.
|
|
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.
|
|
a612a25f
|
2014-07-18T18:22:54
|
|
git_rebase_commit: write HEAD's reflog appropriately
|
|
ab8d9242
|
2014-06-28T06:39:38
|
|
Introduce reference transactions
A transaction allows you to lock multiple references and set up changes
for them before applying the changes all at once (or as close as the
backend supports).
This can be used for replication purposes, or for making sure some
operations run when the reference is locked and thus cannot be changed.
|
|
824f755f
|
2014-05-20T17:31:53
|
|
Refs: Introduce `git_refname_t`.
|
|
68f9d6b2
|
2014-05-15T22:44:50
|
|
Refs: Fix some issue when core.precomposeunicode = true.
This fixes two issues I found when core.precomposeunicode is enabled:
* When creating a reference with a NFD string, the returned
git_reference would return this NFD string as the reference’s
name. But when looking up the reference later, the name would
then be returned as NFC string.
* Renaming a reference would not honor the core.precomposeunicode and
apply no normalization to the new reference name.
|
|
3b4ba278
|
2014-04-03T15:50:21
|
|
Const correctness!
|
|
853b1407
|
2014-03-17T16:10:33
|
|
branch: constness fixes
|
|
15284a2c
|
2014-02-10T14:52:28
|
|
refs: move current_id before the reflog parameters
Keep the reflog parameters as the last two, as they're the optional
parameters.
|
|
2d929194
|
2014-02-07T16:14:17
|
|
Merge pull request #2099 from libgit2/bs/more-reflog-stuff
More reflogness
|
|
5367ec4b
|
2014-02-05T12:02:52
|
|
refs: add an unconditional delete
Add it under the git_reference_remove() name, letting the user pass the
repo and name, analogous to unconditional setting/creation.
|
|
f44fd59e
|
2014-02-05T11:21:14
|
|
refs: check the ref's old value when deleting
Recognize when the reference has changed since we loaded it.
|
|
7ee8c7e6
|
2014-02-05T11:07:34
|
|
refs: placeholder conditional delete
We don't actually pass the old value yet.
|
|
878fb66f
|
2014-02-05T10:19:17
|
|
refs: bring conditional symbolic updates to the frontend
Bring the race detection goodness to symbolic references as well.
|
|
91123661
|
2014-02-04T22:04:00
|
|
refdb: add conditional symbolic updates
Add a parameter to the backend to allow checking for the old symbolic
target.
|
|
5d96fe88
|
2014-01-14T15:33:29
|
|
refs: changes from feedback
Change the name to _matching() intead of _if(), and force _set_target()
to be a conditional update. If the user doesn't care about the old
value, they should use git_reference_create().
|
|
9b148098
|
2013-12-18T19:58:16
|
|
refs: conditional ref updates
Allow updating references if the old value matches the given one.
|
|
86746b4b
|
2014-02-03T15:06:47
|
|
Add reset tests for reflog
|
|
50ad7cc2
|
2014-02-02T18:20:06
|
|
Add `git_reference_is_note`.
|
|
a1710a28
|
2014-01-29T10:35:46
|
|
Enhance testing of signature parameters
|
|
ccf6ce5c
|
2014-01-28T11:30:36
|
|
Ensure renaming a reference updates the reflog
|
|
94f263f5
|
2014-01-25T08:04:49
|
|
Add reflog params to set-head calls
|
|
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.
|
|
2ad45213
|
2014-01-12T23:31:57
|
|
refs: handle NULL pointers passed to git_reference_iterator_free()
Signed-off-by: Brodie Rao <brodie@sf.io>
|
|
0b795178
|
2014-01-02T16:58:13
|
|
Allow the log message to be NULL.
|
|
e5994eb0
|
2014-01-02T16:56:09
|
|
Add missing `git_reference_symbolic_create_with_log`.
It's exported in the headers, but the implementation was missing.
|
|
4e1f517c
|
2013-12-18T09:33:45
|
|
Merge pull request #1920 from libgit2/cmn/ref-with-log
Reference operations with log
|
|
26c1cb91
|
2013-12-09T09:44:03
|
|
One more rename/cleanup for callback err functions
|
|
f10d7a36
|
2013-12-06T15:53:26
|
|
Further callback error check style fixes
Okay, I've decided I like the readability of this style much
better so I used it everywhere.
|
|
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.
|
|
96869a4e
|
2013-12-03T16:45:39
|
|
Improve GIT_EUSER handling
This adds giterr_user_cancel to return GIT_EUSER and clear any
error message that is sitting around. As a result of using that
in places, we need to be more thorough with capturing errors that
happen inside a callback when used internally. To help with that,
this also adds giterr_capture and giterr_restore so that when we
internally use a foreach-type function that clears errors and
converts them to GIT_EUSER, it is easier to restore not just the
return value, but the actual error message text.
|
|
f2105129
|
2013-11-23T14:39:53
|
|
refs: expose has_log() on the backend
The frontend used to look at the file directly, but that's obviously not
the right thing to do. Expose it on the backend and use that function
instead.
|
|
8d5ec910
|
2013-11-23T14:13:01
|
|
refs: expose a way to ensure a ref has a log
Sometimes (e.g. stash) we want to make sure that a log will be written,
even if it's not in one of the standard locations. Let's make that
easier.
|
|
a57dd3b7
|
2013-11-13T18:15:20
|
|
reflog: integrate into the ref writing
Whenever a reference is created or updated, we need to write to the
reflog regardless of whether the user gave us a message, so we shouldn't
leave that to the ref frontend, but integrate it into the backend.
This also eliminates the race between ref update and writing to the
reflog, as we protect the reflog with the ref lock.
As an additional benefit, this reflog append on the backend happens by
appending to the file instead of parsing and rewriting it.
|
|
110df893
|
2013-11-13T13:36:37
|
|
refdb: add a `message` parameter for appending to the log
This is as yet unused.
|
|
a6b50808
|
2013-10-30T17:24:36
|
|
refs: adjust to the new reflog API
|
|
ca84e058
|
2013-05-14T16:40:09
|
|
refs: Introduce git_reference_symbolic_set_target_with_log()
|
|
14ab0e10
|
2013-05-14T16:07:33
|
|
refs: Introduce git_reference_set_target_with_log()
|
|
56ad3782
|
2013-05-13T17:44:39
|
|
refs: Introduce git_reference_symbolic_create_with_log()
|
|
bba25f39
|
2013-05-13T16:21:09
|
|
refs: Introduce git_reference_create_with_log()
|
|
92f95a17
|
2013-05-12T14:16:13
|
|
refs: Centralize reference creation logic
|
|
0bfa7323
|
2013-11-01T17:07:44
|
|
iconv: Do not fake an API when iconv is not available
|
|
8f4a8b09
|
2013-10-28T06:20:28
|
|
Merge pull request #1802 from libgit2/cmn/reflog-backend
Make reflog part of refdb
|
|
74353137
|
2013-10-09T11:57:03
|
|
After iconv init reset ref normalize error
The iconv init was accidentally clearing the default error state
during reference normalization. This resets so that normalization
errors will be detected correctly.
|
|
92dac975
|
2013-10-08T16:35:57
|
|
Make reference lookups apply precomposeunicode
Before these changes, looking up a reference would return the
same precomposed or decomposed form of the reference name that
was used to look it up, so on MacOS which ignores the difference
between the two, a single reference could be looked up either way
and git_reference_name would return the form of the name that was
used to look it up! This change makes lookup always return the
precomposed name if core.precomposeunicode is set regardless of
which version was used to look it up. The reference iterator was
already returning the precomposed form from earlier work.
This also updates the CMakeLists.txt rules for enabling iconv
usage because the clar tests for this code were actually not being
activated properly with the old version.
Finally, this moves git_repository_reset_filesystem from include/
git2/repository.h to include/git2/sys/repository.h since it is not
really a function that normal library users should have to think
about very often.
|
|
b976f3c2
|
2013-08-19T13:01:49
|
|
reflog: move the reflog implementation into refdb_fs
References and their logs are logically coupled, let's make it so in
the code by moving the fs-based reflog implementation to live next to
the fs-based refs one.
As part of the change, make the function take names rather than
references, as only the names are relevant when looking up and
handling reflogs.
|
|
dbecec37
|
2013-08-28T09:38:14
|
|
Merge pull request #1805 from libgit2/threading-packed-load
Thread safety for the refdb_fs
|
|
504850cd
|
2013-08-25T15:59:50
|
|
refs: add git_reference_is_tag
|
|
24c71f14
|
2013-08-21T14:10:27
|
|
Add internal ref set_name fn instead of realloc
The refdb_fs implementation calls realloc directly on a reference
object when it wants to rename it. It is not a public object, so
this doesn't mess with the immutability of references, but it does
assume certain constraints on the reference representation. This
commit wraps that assumption in an isolated API to isolate it.
|
|
114f5a6c
|
2013-06-10T10:10:39
|
|
Reorganize diff and add basic diff driver
This is a significant reorganization of the diff code to break it
into a set of more clearly distinct files and to document the new
organization. Hopefully this will make the diff code easier to
understand and to extend.
This adds a new `git_diff_driver` object that looks of diff driver
information from the attributes and the config so that things like
function content in diff headers can be provided. The full driver
spec is not implemented in the commit - this is focused on the
reorganization of the code and putting the driver hooks in place.
This also removes a few #includes from src/repository.h that were
overbroad, but as a result required extra #includes in a variety
of places since including src/repository.h no longer results in
pulling in the whole world.
|
|
947fad4f
|
2013-06-03T09:28:58
|
|
Merge pull request #1624 from libgit2/vmg/full-ref-iterator
Breaking RefDB changes
|
|
9afc5971
|
2013-05-31T03:09:38
|
|
Merge pull request #1559 from carlosmn/ref-shorthand
Introduce git_reference_shorthand
|
|
979f75d8
|
2013-05-30T17:19:43
|
|
Refcounting
|
|
4e6e2ff2
|
2013-05-30T03:47:10
|
|
...Aaaand this works
|
|
ec24e542
|
2013-05-29T22:47:37
|
|
What are the chances, really
|
|
56960b83
|
2013-05-28T20:47:55
|
|
Liike this
|
|
b6cc559a
|
2013-05-11T02:42:49
|
|
Merge pull request #1385 from carlosmn/refs-iter
Introduce a refs iterator
|
|
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.
|
|
c58cac12
|
2013-05-04T18:06:14
|
|
Introduce a glob-filtering iterator
If the backend doesn't provide support for it, the matching is done in
refdb on top of a normal iterator.
|
|
95727245
|
2013-05-04T16:03:17
|
|
refs: implement _foreach with the iterator
|
|
4def7035
|
2013-03-02T19:31:03
|
|
refs: introduce an iterator
This allows us to get a list of reference names in a loop instead of callbacks.
|
|
4f2eb2b7
|
2013-05-08T02:28:47
|
|
Introduce git_reference_shorthand
Generate a shorthand name out of the full refname.
|
|
98d633cc
|
2013-05-07T23:28:21
|
|
Expose git_reference_dwim
Extract this function out of the rev-parse code to be able to DWIM a
reference instead of its target.
|
|
41e93563
|
2013-05-01T15:08:12
|
|
Error messages for a couple other boundary conditions
|
|
cd2ed9f0
|
2013-04-30T04:02:52
|
|
Merge pull request #1518 from arrbee/export-oid-comparison
Remove most inlines from the public API
|
|
b7f167da
|
2013-04-29T13:52:12
|
|
Make git_oid_cmp public and add git_oid__cmp
|
|
528a4e24
|
2013-04-28T14:16:45
|
|
Parse shorthand refspecs as valid
Relax the ONELEVEL ref naming rules so the refspec parsing code can
ask for 'master' to be considered valid.
|
|
21ca0451
|
2013-04-21T12:52:17
|
|
Move git_reference__alloc to include/git2/sys
Create a new include/git2/sys/refs.h and move the reference alloc
functions there. Also fix some documentation issues and some
minor code cleanups.
|
|
4dcd8780
|
2013-04-19T17:17:44
|
|
Move refdb_backend to include/git2/sys
This moves most of the refdb stuff over to the include/git2/sys
directory, with some minor shifts in function organization.
While I was making the necessary updates, I also removed the
trailing whitespace in a few files that I modified just because I
was there and it was bugging me.
|
|
4e4eab52
|
2013-04-19T18:19:53
|
|
alloc doesn't take a refdb; git_refdb_free nicely in the tests
|
|
fedd0f9e
|
2013-04-17T23:29:34
|
|
refs: Do not union the peel
|
|
13421eee
|
2013-04-17T22:32:39
|
|
refs: Check alloc is cleaner
|
|
3be933b1
|
2013-04-17T17:33:51
|
|
refs: Add `git_referene_target_peel`
|
|
575a54db
|
2013-04-10T16:55:29
|
|
object: Export git_object_dup
|
|
10c06114
|
2013-03-17T04:46:46
|
|
Several warnings detected by static code analyzer fixed
Implicit type conversion argument of function to size_t type
Suspicious sequence of types castings: size_t -> int -> size_t
Consider reviewing the expression of the 'A = B == C' kind. The expression is calculated as following: 'A = (B == C)'
Unsigned type is never < 0
|
|
55e0f53d
|
2013-03-14T15:09:29
|
|
Fix various build warnings
This fixes various build warnings on Mac and Windows (64-bit).
|
|
d00d5464
|
2013-03-01T15:37:33
|
|
immutable references and a pluggable ref database
|
|
bb45c57f
|
2013-03-07T16:38:44
|
|
refs: explicitly catch leading slashes
It's somewhat common to try to write "/refs/tags/something". There is
no easy way to catch it during the main body of the function, as there
is no way to distinguish whether it's a leading slash or a double
slash somewhere in the middle.
Catch this at the beginning so we don't trigger the assert in
is_all_caps_and_underscore().
|
|
0d1b094b
|
2013-02-26T13:15:06
|
|
Fix portability issues on Windows
The new tests were not taking core.filemode into account when
testing file modes after repo initialization. Fixed that and some
other Windows warnings that have crept in.
|
|
c1b5e8c4
|
2013-02-15T11:35:33
|
|
branch: Make git_branch_remote_name() cope with orphaned heads
|
|
56543a60
|
2013-02-15T16:02:45
|
|
Clear up warnings from cppcheck
The cppcheck static analyzer generates warnings for a bunch of
places in the libgit2 code base. All the ones fixed in this
commit are actually false positives, but I've reorganized the
code to hopefully make it easier for static analysis tools to
correctly understand the structure. I wouldn't do this if I
felt like it was making the code harder to read or worse for
humans, but in this case, these fixes don't seem too bad and will
hopefully make it easier for better analysis tools to get at any
real issues.
|
|
2bca5b67
|
2013-02-07T23:44:18
|
|
remote: Introduce git_remote_is_valid_name()
Fix libgit2/libgit2sharp#318
|
|
4d811c3b
|
2013-02-07T23:40:10
|
|
refs: No component of a refname can end with '.lock'
|
|
e5ef0f18
|
2013-01-31T20:23:30
|
|
refs: handle ALLOW_ONELEVEL normalization with leading slash
A leading slash confuses the name normalization code when the flags
include ALLOW_ONELEVEL. Catch this case in particular to avoid
triggering an assertion in the uppercase check which expects us not to
pass it an empty string.
The existing tests don't catch this as they simply use the NORMAL
flag.
This fixes #1300.
|
|
cb35094b
|
2013-01-22T15:49:51
|
|
Allow peeled references without trailing newline at end of file
Also ammends one of the tag tests to make sure it's working.
|