Re: [ANNOUNCE] git-test: run automated tests against a range of Git commits

2017-01-08 Thread Michael Haggerty
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

[PATCH v4 15/23] log_ref_write_1(): don't depend on logfile argument

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.

[PATCH v4 17/23] log_ref_write_1(): inline function

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/refs

[PATCH v4 06/23] raceproof_create_file(): new function

2017-01-06 Thread Michael Haggerty
is not yet used. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- cache.h | 43 ++ sha1_file.c | 68 + 2 files changed, 111 insertions(+) diff --git a/cache.h b/cache.h index 8177c3a..9

[PATCH v4 04/23] safe_create_leading_directories_const(): preserve errno

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- sha1_file

[PATCH v4 16/23] log_ref_setup(): manage the name of the reflog file internally

2017-01-06 Thread Michael Haggerty
before the output parameters. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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..8

[PATCH v4 11/23] log_ref_write(): inline function

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v4 02/23] refname_is_safe(): correct docstring

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/refs-internal.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/r

[PATCH v4 12/23] log_ref_setup(): separate code for create vs non-create

2017-01-06 Thread Michael Haggerty
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

[PATCH v4 14/23] log_ref_setup(): pass the open file descriptor back to the caller

2017-01-06 Thread Michael Haggerty
-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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

[PATCH v4 08/23] lock_ref_sha1_basic(): use raceproof_create_file()

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 35 +-- 1 file changed, 9 inse

[PATCH v4 07/23] lock_ref_sha1_basic(): inline constant

2017-01-06 Thread Michael Haggerty
`lflags` is set a single time then never changed, so just inline it. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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

[PATCH v4 03/23] t5505: use "for-each-ref" to test for the non-existence of references

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- t/t5505-remote.sh | 2 +- 1 file changed, 1 inserti

[PATCH v4 13/23] log_ref_setup(): improve robustness against races

2017-01-06 Thread Michael Haggerty
that was previously done unconditionally. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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..2

[PATCH v4 18/23] delete_ref_loose(): derive loose reference path from lock

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ref

[PATCH v4 10/23] rename_tmp_log(): improve error reporting

2017-01-06 Thread Michael Haggerty
* Don't capitalize error strings * Report true paths of affected files Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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..4

[PATCH v4 01/23] files_rename_ref(): tidy up whitespace

2017-01-06 Thread Michael Haggerty
Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 +

[PATCH v4 21/23] try_remove_empty_parents(): don't trash argument contents

2017-01-06 Thread Michael Haggerty
It's bad manners and surprising and therefore error-prone. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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..8

[PATCH v4 20/23] try_remove_empty_parents(): rename parameter "name" -> "refname"

2017-01-06 Thread Michael Haggerty
This is the standard nomenclature. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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-bac

[PATCH v4 09/23] rename_tmp_log(): use raceproof_create_file()

2017-01-06 Thread Michael Haggerty
Besides shortening the code, this saves an unnecessary call to safe_create_leading_directories_const() in almost all cases. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 73 +--- 1 file changed, 30 inse

[PATCH v4 05/23] safe_create_leading_directories(): set errno on SCLD_EXISTS

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.

[PATCH v4 22/23] try_remove_empty_parents(): teach to remove parents of reflogs, too

2017-01-06 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/file

[PATCH v4 23/23] files_transaction_commit(): clean up empty directories

2017-01-06 Thread Michael Haggerty
* 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 <mhag...@alum.mit.edu> --- refs/files-backend.c

[PATCH v4 19/23] delete_ref_loose(): inline function

2017-01-06 Thread Michael Haggerty
It was hardly doing anything anymore, and had only one caller. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 4

[PATCH v4 00/23] Delete directories left empty after ref deletion

2017-01-06 Thread Michael Haggerty
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.1483153436.gi

[ANNOUNCE] git-test: run automated tests against a range of Git commits

2017-01-06 Thread Michael Haggerty
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

Re: [PATCH 13/17] refs: convert each_reflog_ent_fn to struct object_id

