[PATCH 01/17] t5500: add tests of error output for missing refs

2012-08-23 Thread mhagger
From: Michael Haggerty If "git fetch-pack" is called with reference names that do not exist on the remote, then it should emit an error message error: no such remote ref refs/heads/xyzzy This is currently broken if *only* missing references are passed to "git fetch-pack". Signed-off-by: Mi

[PATCH 15/17] cmd_fetch_pack(): simplify computation of return value

2012-08-23 Thread mhagger
From: Michael Haggerty Set the final value at initialization rather than initializing it then sometimes changing it. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/builtin/fetch-pack.c b/built

[PATCH 00/17] Clean up how fetch_pack() handles the heads list

2012-08-23 Thread mhagger
From: Michael Haggerty There were various confusing things (and a couple of bugs) in the way that fetch_pack() handled the list (nr_heads, heads) of references to be sought from the remote: * Different names were used for the list in different functions for no special reason. * fetch_pack() m

[PATCH 02/17] Rename static function fetch_pack() to http_fetch_pack()

2012-08-23 Thread mhagger
From: Michael Haggerty Avoid confusion with the non-static function of the same name from fetch-pack.h. Signed-off-by: Michael Haggerty --- http-walker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-walker.c b/http-walker.c index 51a906e..1516c5e 100644 --- a/ht

[PATCH 03/17] Fix formatting.

2012-08-23 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 8 fetch-pack.h | 12 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 7912d2b..cc21047 100644 --- a/builtin/fetch-

[PATCH 05/17] Do not check the same match_pos twice

2012-08-23 Thread mhagger
From: Michael Haggerty Once a match has been found at match_pos, the entry is zeroed and no future attempts will match that entry. So increment match_pos to avoid checking against the zeroed-out entry during the next iteration. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 2 +-

[PATCH 06/17] Let fetch_pack() inform caller about number of unique heads

2012-08-23 Thread mhagger
From: Michael Haggerty fetch_pack() remotes duplicates from the list (nr_heads, heads), thereby shrinking the list. But previously, the caller was not informed about the shrinkage. This would cause a spurious error message to be emitted by cmd_fetch_pack() if "git fetch-pack" is called with dup

[PATCH 13/17] cmd_fetch_pack: return early if finish_connect() returns an error

2012-08-23 Thread mhagger
From: Michael Haggerty This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index cc9af80..4794839 100644 --- a/bui

[PATCH 04/17] Name local variables more consistently

2012-08-23 Thread mhagger
From: Michael Haggerty Use the names (nr_heads, heads) consistently across functions, instead of sometimes naming the same values (nr_match, match). Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) dif

[PATCH 10/17] Remove ineffective optimization

2012-08-23 Thread mhagger
From: Michael Haggerty I cannot find a scenario in which this function is called any significant number of times, so simplify the code by always allocating an array for return_refs rather than trying to use a stack-allocated array for small lists. Signed-off-by: Michael Haggerty --- builtin/fe

[PATCH 11/17] filter_refs(): do not leave gaps in return_refs

2012-08-23 Thread mhagger
From: Michael Haggerty It used to be that this function processed refnames in some arbitrary order but wanted to return them in the order that they were requested, not the order that they were processed. Now, the refnames are processed in sorted order, so there is no reason to go to the extra ef

[PATCH 07/17] Pass nr_heads to do_pack_ref() by reference

2012-08-23 Thread mhagger
From: Michael Haggerty This is the first of a few baby steps towards changing filter_refs() to compress matched refs out of the list rather than overwriting the first character of such references with '\0'. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3

[PATCH 09/17] Pass nr_heads to filter_refs() by reference

2012-08-23 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 5905dae..0426cf4 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @

[PATCH 17/17] fetch_refs(): simplify logic

2012-08-23 Thread mhagger
From: Michael Haggerty * Build linked list of return values as we go rather than recording them in a temporary array and linking them up later. * Handle ref in a single if...else statement in the main loop, to make it clear that each ref has exactly two possible destinies. Signed-off-by: Mi

