.
I don't plan to turn this into a gigantic project or anything, but I
find this script really useful so I wanted to put it out in the world.
Feedback and/or pull requests welcome!
Michael
[1] The name sucks, I know :-/
[2] https://github.com/mhagger/git-test/blob/master/README.md
27;t accommodate
consecutive slashes", for reasons discussed on the ML [4].
Michael
[1] http://public-inbox.org/git/cover.1455626201.git.mhag...@alum.mit.edu/T/#u
[2] http://public-inbox.org/git/cover.1456405698.git.mhag...@alum.mit.edu/T/#u
[3] http://public-inbox.org/git/cover.14831534
Besides shortening the code, this saves an unnecessary call to
safe_create_leading_directories_const() in almost all cases.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 73 +---
1 file changed, 30 insertions(+), 43 deletions(-)
diff
The exit path for SCLD_EXISTS wasn't setting errno, which some callers
use to generate error messages for the user. Fix the problem and
document that the function sets errno correctly to help avoid similar
regressions in the future.
Signed-off-by: Michael Haggerty
---
cache.h
Add a new "flags" parameter that tells the function whether to remove
empty parent directories of the loose reference file, of the reflog
file, or both. The new functionality is not yet used.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 24 ++--
1 fi
ation* of these directories could
race with our deletion of them. But the earlier changes in this patch
series made the creation paths robust against races, so now it is safe
to tidy them up more aggressively.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 34 --
It was hardly doing anything anymore, and had only one caller.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 25 +++--
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 4d55364..9abd7c3 100644
--- a
-by: Michael Haggerty
---
refs/files-backend.c | 39 ++-
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 27d4fd3..f723834 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2719,19
Instead of coding the retry loop inline, use raceproof_create_file() to
make lock acquisition safe against directory creation/deletion races.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 35 +--
1 file changed, 9 insertions(+), 26 deletions(-)
diff
`lflags` is set a single time then never changed, so just inline it.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index be4ffdc..7d4658a 100644
--- a/refs/files
Instead of looking on the filesystem inside ".git/refs/remotes/origin",
use "git for-each-ref" to check for leftover references under the
remote's old name.
Signed-off-by: Michael Haggerty
---
t/t5505-remote.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion
The behavior of this function (especially how it handles errors) is
quite different depending on whether we are willing to create the reflog
vs. whether we are only trying to open an existing reflog. So separate
the code paths.
This also simplifies the next steps.
Signed-off-by: Michael Haggerty
was
previously done unconditionally.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 41 ++---
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c8f6d82..27d4fd3 100644
--- a/refs/files
It is simpler to derive the path to the file that must be deleted from
"lock->ref_name" than from the lock_file object.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/fi
* Don't capitalize error strings
* Report true paths of affected files
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 3f18a01..49a119c 100644
--- a/refs/
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index f902393..be4ffdc 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2631,7 +2631,7 @@ static int
Some implementations of free() change errno (even thought they
shouldn't):
https://sourceware.org/bugzilla/show_bug.cgi?id=17924
So preserve the errno from safe_create_leading_directories() across the
call to free().
Signed-off-by: Michael Haggerty
---
sha1_file.c | 4
1 file ch
eters before the output parameters.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 69 ++--
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 9c5e804..846380f 100644
--- a
It's bad manners and surprising and therefore error-prone.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 92a9d99..88f8c7a 100644
--- a/refs/
This is the standard nomenclature.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 9abd7c3..92a9d99 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
This function doesn't do anything beyond call files_log_ref_write(), so
replace it with the latter at its call sites.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 24 ++--
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/refs/files-backen
ormalizing the part of a refname following "refs/" is identical to that
part of the original refname. Fix the docstring.
Signed-off-by: Michael Haggerty
---
refs/refs-internal.h | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/refs/refs-internal.h b/refs/r
yet used.
Signed-off-by: Michael Haggerty
---
cache.h | 43 ++
sha1_file.c | 68 +
2 files changed, 111 insertions(+)
diff --git a/cache.h b/cache.h
index 8177c3a..95cde14 100644
--- a/cache.h
Now files_log_ref_write() doesn't do anything beyond call
log_ref_write_1(), so inline the latter into the former.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs/
It's unnecessary to pass a strbuf holding the reflog path up and down
the call stack now that it is hardly needed by the callers. Remove the
places where log_ref_write_1() uses it, in preparation for making it
internal to log_ref_setup().
Signed-off-by: Michael Haggerty
---
refs/files-back
On 01/07/2017 08:18 AM, Jeff King wrote:
> On Fri, Jan 06, 2017 at 04:52:16PM +0100, Michael Haggerty wrote:
>
>> I just released `git test`, a script for running automated
>> tests across a range of Git commits and keeping track of the results in
>> gi
On 01/10/2017 10:35 AM, Jeff King wrote:
> On Sun, Jan 08, 2017 at 10:52:25AM +0100, Michael Haggerty wrote:
>> [...]
Since my last email, I have implemented a bunch of what we discussed
[1]. Because of the new semantics, I also *renamed the main command* from
git test range
when running commands like pull and clone I get the following message:
Cygwin WARNING:
Couldn't compute FAST_CWD pointer. This typically occurs if you're using
an older Cygwin version on a newer Windows. Please update to the latest
available Cygwin version from https://cygwin.com/. If th
cts with a loose ref or
vice versa.
* Symrefs, which are loose, can point at packed references.
I've taken some stabs at picking these apart into separate ref stores,
but haven't had time to make very satisfying progress. By the time of
GitMerge I might have a better feeling for whether I can devote some
time to this project.
Michael
[1] https://github.com/mhagger/git
-free merge and a merge
conflict that is resolved by with the changes from one the parents?
Thanks,
--Michael
hange this to return the
proper relative path to the git directory.
Related tests marked to expect failure are updated to expect success
Signed-off-by: Michael Rappazzo
---
builtin/rev-parse.c | 19 ++-
t/t1500-rev-parse.sh | 4 ++--
t/t1700-split-index.sh | 2 +
-dir
which has been adjusted and marked to expect failure.
Some of the tests added have been marked to expect failure. These
demonstrate a problem with the way that some options to git rev-parse
behave when executed from a subdirectory of the main worktree.
Signed-off-by: Michael Rappazzo
---
t
Differenced from v2[1]:
- Rewrote the commits to just two; one that introduces tests, and
one which fixes the problem.
[1] http://thread.gmane.org/gmane.comp.version-control.git/292272
Michael Rappazzo (2):
rev-parse tests: add tests executed from a subdirectory
rev-parse: fix some
the reference exists as a packed ref. This probably
hasn't been reported before because Git usually cleans up empty
directories when packing references.
This bug will be fixed shortly.
Signed-off-by: Michael Haggerty
---
t/t1404-update-ref-df-conflicts.sh
Document the difference between this function and
safe_create_leading_directories_const(), and that the former restores
path before returning.
Signed-off-by: Michael Haggerty
---
cache.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/cache.h b/cache.h
index 2711048..4134f64 100644
Add a docstring for the remove_dir_recursively() function and the
REMOVE_DIR_* flags that can be passed to it.
Signed-off-by: Michael Haggerty
---
dir.h | 23 +++
1 file changed, 23 insertions(+)
diff --git a/dir.h b/dir.h
index 301b737..5f19acc 100644
--- a/dir.h
+++ b
only handle REF_NODEREF mode": initialize
`ref_name` only once, as its value can be reused.
This patch series is also available from my GitHub repo [2] as branch
"split-under-lock".
[1] http://thread.gmane.org/gmane.comp.version-control.git/292772
[2] https://github.com/mhag
Even if there is an empty directory where we look for the loose version
of a reference, check for a packed reference before giving up. This
fixes the failing test that was introduced two commits ago.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 11 ++-
t
Signed-off-by: Michael Haggerty
---
refs.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index 87dc82f..5789152 100644
--- a/refs.c
+++ b/refs.c
@@ -120,17 +120,19 @@ int check_refname_format(const char *refname, int flags)
int refname_is_safe
Signed-off-by: Michael Haggerty
---
refs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 5789152..ca0280f 100644
--- a/refs.c
+++ b/refs.c
@@ -136,11 +136,12 @@ int refname_is_safe(const char *refname)
free(buf
The two string_list arguments can be const.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 4 ++--
refs/refs-internal.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index ad53b6e..f0eef9e 100644
--- a/refs/files
Among other things, document the (important!) requirement that input
refname be checked for safety before calling this function.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 41 -
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git
This avoids the need for a forward declaration in the next patch.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1c20af5..8ff76ed 100644
--- a
This is more convenient and less error-prone for callers.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index fa8bbd6..8ced104 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
roken symref would use the pointed-to ref name for the moved
reflog.
Add a test for the reflog bug.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 21 -
t/t3200-branch.sh| 9 +
2 files change
resolve_ref_unsafe() can cope with being called with NULL passed to its
flags argument. So lock_ref_sha1_basic() can just hand its own type
parameter through.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a
The reference name is going to be compared to other reference names, so
it should be in its normalized form.
Signed-off-by: Michael Haggerty
---
refs.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index ca0280f..b18d995 100644
--- a/refs.c
+++ b
in the old code, the
old_sha1 of the symref was resolved before the reference that it pointed
at was locked. So it was possible that the old_sha1 value logged to the
symref's reflog could be wrong if another process changed the downstream
reference before it was locked.
Signed-off-by: Michael
Change add_update() to initialize all of the fields in the new
ref_update object. Rename the function to ref_transaction_add_update(),
and increase its visibility to all of the refs-related code.
All of this makes the function more useful for other future callers.
Signed-off-by: Michael Haggerty
This will hopefully reduce confusion with the "flags" arguments that are
used in many functions in this module as an input parameter to choose
how the function should operate.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 18 +-
refs/refs-internal.h | 2 +
e the read_ref_full() call into the (update->type & REF_ISSYMREF)
block.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 52
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-bac
ff-by: Michael Haggerty
---
refs/files-backend.c | 20 +---
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 80d346f..93a94af 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3076,7 +3076,6 @
It is nonsensical (and a little bit dangerous) to use REF_ISPRUNING
without REF_NODEREF. Forbid it explicitly. Change the one REF_ISPRUNING
caller to pass REF_NODEREF too.
Signed-off-by: Michael Haggerty
---
refs.c | 3 +++
refs/files-backend.c | 2 +-
refs/refs-internal.h | 2
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2d3a8c6..80d346f 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2360,20 +2360,17 @@ int
Extract a new function, lock_ref_for_update(), from
ref_transaction_commit().
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 152 ---
1 file changed, 85 insertions(+), 67 deletions(-)
diff --git a/refs/files-backend.c b/refs/files
After all, it doesn't hold the symbolic reference, but rather the
reference referred to.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 21 +++--
refs/refs-internal.h | 2 +-
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/refs/files-backen
commit_ref_update() is now only called with flags=0. So remove the flags
parameter entirely.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 08ec293
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 38 --
refs/refs-internal.h | 38 ++
2 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 73717dd
The return value of resolve_ref_unsafe() is not guaranteed to stay
around as long as we need it, so use resolve_refdup() instead.
Signed-off-by: Michael Haggerty
---
builtin/branch.c | 19 +++
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/builtin/branch.c b
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 24
1 file changed, 24 insertions(+)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1f38076..ad9cd86 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2457,6 +2457,30 @@ static int
If the user has asked that a new value be set for a reference, we use
check_refname_format() to verify that the reference name satisfies all
of the rules. But in other cases, at least check that refname_is_safe().
Signed-off-by: Michael Haggerty
---
refs.c | 5 +++--
t/t1400
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 0cc116d..2d3a8c6 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2719,7 +2719,7 @@ static int
* Always start error messages with a lower-case letter.
* Always enclose reference names in single quotes.
Signed-off-by: Michael Haggerty
---
refs.c| 8
refs/files-backend.c | 32
t/t1400-update-ref.sh | 4 ++--
3 files changed, 22
flogs for symbolic references
if there is a concurrent update by another process, since the old_oid
of a symref is determined before the lock on the pointed-to ref is
held.
Both problems will soon be fixed.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Mi
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 7cc680a..f4f7953 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3139,6 +3139,7 @@ int ref_transaction_commit(struct
From: David Turner
The refs infrastructure learns about log-only ref updates, which only
update the reflog. Later, we will use this to separate symbolic
reference resolution from ref updating.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
_lock::orig_ref_name
* Remove local variable orig_refname from lock_ref_sha1_basic()
* ref_name can be initialize once and its value reused
* commit_ref_update() never has to write to the reflog for
lock->orig_ref_name
Signed-off-by: Michael Haggerty
---
refs/files-backen
e breakage was fixed by the same fix, or whether it
wasn't broken in the first place and the fix was unnecessary.
Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
also
available from my GitHub repo [1] as branch "split-under-lock".
Please note that there are still some calls of
verify_refname_available_dir() against the loose reference cache in this
function. If we wanted to give up a little bit on the quality of our
error messages, I think we cou
flogs for symbolic references
if there is a concurrent update by another process, since the old_oid
of a symref is determined before the lock on the pointed-to ref is
held.
Both problems will soon be fixed.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Mi
one helps:
$ TZ=UTC git log --pretty=format:%ad --date=format:%s -1
Expected result: still 1463260938.
Observed result: 1463268138 (7200s = 2 hours ahead).
FWIW, personally I have not bound the TZ environment variable, my time
zone is constantly that of Berlin, currently CEST.
Many thanks i
Michael Heerdegen writes:
> the command
>
>git log --pretty=format:%ad --date=format:%s
>
> displays wrong unixtime values; apparently how much the printed value
> differs from the expected value depends on the system's time zone and
> whether daylight savings ti
s
rounded duration values (rounded hours in my case) in its log views, I
think I just got confused because of this. In my tests now, the results
were as expected.
Thanks,
Michael.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@v
e
format parsing needed).
That's why it would be good if the unix time values could be relied on.
Conclusion: in addition to 3., I wished both epoch times were also
correct per se.
Regards,
Michael.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body
Jeff King writes:
> Oh, I agree that unix times are handy. I just think that "use %at in the
> pretty-format, instead of %ad and then %s in the date-format" is not
> such a bad workaround.
I had missed %at (and %ct). Yes, works perfectly - thanks for the hint.
Regar
subdirectory of the main worktree.
Signed-off-by: Michael Rappazzo
---
t/t1500-rev-parse.sh | 28
t/t1700-split-index.sh | 17 +
t/t2027-worktree-list.sh | 12 ++--
3 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/t/t1500-rev
hange this to return the
proper relative path to the git directory.
Related tests marked to expect failure are updated to expect success
Signed-off-by: Michael Rappazzo
---
builtin/rev-parse.c | 22 +-
t/t1500-rev-parse.sh | 4 ++--
t/t1700-split-index.sh | 2 +
Changes since v3 [1]:
- Rebased onto 'pu' which includes the cleanup of t1500 by Eric Sunshine
- Fixed a memory leak due to misusing xstrfmt()
[1] http://thread.gmane.org/gmane.comp.version-control.git/293778
Michael Rappazzo (2):
rev-parse tests: add tests executed from a subdirec
For those who use two-factor authentication with gmail, git-send-email
will not work unless it is setup with an app-specific password. The
example for setting up git-send-email for use with gmail will now
include information on generating and storing the app-specific password.
---
Documentation/gi
fter this patch).
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 113 ---
refs/refs-internal.h | 7
2 files changed, 78 insertions(+), 42 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index a7cc0e2..2e0d0
Free up the old name for a more general purpose.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 142c977..1a46f32 100644
--- a/refs/files-backend.c
+++ b/refs
es for the
purpose of determining object reachability!) and wouldn't benefit from
a truncated iteration anyway.
So instead, emit an error message and skip the "broken" reflog, but
continue with the iteration.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1
f these changes, but I will work on
that next.
Michael
[1] http://thread.gmane.org/gmane.comp.version-control.git/290409
[2]
http://mid.gmane.org/89634d216544d1102dafd5d18247bff2581d48a8.1464537050.git.mhag...@alum.mit.edu
[3] https://github.com/mhagger/git
Michael Haggerty (13):
refs: remove un
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 -
refs/refs-internal.h | 10 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1230dfb..68db3e8 100644
--- a/refs/files-backend.c
+++ b/refs/files
trees and possibly other types of
iterators in the future.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
iterator.h | 81
refs.h | 4 +-
refs/files-backend.c | 282 ++
This will be useful for passing REF_NODEREF through.
Signed-off-by: Michael Haggerty
---
builtin/fetch.c | 2 +-
builtin/remote.c | 4 ++--
refs.h | 5 +++--
refs/files-backend.c | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/builtin/fetch.c b
In the context of the for_each_ref() functions, call the prefix that
references must start with "prefix". (In some places it was called
"base".) This is clearer, and also prevents confusion with another
planned use of the word "base".
Signed-off-by: Michael Hagge
There's continuing work in this area, so clean up unneeded "extern"
keywords rather than schlepping them around. Also split up some overlong
lines and add parameter names in a couple of places.
Signed-off-by: Michael Haggerty
--
.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
dir-iterator.c | 180 +
dir-iterator.h | 86 +++
3 files changed, 267 insertions(+)
create mode 100644 dir-iterator.c
create mode 100644 dir-iterator.h
ation
in a more straightforward manner.
If we rewrite all callers to use the reference iteration API, then we
can remove the current_ref_iter hack permanently.
Signed-off-by: Michael Haggerty
---
refs.c | 20 +
refs/files-backend.c | 206 ++
If there is not a nonbare repository where a submodule is supposedly
located, then don't instantiate a ref_cache for it.
The analogous check can be removed from resolve_gitlink_ref().
Signed-off-by: Michael Haggerty
---
This doesn't actually reduce the number of ref_cache instances
ge
Extract new function ref_resolves_to_object() from
entry_resolves_to_object(). It can be used even if there is no ref_entry
at hand.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a
option set to REF_NODEREF.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index 1bbf9b4..c4b4d67 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -539,10 +539,6 @@ static int
On 05/30/2016 06:57 PM, Ramsay Jones wrote:
>
>
> On 30/05/16 16:22, Ramsay Jones wrote:
>>
>>
>> On 30/05/16 08:55, Michael Haggerty wrote:
>> [snip]
>>
>>> /* Reference is a symbolic reference. */
>>> diff --git a/refs/files-backend.c
uf_check_behavior")) {
> + strbuf_init(&sb, 0);
> + return test_usual(&sb);
> + } else if (!strcmp(argv[1], "grow_overflow")) {
> + /*
> + * size_t overflow: should die()
> + */
> + strbuf_init(&sb, 1000);
> + strbuf_grow(&sb, maximum_unsigned_value_of_type((size_t)1));
> + } else {
> + usage("test-strbuf mode");
> + }
Consider putting each test in a separate function, rather than
implementing some tests inline and one as a function. Consistency makes
code easier to read.
> [...]
Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
et a strbuf passed to it from a caller, and that
caller might someday be modified to use stack-allocated strings. So I
think that at least the valgrind test suggested above would be prudent.
Michael
[1]
https://github.com/git/git/blob/f3913c2d03abc660140678a9e14dac399f847647/strbuf.h#L20-L23
--
To
be
named more like `strbuf_attach()` to emphasize their similarity to that
existing function. Maybe
strbuf_attach_fixed(struct strbuf *sb, void *s, size_t len, size_t
alloc);
strbuf_attach_movable(struct strbuf *sb, void *s, size_t len, size_t
alloc);
Michael
--
To unsubscribe from this
) function in builtin/remote.c [2] for an example.
[1]
https://github.com/git/git/blob/f3913c2d03abc660140678a9e14dac399f847647/refs.h#L176-L184
[2]
https://github.com/git/git/blob/f3913c2d03abc660140678a9e14dac399f847647/builtin/remote.c#L738
> [...]
Michael
--
To unsubscribe from this list:
On 05/31/2016 07:29 AM, Eric Sunshine wrote:
> On Mon, May 30, 2016 at 3:55 AM, Michael Haggerty
> wrote:
>> [...]
> [...]
> Either:
>
> s/false/something other than ITER_OK/
>
> or:
>
> s/false/ITER_DONE or ITER_ERROR/
Thanks.
>> +in
On 05/31/2016 08:41 AM, Johannes Schindelin wrote:
> Hi Michael,
>
> On Tue, 31 May 2016, Michael Haggerty wrote:
>
>> On 05/30/2016 02:13 PM, Johannes Schindelin wrote:
>>> [...]
>>>> @@ -38,7 +67,11 @@ char *strbuf_detach(struct strbuf *sb
901 - 1000 of 1916 matches
Mail list logo