2017-01-02 Thread Michael Haggerty
On 01/02/2017 08:12 PM, brian m. carlson wrote: > On Mon, Jan 02, 2017 at 04:07:16PM +0100, Michael Haggerty wrote: >> On 01/01/2017 08:18 PM, brian m. carlson wrote: >>> /* old SP new SP name SP time TAB msg LF */ >>> if (sb->len <

Re: [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-02 Thread Michael Haggerty
break; > } > > That punts on the issue for all the other callers, but like I said, I'm > not quite sure if, when, and how it would make sense to convert them to > using a "struct oid". Your change is not safe if any of the callback functions ("cb") tuck away a copy of the pointer that they are passed, expecting it to contain the same object id later. Michael

Re: [PATCH v3 00/23] Delete directories left empty after ref deletion

2017-01-02 Thread Michael Haggerty
failed updates rather than corruption. And the races can already occur whenever the user runs `git pack-refs`. By contrast, the failure to delete empty directories is more likely to affect normal users. That being said, if Junio wants to merge all but the last two patches in one release, then merge the last two a release or two later, I have no objections. Michael

Re: [PATCH v3 21/23] try_remove_empty_parents(): don't accommodate consecutive slashes

2017-01-02 Thread Michael Haggerty
On 01/01/2017 06:59 AM, Jeff King wrote: > On Sat, Dec 31, 2016 at 06:30:01PM -0800, Junio C Hamano wrote: > >> Michael Haggerty <mhag...@alum.mit.edu> writes: >> >>> "refname" has already been checked by check_refname_format(), so it >>> c

Re: [PATCH v3 20/23] try_remove_empty_parents(): don't trash argument contents

2017-01-02 Thread Michael Haggerty
On 12/31/2016 07:40 AM, Jeff King wrote: > On Sat, Dec 31, 2016 at 04:13:00AM +0100, Michael Haggerty wrote: > >> It's bad manners and surprising and therefore error-prone. > > Agreed. > > I wondered while reading your earlier patch whether the > safe_create_leading

Re: [PATCH 00/17] object_id part 6

2017-01-02 Thread Michael Haggerty
ct_oid function which provides a struct object_id > version of the nth_packed_object function. > > There is a small known conflict with next, but it can easily be fixed up. I read through all of the patches, and sent a few comments. I didn't notice any other problems. Michael

Re: [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-02 Thread Michael Haggerty
t object_id` could be a big chore, not to mention that needing to keep a 20-byte `struct object_id` around rather than a 8- or 4-byte pointer would also cost more RAM. As you probably can tell, I'm not psyched about straying outside of legal C. It would be nice to see more justification. > [...] Michael

Re: [PATCH 13/17] refs: convert each_reflog_ent_fn to struct object_id

2017-01-02 Thread Michael Haggerty
close_ref(lock) < 0)) { > status |= error("couldn't write %s", > [...] I thought it would make sense to convert `struct read_ref_at_cb` in `refs.c` to use `struct object_id` at the same time, but I see that would require the interface to `read_ref_at()` to change. I guess it's important to pick your battles in this campaign :-) Michael

Re: [PATCH 09/17] builtin/merge: convert to struct object_id

2017-01-02 Thread Michael Haggerty
> + struct object_id result_tree; > + struct object_id stash; > + struct object_id head_oid; These could comfortably be declared on a single line now. > struct commit *head_commit; > struct strbuf buf = STRBUF_INIT; > const char *head_arg; > [...] Michael

[RFC PATCH 1/5] error/warning framework: prepare for l10n

2017-01-02 Thread Michael J Gruber
Currently, errors, warnings etc. are output with a fixed prefix "error: " etc. that is not subject to l10n. Change the call signatures of error_routine() etc. so that they receive the prefix as first argument. Signed-off-by: Michael J Gruber <g...@drmicha.warpmail.net&

[RFC PATCH 0/5] Localise error headers

2017-01-02 Thread Michael J Gruber
occinelli patches 5/5 is not to be applied to the main tree, but helps you try out the feature: it has changes to de.po and git.pot so that e.g. "git branch" has fully localised error messages (see the recipe in the commit message). Michael J Gruber (5): error/warn framework: prepare

[RFC PATCH 3/5] error/warning framework framework: coccinelli rules

2017-01-02 Thread Michael J Gruber
Provide coccinelli rules which check for error(), warning() etc. with localised argument and create a patch to replace them with error_(), warning_() etc. in order to fully localize them. Signed-off-by: Michael J Gruber <g...@drmicha.warpmail.net> --- contrib/coccinelle/errorl10n.cocc

[RFC PATCH 2/5] error/warn framework: provide localized variants

2017-01-02 Thread Michael J Gruber
Provide localized variants of error(), warning(), die() etc. to go along with localized messages. Signed-off-by: Michael J Gruber <g...@drmicha.warpmail.net> --- git-compat-util.h | 8 ++ usage.c | 74 +++ 2 files chang

Re: [PATCH v3 11/23] log_ref_setup(): separate code for create vs non-create

2017-01-01 Thread Michael Haggerty
On 01/01/2017 04:28 AM, Junio C Hamano wrote: > Michael Haggerty <mhag...@alum.mit.edu> writes: > >> +if (errno == ENOENT || errno == EISDIR) { >> +/* >> + * The

Re: [PATCH v3 10/23] log_ref_write(): inline function

2017-01-01 Thread Michael Haggerty
On 01/01/2017 03:09 AM, Junio C Hamano wrote: > Michael Haggerty <mhag...@alum.mit.edu> writes: > >> This function doesn't do anything beyond call files_log_ref_write(), so > > s/call//; I think. Thanks; will fix. Michael

Re: [PATCH v3 14/23] log_ref_write_1(): don't depend on logfile argument

2016-12-31 Thread Michael Haggerty
On 12/31/2016 07:35 AM, Jeff King wrote: > On Sat, Dec 31, 2016 at 04:12:54AM +0100, Michael Haggerty wrote: > >> 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 wher

Re: [PATCH v3 13/23] log_ref_setup(): pass the open file descriptor back to the caller

2016-12-30 Thread Michael Haggerty
On 12/31/2016 07:32 AM, Jeff King wrote: > On Sat, Dec 31, 2016 at 04:12:53AM +0100, Michael Haggerty wrote: > >> This function will most often be called by log_ref_write_1(), which >> wants to append to the reflog file. In that case, it is silly to close >> the file only

Re: [PATCH v3 11/23] log_ref_setup(): separate code for create vs non-create

2016-12-30 Thread Michael Haggerty
On 12/31/2016 07:26 AM, Jeff King wrote: > On Sat, Dec 31, 2016 at 04:12:51AM +0100, Michael Haggerty wrote: >> [...] >> -adjust_shared_perm(logfile->buf); >> -close(logfd); >> +if (logfd >= 0) { >> +adjust_shared_perm(log

Re: [PATCH v3 05/23] raceproof_create_file(): new function

2016-12-30 Thread Michael Haggerty
On 12/31/2016 07:11 AM, Jeff King wrote: > On Sat, Dec 31, 2016 at 04:12:45AM +0100, Michael Haggerty wrote: >> [...] >> +/* >> + * Callback function for raceproof_create_file(). This function is >> + * expected to do something that makes dirname(path) permanent despite

[PATCH v3 14/23] log_ref_write_1(): don't depend on logfile argument

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.

[PATCH v3 08/23] rename_tmp_log(): use raceproof_create_file()

2016-12-30 Thread Michael Haggerty
Besides shortening the code, this saves an unnecessary call to safe_create_leading_directories_const() in almost all cases. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 73 +--- 1 file changed, 30 inse

[PATCH v3 09/23] rename_tmp_log(): improve error reporting

2016-12-30 Thread Michael Haggerty
* Don't capitalize error strings * Report true paths of affected files Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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..4

[PATCH v3 04/23] safe_create_leading_directories(): set errno on SCLD_EXISTS

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.

[PATCH v3 10/23] log_ref_write(): inline function

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v3 01/23] files_rename_ref(): tidy up whitespace

2016-12-30 Thread Michael Haggerty
Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 +

[PATCH v3 05/23] raceproof_create_file(): new function

2016-12-30 Thread Michael Haggerty
is not yet used. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- cache.h | 43 ++ sha1_file.c | 68 + 2 files changed, 111 insertions(+) diff --git a/cache.h b/cache.h index 8177c3a..7

[PATCH v3 00/23] Delete directories left empty after ref deletion

2016-12-30 Thread Michael Haggerty
directories. So most of this patch series is dedicated to hardening up the creation code paths (via a new function, `raceproof_create_file()`). The last several patches teach `files_transaction_commit()` to delete empty directories when deleting references and reflogs. Michael [1] http://public

[PATCH v3 02/23] t5505: use "for-each-ref" to test for the non-existence of references

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- t/t5505-remote.sh | 2 +- 1 file changed, 1 inserti

[PATCH v3 03/23] safe_create_leading_directories_const(): preserve errno

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- sha1_file

[PATCH v3 06/23] lock_ref_sha1_basic(): inline constant

2016-12-30 Thread Michael Haggerty
`lflags` is set a single time then never changed, so just inline it. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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

[PATCH v3 16/23] log_ref_write_1(): inline function

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/refs

[PATCH v3 18/23] delete_ref_loose(): inline function

2016-12-30 Thread Michael Haggerty
It was hardly doing anything anymore, and had only one caller. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 8

[PATCH v3 07/23] lock_ref_sha1_basic(): use raceproof_create_file()

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 35 +-- 1 file changed, 9 inse

[PATCH v3 11/23] log_ref_setup(): separate code for create vs non-create

2016-12-30 Thread Michael Haggerty
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

[PATCH v3 19/23] try_remove_empty_parents(): rename parameter "name" -> "refname"

2016-12-30 Thread Michael Haggerty
This is the standard nomenclature. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 e81c8a9..0275c8d 100644 --- a/refs/files-bac

[PATCH v3 13/23] log_ref_setup(): pass the open file descriptor back to the caller

2016-12-30 Thread Michael Haggerty
-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 345f7c3..7f26cf8 100644 --- a/refs/files-backend.c +++ b/refs

[PATCH v3 12/23] log_ref_setup(): improve robustness against races

2016-12-30 Thread Michael Haggerty
that was previously done unconditionally. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 47c7829..3

[PATCH v3 20/23] try_remove_empty_parents(): don't trash argument contents

2016-12-30 Thread Michael Haggerty
It's bad manners and surprising and therefore error-prone. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 0275c8d..a

[PATCH v3 17/23] delete_ref_loose(): derive loose reference path from lock

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/files-backend.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ref

[PATCH v3 15/23] log_ref_setup(): manage the name of the reflog file internally

2016-12-30 Thread Michael Haggerty
before the output parameters. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- 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 5a96424..4

[PATCH v3 23/23] files_transaction_commit(): clean up empty directories

2016-12-30 Thread Michael Haggerty
* 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 <mhag...@alum.mit.edu> --- refs/files-backend.c

[PATCH v3 22/23] try_remove_empty_parents(): teach to remove parents of reflogs, too

2016-12-30 Thread Michael Haggerty
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 <mhag...@alum.mit.edu> --- refs/file

[PATCH v3 21/23] try_remove_empty_parents(): don't accommodate consecutive slashes

2016-12-30 Thread Michael Haggerty
"refname" has already been checked by check_refname_format(), so it cannot have consecutive slashes. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- refs/files-backend.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/refs/files-backen

Re: Intermittent failure of t0021

2016-12-27 Thread Michael Haggerty
On 12/27/2016 08:21 PM, Michael Haggerty wrote: > I'm seeing intermittent failures of t0021. [...] Just after submitting this, I saw that the problem has already been reported and a fix proposed: http://public-inbox.org/git/dd8decbc-f856-4f68-6d77-7ea9d5f9d...@ramsayjones.plus.com/ So

Intermittent failure of t0021

2016-12-27 Thread Michael Haggerty
single failure. So *something* seems to have been changed for the worse by this commit. I don't plan to look into it any further, but if you have trouble reproducing the problem don't hesitate to contact me. Michael

Re: What's cooking in git.git (Dec 2016, #05; Mon, 19)

2016-12-27 Thread Michael Haggerty
On 12/27/2016 06:16 PM, Junio C Hamano wrote: > Michael Haggerty <mhag...@alum.mit.edu> writes: > >> Sorry I didn't notice this earlier, but the `LOCK_REPORT_ON_ERROR` >> constant introduced by >> >> 3f061bf "lockfile: LOCK_REPORT_ON_ERROR", 2016

Re: What's cooking in git.git (Dec 2016, #05; Mon, 19)

2016-12-27 Thread Michael Haggerty
t;lockfile: LOCK_REPORT_ON_ERROR", 2016-12-07 sets that constant to the value 2, which is the same value set for the existing constant `LOCK_NO_DEREF`. Both constants define bits that can be set in the `flags` argument of `hold_lock_file_for_update()`, so one of these values needs to be changed. Michael

Re: [PATCH] diff: prefer indent heuristic over compaction heuristic

2016-12-24 Thread Michael Haggerty
On 12/23/2016 10:17 PM, Junio C Hamano wrote: > Junio C Hamano <gits...@pobox.com> writes: > >> I guess both you and Michael are in favor of just removing compaction >> variant without any renames, so let me prepare a reroll and queue >> that instead. We can flip t

Re: [PATCH] git-svn: escape backslashes in refnames

2016-12-22 Thread Michael Fladischer
On 2016-12-23 02:42, Eric Wong wrote: > Hi Michael, the patch below should fix things up. Thank you Eric, I was able to successfully fetch the SVN tag with your patch applied. Cheers, -- Michael Fladischer Fladi.at signature.asc Description: OpenPGP digital signature

Bug-Report: git-svn and backslash in SVN branch name

2016-12-22 Thread Michael Fladischer
.1@172 1fe0cc23e3cd56a1087562f8ca3d2e40cd2b30d4: command returned error: 128 The tag in case is "dicomBaseClass\v0.1@172". Is there a way to mangle those names on the fly to get rid of the backslashes or can they be handled in any other way to be compatible with git? Cheers, -- Michael Fla

Re: [PATCH 00/13] gitk: tweak rendering of remote-tracking references

2016-12-22 Thread Michael Haggerty
On 12/21/2016 08:07 PM, Marc Branchaud wrote: > On 2016-12-20 07:05 PM, Michael Haggerty wrote: >> On 12/20/2016 04:01 PM, Marc Branchaud wrote: >>> [...] >>> Please don't change the remotebgcolor default. >>> >>> Also, perhaps the default remoterefb

Re: [PATCH 00/13] gitk: tweak rendering of remote-tracking references

2016-12-20 Thread Michael Haggerty
On 12/20/2016 04:01 PM, Marc Branchaud wrote: > On 2016-12-19 11:44 AM, Michael Haggerty wrote: >> This patch series changes a bunch of details about how remote-tracking >> references are rendered in the commit list of gitk: > > Thanks for this! I like the new, c

Re: [PATCH 00/13] gitk: tweak rendering of remote-tracking references

2016-12-20 Thread Michael Haggerty
On 12/19/2016 11:53 PM, Philip Oakley wrote: > From: "Michael Haggerty" <mhag...@alum.mit.edu> >> This patch series changes a bunch of details about how remote-tracking >> references are rendered in the commit list of gitk: >> > [...] >> * Introduce

Re: [PATCH 0/5] git check-ref-format --stdin --report-errors

2016-12-19 Thread Michael Haggerty
On 12/19/2016 07:23 PM, Junio C Hamano wrote: > Michael Haggerty <mhag...@alum.mit.edu> writes: > >> Especially given that the output is not especially machine-readable, it >> might be more consistent with other commands to call the new feature >> `--verbose

Re: [PATCH 1/5] check-ref-format: Refactor out check_one_ref_format

2016-12-19 Thread Michael Haggerty
On 12/19/2016 02:19 PM, Ian Jackson wrote: > Michael Haggerty writes ("Re: [PATCH 1/5] check-ref-format: Refactor out > check_one_ref_format"): >> On 11/04/2016 08:13 PM, Ian Jackson wrote: >>> +static int check_one_ref_format(const char *refname) > ... &

[PATCH 03/13] gitk: use a type "tags" to indicate abbreviated tags

2016-12-19 Thread Michael Haggerty
This replaces the functionality of the old `singletag` variable. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gitk b/gitk index 7c830c3..502f0aa 100755 --- a/gitk +++ b/gitk @@ -6561,7 +

[PATCH 13/13] gitk: change the default colors for remote-tracking references

2016-12-19 Thread Michael Haggerty
local branches, so it is appropriate that their coloring be subtler. * Brown isn't used elsewhere. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitk b/gitk index cb5c715..be97640 100755 --- a/gitk

[PATCH 11/13] gitk: introduce a constant otherrefbgcolor

2016-12-19 Thread Michael Haggerty
This is the value used for references other than tags, heads, and remote-tracking references (e.g., `refs/stash`). Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index 44f4d70..0

[PATCH 10/13] gitk: use type "remote" for remote-tracking references

2016-12-19 Thread Michael Haggerty
This is clearer, and also lets us avoid calling `remotereftext` a second time for normal branches. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index d22ce5f..44f4d70 100755 ---

[PATCH 09/13] gitk: shorten labels displayed for modern remote-tracking refs

2016-12-19 Thread Michael Haggerty
space displaying `remote/` for every remote reference. However, if a remote-tracking reference has only two slashes, like refs/remotes/baz , render the label the same as before, namely remotes/baz Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- git

[PATCH 05/13] gitk: fill in `wvals` as the tags are first processed

2016-12-19 Thread Michael Haggerty
It's no longer, and a little bit more direct, to fill in `wvals` at the same time as we determine the tag's type. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gitk b/gitk index d

[PATCH 08/13] gitk: only change the color of the "remote" part of remote refs

2016-12-19 Thread Michael Haggerty
references with only two slashes (e.g., `refs/remotes/foo`). Such references were created by `git-svn` when using its old naming scheme. They are still rendered like remotes/foo Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 2 +- 1 file changed, 1 insertion

[PATCH 04/13] gitk: use a type "mainhead" to indicate the main HEAD branch

2016-12-19 Thread Michael Haggerty
Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gitk b/gitk index 502f0aa..d2e3803 100755 --- a/gitk +++ b/gitk @@ -6588,7 +6588,11 @@ proc drawtags {id x xt y1} { } if {[info

[PATCH 06/13] gitk: simplify regexp

2016-12-19 Thread Michael Haggerty
Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index fb2f653..84a5326 100755 --- a/gitk +++ b/gitk @@ -6654,7 +6654,7 @@ proc drawtags {id x xt y1} { set xl [expr {$xl - $d

[PATCH 07/13] gitk: extract a method `remotereftext`

2016-12-19 Thread Michael Haggerty
The text value that it also provides to its caller is not used yet, but it will be soon. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 84a5326..51ebaf5 100755 ---

[PATCH 12/13] gitk: add a configuration setting `remoterefbgcolor`

2016-12-19 Thread Michael Haggerty
, `remoterefbgcolor`. For the moment, leave it set to the old default `headbgcolor`. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index 0bd4aa5..cb5c715 100755 --- a/gitk +++ b/gitk @@ -6574,7 +

[PATCH 02/13] gitk: keep track of tag types in a separate `types` array

2016-12-19 Thread Michael Haggerty
The resulting code is easier to follow than the old counting-based code, plus in a moment we will add some more specific types. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 37 + 1 file changed, 21 insertions(+), 16 deletions(-)

[PATCH 00/13] gitk: tweak rendering of remote-tracking references

2016-12-19 Thread Michael Haggerty
adjusted by editing the configuration file. Someday it would be nice to allow them to be configured via the preferences dialog.) It's been a while since I've written any Tcl code, so I apologize in advance for any howlers :-) This branch applies against the `master` branch in git://ozlabs.org/~paulus/git

[PATCH 01/13] gitk: when processing tag labels, don't use `marks` as scratch space

2016-12-19 Thread Michael Haggerty
Instead, just append to it as necessary. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- gitk | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gitk b/gitk index a14d7a1..296efb3 100755 --- a/gitk +++ b/gitk @@ -6570,18 +6570,20 @@ proc drawtags

Re: [PATCH 5/5] check-ref-format: New --stdin option

2016-12-19 Thread Michael Haggerty
ns and code. Please declare `got` at the top of the block. > + if (got > worst) > + worst = got; > + } > + if (!feof(stdin)) { > + perror("reading from stdin"); > + exit(127); > + } > + return worst; > + } > } > Michael

Re: [PATCH 0/5] git check-ref-format --stdin --report-errors

2016-12-19 Thread Michael Haggerty
written. If the opposite use case is common (mass processing of refnames), we could always add a `--buffer` option like the one that `git cat-file --batch` has. Michael

Re: [PATCH 5/5] check-ref-format: New --stdin option

2016-12-19 Thread Michael Haggerty
int got = check_one_ref_format(buffer); > + if (got > worst) > + worst = got; > + } > + if (!feof(stdin)) { > + perror("reading from stdin"); > + exit(127); > + } > + return worst; > + } > } > Michael

Re: [PATCH 3/5] check-ref-format: Abolish leak of collapsed refname

2016-12-19 Thread Michael Haggerty
> + if (normalize) { > printf("%s\n", refname); > + free((void*)refname); > + } > } > > int cmd_check_ref_format(int argc, const char **argv, const char *prefix) > Michael

Re: [PATCH 2/5] check-ref-format: Refactor to make --branch code more common

2016-12-19 Thread Michael Haggerty
> } > + > + if (check_branch && (flags || normalize)) Is there a reason not to allow `--normalize` with `--branch`? (Currently, `git check-ref-format --branch` *does* allow input like `refs/heads/foo`.) But note that simply allowing `--branch --normalize` without changing `check_one_ref_format()` would mean generating *two* lines of output per reference, so something else would have to change, too. > + usage(builtin_check_ref_format_usage); > + > if (! (i == argc - 1)) > usage(builtin_check_ref_format_usage); > > Michael

<    4   5   6   7   8   9   10   11   12   13   >