[PATCH 08/17] Pass nr_heads to everything_local() by reference

2012-08-23 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index d3ff166..5905dae 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -595,7 +5

[PATCH 16/17] fetch_pack(): free matching heads

2012-08-23 Thread mhagger
From: Michael Haggerty fetch_pack() used to delete entries from the input list (*nr_heads, heads) and drop them on the floor. (Even earlier versions dropped some names on the floor and modified others.) This forced fetch_refs_via_pack() to create a separate copy of the original list so that it

[PATCH 12/17] filter_refs(): compress unmatched refs in heads array

2012-08-23 Thread mhagger
From: Michael Haggerty Remove any references that were received from the remote from the list (*nr_heads, heads) of requested references by squeezing them out of the list (rather than overwriting their names with NUL characters, as before). On exit, *nr_heads is the number of requested reference

[PATCH 14/17] Report missing refs even if no existing refs were received

2012-08-23 Thread mhagger
From: Michael Haggerty This fixes a test in t5500. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 2 +- t/t5500-fetch-pack.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 4794839..5b1e603 100644 --- a/buil

[PATCH v2 01/17] t5500: add tests of error output for missing refs

2012-08-24 Thread mhagger
From: Michael Haggerty If "git fetch-pack" is called with reference names that do not exist on the remote, then it should emit an error message error: no such remote ref refs/heads/xyzzy This is currently broken if *only* missing references are passed to "git fetch-pack". Signed-off-by: Mi

[PATCH v2 02/17] Rename static function fetch_pack() to http_fetch_pack()

2012-08-24 Thread mhagger
From: Michael Haggerty Avoid confusion with the non-static function of the same name from fetch-pack.h. Signed-off-by: Michael Haggerty --- http-walker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-walker.c b/http-walker.c index 51a906e..1516c5e 100644 --- a/ht

[PATCH v2 04/17] Name local variables more consistently

2012-08-24 Thread mhagger
From: Michael Haggerty Use the names (nr_heads, heads) consistently across functions, instead of sometimes naming the same values (nr_match, match). Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions

[PATCH v2 07/17] Pass nr_heads to do_pack_ref() by reference

2012-08-24 Thread mhagger
From: Michael Haggerty This is the first of a few baby steps towards changing filter_refs() to compress matched refs out of the list rather than overwriting the first character of such references with '\0'. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3

[PATCH v2 08/17] Pass nr_heads to everything_local() by reference

2012-08-24 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index fae4f7c..a4bb0ff 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -595,7 +5

[PATCH v2 10/17] Remove ineffective optimization

2012-08-24 Thread mhagger
From: Michael Haggerty I cannot find a scenario in which this function is called any significant number of times, so simplify the code by always allocating an array for return_refs rather than trying to use a stack-allocated array for small lists. Signed-off-by: Michael Haggerty --- builtin/fe

[PATCH v2 12/17] filter_refs(): compress unmatched refs in heads array

2012-08-24 Thread mhagger
From: Michael Haggerty Remove any references that were received from the remote from the list (*nr_heads, heads) of requested references by squeezing them out of the list (rather than overwriting their names with NUL characters, as before). On exit, *nr_heads is the number of requested reference

[PATCH v2 13/17] cmd_fetch_pack: return early if finish_connect() returns an error

2012-08-24 Thread mhagger
From: Michael Haggerty This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 5ba1cef..f04fd59 100644 --- a/bui

[PATCH v2 14/17] Report missing refs even if no existing refs were received

2012-08-24 Thread mhagger
From: Michael Haggerty This fixes a test in t5500. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 2 +- t/t5500-fetch-pack.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index f04fd59..00ac3b1 100644 --- a/buil

[PATCH v2 15/17] cmd_fetch_pack(): simplify computation of return value

2012-08-24 Thread mhagger
From: Michael Haggerty Set the final value at initialization rather than initializing it then sometimes changing it. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/builtin/fetch-pack.c b/built

