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

2012-09-04 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu It doesn't, so mark the test as failing. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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 ---

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

2012-09-04 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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 +++

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

2012-09-04 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-09-04 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu These tests already pass, but make sure they don't break in the future. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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

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

2012-09-04 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Avoid confusion with the non-static function of the same name from fetch-pack.h. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- http-walker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-walker.c

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Use the names (nr_heads, heads) consistently across functions, instead of sometimes naming the same values (nr_match, match). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch-pack.c | 35 +-- 1

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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 mhag...@alum.mit.edu ---

[PATCH v2 10/17] Remove ineffective optimization

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu This fixes a test in t5500. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Set the final value at initialization rather than initializing it then sometimes changing it. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch-pack.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-)

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu * 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

[PATCH v2 03/17] Fix formatting.

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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 ---

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-25 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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.

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

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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Avoid confusion with the non-static function of the same name from fetch-pack.h. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- http-walker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-walker.c

[PATCH 03/17] Fix formatting.

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c

[PATCH 04/17] Name local variables more consistently

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Use the names (nr_heads, heads) consistently across functions, instead of sometimes naming the same values (nr_match, match). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/fetch-pack.c | 27 +-- 1 file

[PATCH 10/17] Remove ineffective optimization

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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 mhag...@alum.mit.edu ---

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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 ---

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu * 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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 ---

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

2012-08-23 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu This fixes a test in t5500. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- 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

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

2012-08-18 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu On 08/17/2012 01:29 AM, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com 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

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

2012-08-18 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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(-) --

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

2012-08-18 Thread mhagger
From: Michael Haggerty mhag...@alum.mit.edu 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

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

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