Commit Graph

122 Commits

Author SHA1 Message Date
Edward Thomson
909d549436 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
2016-12-29 12:26:03 +00:00
Arthur Schreiber
ab96ca5572 Make sure we use the C locale for regcomp on macOS. 2016-10-06 13:15:31 +02:00
Vicent Marti
1e71354e34 reflog: Error handling on empty reflog 2014-09-05 03:25:53 +02:00
Carlos Martín Nieto
c74077d13c revparse: do look at all refs when matching text
Now that we no longer fail to push non-commits on a glob, let's search
on all refs when we rev-parse syntax asks us to match text.
2014-02-05 12:16:44 +01:00
Linquize
e7c66fc89b git_reflog_entry_message can be null 2014-01-20 23:32:18 +08:00
Carlos Martín Nieto
b976f3c2c2 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.
2013-10-02 06:53:24 +02:00
nulltoken
8cf8052534 errors: Fix format of some error messages 2013-09-11 20:13:59 +02:00
nulltoken
1634df8c28 revparse: Simplify error handling 2013-09-07 17:48:06 +02:00
nulltoken
a8d67afe42 revparse: Prevent unnecessary odb backend calls 2013-09-07 17:48:05 +02:00
Carlos Martín Nieto
6d69fbce31 Revparse does not handle refspecs 2013-08-19 13:04:05 +02:00
Evan Hanson
1616fa68e5 revparse: Use more idiomatic error value test 2013-08-15 17:25:05 +12:00
Evan Hanson
899ec41fa1 revparse: Free left side of invalid range revspecs
This fixes a small memory leak in git_revparse where early returns on
errors from git_revparse_single cause a free() on the (reallocated) left
side of the revspec to be skipped.
2013-08-15 16:25:48 +12:00
nulltoken
80fd31faf7 revparse: Don't return a reference when asked for a git object
Fix #1722
2013-07-13 16:07:10 +02:00
Russell Belfer
37f66e8263 Fix Windows warnings
This fixes problems with missing function prototypes and 64-bit
data issues on Windows.
2013-06-12 15:21:21 -07:00
nulltoken
f672cd2a09 revparse: Make revparse_ext() return git_reference from names as well 2013-05-16 21:43:31 +02:00
nulltoken
e841c533d7 revparse: Introduce git_revparse_ext()
Expose a way to retrieve, along with the target git_object, the reference
pointed at by some revparse expression (`@{<-n>}` or
`<branchname>@{upstream}` syntax).
2013-05-16 21:43:24 +02:00
nulltoken
dcaa898d82 revparse: Simplify temporary reference freeing 2013-05-16 21:20:08 +02:00
nulltoken
1fed6b07f0 Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
Carlos Martín Nieto
98d633cccf Expose git_reference_dwim
Extract this function out of the rev-parse code to be able to DWIM a
reference instead of its target.
2013-05-07 23:34:48 +02:00
Russell Belfer
f470b00b03 Fix one error not reported in revparse
There are many paths through revparse that may return an error
code without reporting an error, I believe.  This fixes one of
them.  Because of the backtracking in revparse, it is pretty
complicated to fix the others.
2013-05-01 15:48:40 -07:00
Russell Belfer
2aee1aa416 Fix uninitialized var warnings 2013-04-18 14:59:25 -07:00
Vicent Marti
cbda09d00b git_revision -> git_revspec 2013-04-15 23:40:46 +02:00
Vicent Marti
36c2dfed69 Is this crazy? 2013-04-15 23:32:40 +02:00
Vicent Marti
d064c74794 Merge remote-tracking branch 'ben/unified-revparse' into development 2013-04-15 23:18:24 +02:00
Ben Straub
299a224be1 Change git_revparse to output git_object pointers
This will probably prevent many lookup/free
operations in calling code.
2013-04-15 12:00:04 -07:00
Ben Straub
4291ad0781 Reintroduce git_revparse_single. 2013-04-15 11:42:34 -07:00
Vicent Martí
ea8bac37b0 Merge pull request #1450 from carlosmn/branch-upstream
Branch upstream configuration
2013-04-11 06:34:59 -07:00
Vicent Marti
575a54db85 object: Export git_object_dup 2013-04-10 16:56:32 +02:00
Ben Straub
1aa21fe3b8 Deprecate git_revparse_single and _rangelike 2013-04-09 05:07:04 +04:00
Ben Straub
8480eef7ee Implement unified git_revparse 2013-04-08 16:36:11 +04:00
Vicent Marti
d9ecaf8c6f Merge remote-tracking branch 'gnprice/revwalk' into development 2013-04-07 07:22:38 +02:00
Greg Price
b208d90022 revparse: Parse range-like syntax
Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Carlos Martín Nieto
a258d8e357 branch: rename 'tracking' to 'upstream'
The term 'tracking' is overloaded. Help distinguish what we mean by
using 'upstream' for this part of the library.
2013-03-30 15:45:57 +01:00
Arkadiy Shapkin
10c06114cb 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
2013-03-18 03:30:26 +04:00
Edward Thomson
d00d54645d immutable references and a pluggable ref database 2013-03-07 11:01:52 -06:00
nulltoken
0e8e5a6189 revparse: Lookup sha before branch 2013-02-03 11:44:26 +01:00
nulltoken
545b479a07 revparse: Lookup branch before described tag
Fix #1306
2013-02-03 11:18:24 +01:00
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
nulltoken
cc1466264a revparse: Deploy EINVALIDSPEC usage 2012-12-01 08:34:31 +01:00
Russell Belfer
a8122b5d4a Fix warnings on Win64 build 2012-11-27 13:18:29 -08:00
Ben Straub
2508cc66eb Rename ref and reflog apis for consistency 2012-11-27 13:17:45 -08:00
Michael Schubert
0066955d97 Fix a couple of warnings 2012-11-18 04:27:49 +01:00
nulltoken
b15df1d937 reflog: make entry_byindex() and drop() git compliant
Passing 0 as the index now retrieves the most recent entry instead
of the oldest one.
2012-11-17 18:30:35 -08:00
nulltoken
5912d74c69 revparse: properly handle refnames containing a @
Fix #994
2012-10-18 23:05:33 +02:00
nulltoken
74a2400514 refs: use constants for well-known names 2012-10-07 12:04:19 +02:00
nulltoken
77e06d7e85 refs: introduce git_reference_is_valid_name() 2012-09-25 07:49:15 +02:00
Russell Belfer
f335ecd6e1 Diff iterators
This refactors the diff output code so that an iterator object
can be used to traverse and generate the diffs, instead of just
the `foreach()` style with callbacks.  The code has been rearranged
so that the two styles can still share most functions.

This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses
that as a common error code for marking the end of iteration when
using a iterator style of object.
2012-09-05 15:17:24 -07:00
Vicent Marti
e25dda51c4 Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into development
Conflicts:
	src/netops.c
	src/netops.h
	src/oid.c
2012-08-02 01:38:30 +02:00
nulltoken
b8457baae2 portability: Improve x86/amd64 compatibility 2012-07-24 16:10:12 +02:00
nulltoken
fb910281d6 branch: introduce git_branch_tracking() 2012-07-24 16:09:48 +02:00