[PATCH v2 16/17] fetch_pack(): free matching heads

2012-08-24 Thread mhagger
From: Michael Haggerty fetch_pack() used to delete entries from the input list (*nr_heads, heads) and drop them on the floor. (Even earlier versions dropped some names on the floor and modified others.) This forced fetch_refs_via_pack() to create a separate copy of the original list so that it

[PATCH v2 17/17] filter_refs(): simplify logic

2012-08-24 Thread mhagger
From: Michael Haggerty * Build linked list of return values as we go rather than recording them in a temporary array and linking them up later. * Handle ref in a single if...else statement in the main loop, to make it clear that each ref has exactly two possible destinies. Signed-off-by: Mi

[PATCH v2 00/17] Clean up how fetch_pack() handles the heads list

2012-08-24 Thread mhagger
From: Michael Haggerty Re-roll, incorporating Jeff's suggestions. Some commit messages have also been improved, but the only interdiff is that match_pos is renamed to head_pos in filter_refs(). This patch series applies to the merge between master and jc/maint-push-refs-all, though the dependen

[PATCH v2 03/17] Fix formatting.

2012-08-24 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 8 fetch-pack.h | 12 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 7912d2b..cc21047 100644 --- a/builtin/fetch-

[PATCH v2 05/17] Do not check the same head_pos twice

2012-08-24 Thread mhagger
From: Michael Haggerty Once a match has been found at head_pos, the entry is zeroed and no future attempts will match that entry. So increment head_pos to avoid checking against the zeroed-out entry during the next iteration. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 2 +- 1

[PATCH v2 09/17] Pass nr_heads to filter_refs() by reference

2012-08-24 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index a4bb0ff..c47090d 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @

[PATCH v2 06/17] Let fetch_pack() inform caller about number of unique heads

2012-08-24 Thread mhagger
From: Michael Haggerty fetch_pack() removes duplicates from the list (nr_heads, heads), thereby shrinking the list. But previously, the caller was not informed about the shrinkage. This would cause a spurious error message to be emitted by cmd_fetch_pack() if "git fetch-pack" is called with dup

[PATCH v2 11/17] filter_refs(): do not leave gaps in return_refs

2012-08-24 Thread mhagger
From: Michael Haggerty It used to be that this function processed refnames in some arbitrary order but wanted to return them in the order that they were requested, not the order that they were processed. Now, the refnames are processed in sorted order, so there is no reason to go to the extra ef

[PATCH 1/7] t0000: verify that absolute_path() fails if passed the empty string

2012-09-04 Thread mhagger
From: Michael Haggerty It doesn't, so mark the test as failing. Signed-off-by: Michael Haggerty --- t/t-basic.sh | 4 1 file changed, 4 insertions(+) diff --git a/t/t-basic.sh b/t/t-basic.sh index ccb5435..7347fb8 100755 --- a/t/t-basic.sh +++ b/t/t-basic.sh @@ -450,6

[PATCH 2/7] absolute_path(): reject the empty string

2012-09-04 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- abspath.c| 4 +++- t/t-basic.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/abspath.c b/abspath.c index f04ac18..5d62430 100644 --- a/abspath.c +++ b/abspath.c @@ -123,7 +123,9 @@ const char *abso

[PATCH 3/7] t0000: verify that real_path() fails if passed the empty string

2012-09-04 Thread mhagger
From: Michael Haggerty It doesn't, so mark the test as failing. Signed-off-by: Michael Haggerty --- t/t-basic.sh | 4 1 file changed, 4 insertions(+) diff --git a/t/t-basic.sh b/t/t-basic.sh index 5963a6c..363e190 100755 --- a/t/t-basic.sh +++ b/t/t-basic.sh @@ -454,6

[PATCH 0/7] Fix some bugs in abspath.c

2012-09-04 Thread mhagger
From: Michael Haggerty I really just wanted to tidy up filter_refs(), but I've been sucked into a cascade of recursive yak shaving. This is my first attempt to pop the yak stack. I want to use real_path() for making the handling of GIT_CEILING_DIRECTORIES more robust, but I noticed that it is b

[PATCH 4/7] real_path(): reject the empty string

2012-09-04 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- abspath.c| 3 +++ t/t-basic.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/abspath.c b/abspath.c index 5d62430..3e8325c 100644 --- a/abspath.c +++ b/abspath.c @@ -35,6 +35,9 @@ const char *real_pat

[PATCH 7/7] t0000: verify that real_path() removes extra slashes

2012-09-04 Thread mhagger
From: Michael Haggerty These tests already pass, but make sure they don't break in the future. Signed-off-by: Michael Haggerty --- It would be great if somebody would check whether these tests pass on Windows, and if not, give me a tip about how to fix them. t/t-basic.sh | 11 +++

[PATCH 5/7] t0000: verify that real_path() works correctly with absolute paths

2012-09-04 Thread mhagger
From: Michael Haggerty There is currently a bug: if passed an absolute top-level path that doesn't exist (e.g., "/foo") it incorrectly interprets the path as a relative path (e.g., returns "$(pwd)/foo"). So mark the test as failing. Signed-off-by: Michael Haggerty --- t/t-basic.sh | 12 ++

[PATCH 6/7] real_path(): properly handle nonexistent top-level paths

2012-09-04 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- abspath.c| 5 - t/t-basic.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/abspath.c b/abspath.c index 3e8325c..0e1cd7f 100644 --- a/abspath.c +++ b/abspath.c @@ -45,8 +45,11 @@ const char *real

[RFC 0/3] Reflogs for deleted refs: fix breakage and suggest namespace change

2012-08-18 Thread mhagger
From: Michael Haggerty On 08/17/2012 01:29 AM, Junio C Hamano wrote:> Junio C Hamano writes: >> I like the general direction. Perhaps a long distant future >> direction could be to also use the same trick in the ref namespace >> so that we can have 'next' branch itself, and 'next/foo', 'next/b

[RFC 1/3] t9300: format test in modern style prior to modifying it

2012-08-18 Thread mhagger
From: Michael Haggerty Signed-off-by: Michael Haggerty --- t/t9300-fast-import.sh | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 2fcf269..266ae30 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-impor

[RFC 3/3] Change naming convention for the reflog graveyard

2012-08-18 Thread mhagger
From: Michael Haggerty Store reflogs for dead references among those for live references, in a scheme that could in the future be extended to prevent file/directory conflicts for live reference names, as well. Store the reflog for a dead reference "refs/foo/bar/baz" in file "$GIT_DIR/logs/refs~d

[RFC 2/3] Delete reflogs for dead references to allow pruning

2012-08-18 Thread mhagger
From: Michael Haggerty This test is broken by "retain reflogs for deleted refs". Explicitly delete the reflogs in the graveyard to allow the corresponding commits to be pruned. Signed-off-by: Michael Haggerty --- Probably there should be a "git reflog" subcommand to do this. t/t9300-fast-im

[PATCH 0/2] Fix two minor problems in the docs for git-config

2012-08-18 Thread mhagger
From: Michael Haggerty This is just something I stumbled across. Michael Haggerty (2): git-config.txt: properly escape quotation marks in example git-config.txt: fix example Documentation/git-config.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.7.11.3 -- To unsubscr

[PATCH 1/2] git-config.txt: properly escape quotation marks in example

2012-08-18 Thread mhagger
From: Michael Haggerty In the example line as written, gitproxy="proxy-command" for kernel.org the quotation marks are eaten by the config-file parser. From the history, it looks like this example wanted to have quotation marks in the actual configured value. So quote them as required

[PATCH 2/2] git-config.txt: fix example

2012-08-18 Thread mhagger
From: Michael Haggerty The "--add" option is required to add a new value to a multivalued configuration entry. Signed-off-by: Michael Haggerty --- Documentation/git-config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-config.txt b/Documentation/git-c