Re: [PATCH 04/17] Name local variables more consistently

2012-08-24 Thread Michael Haggerty
On 08/23/2012 10:39 AM, Jeff King wrote: > On Thu, Aug 23, 2012 at 10:10:29AM +0200, mhag...@alum.mit.edu wrote: > >> From: Michael Haggerty >> >> Use the names (nr_heads, heads) consistently across functions, instead >> of sometimes naming the same values (nr_match, match). > > I think this is

Re: Re*: mergetool: support --tool-help option like difftool does

2012-08-24 Thread David Aguilar
On Thu, Aug 23, 2012 at 10:39 AM, Junio C Hamano wrote: > David Aguilar writes: >> Would the ability to resolve the various merge situations using >> the command-line be a wanted addition? >> >> This would let a submodule or deleted/modified encountering >> user do something like: >> >> $ git mer

Re: [PATCH 0/6] Gettext poison rework

2012-08-24 Thread Ævar Arnfjörð Bjarmason
On Fri, Aug 24, 2012 at 7:43 AM, Nguyễn Thái Ngọc Duy wrote: > Still WIP but I'm getting closer. I dropped test-poisongen and started > to use podebug [2] instead. Less code in git. podebug does not preserve > shell variables yet. I'll follow that up at upstream [1]. > > With this series, if you h

Re: [Q] Comparing differences introduced by two commits?

2012-08-24 Thread Brian Foster
On Wednesday 22-August-2012 10:55:29 Jonathan del Strother wrote: > On 22 August 2012 17:58, Junio C Hamano wrote: > > Jonathan del Strother writes: > >> On 22 August 2012 13:10, Brian Foster wrote: > >> ... > >>> In the past I've done: > >>> > >>> diff <(git show A) <(git show B) > >>> > >

Re: Reg:Git-ssh bug

2012-08-24 Thread Jeff King
On Thu, Aug 23, 2012 at 06:22:01PM -0400, Gokulramkumar Subramaniam wrote: > I am new to Git and I am trying to add my machine with Git but it is failing > through ssh method. > > Error received: > > $ ssh-add -l > 2048 5f:6f:39:ed:b0:76:2e:d0:xx:xx:xx:xx:xx:xx:xx:xx id_rsa (RSA) > > Gokul$ ss

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Thomas Rast
Junio C Hamano writes: > As a corollary, the "is pu@{0} a fast-forward of pu@{1}?" check does > not need merge base computation at all. The only thing it needs to > do is to prove pu@{1} is reachable from pu@{0}, and that can be done > the same way in which '1' can be proved unreachable from '2'

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Thomas Rast
Junio C Hamano writes: > Junio C Hamano writes: > >> Thomas Rast writes: >> >>> At the very least it should be possible to change in_merge_bases() to >>> not do any of the post-filtering; perhaps like the patch below. >> >> I do not recall the details but the post-filtering was added after >> t

[PATCH v2] Support non-WIN32 system lacking poll() while keeping the WIN32 part intact

2012-08-24 Thread Joachim Schmitz
Signed-off-by: Joachim Schmitz --- This time I hopefully didn't screw up whitespace and line breaks. Makefile| 18 ++ compat/win32/poll.c | 8 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 66e8216..e150816 100644

[PATCH v2] Prefer sysconf(_SC_OPEN_MAX) over getrlimit(RLIMIT_NOFILE,...)

2012-08-24 Thread Joachim Schmitz
Signed-off-by: Joachim Schmitz --- As discussed now as a small helper function rather than #ifdef/#endif in the primary flow of the code. And hopefully without having screwed up whitespace and line breaks sha1_file.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-)

[PATCH v2] Don't use curl_easy_strerror prior to curl-7.12.0

2012-08-24 Thread Joachim Schmitz
This reverts be22d92 (http: avoid empty error messages for some curl errors, 2011-09-05) on platforms with older versions of libcURL. Signed-off-by: Joachim Schmitz --- Resend, regardless that Junio said this not to be needed, as I don't see it applied yet. Also tried to fix the formatting issue

[PATCH 1/2] Ignore trailing slash in mkdir() on platforms that can't deal with this

2012-08-24 Thread Joachim Schmitz
Signed-off-by: Joachim Schmitz --- compat/mkdir.c | 24 1 file changed, 24 insertions(+) create mode 100644 compat/mkdir.c diff --git a/compat/mkdir.c b/compat/mkdir.c new file mode 100644 index 000..9e253fb --- /dev/null +++ b/compat/mkdir.c @@ -0,0 +1,24 @@ +#inc

[PATCH 2/2] Ignore trailing slash in mkdir() on platforms that can't deal with this

2012-08-24 Thread Joachim Schmitz
Signed-off-by: Joachim Schmitz --- git-compat-util.h | 5 + 1 file changed, 5 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index 35b095e..34f040f 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -162,6 +162,11 @@ #define probe_utf8_pathname_composition(a,b) #e

[PATCH 1/2] Support for setitimer() on platforms lacking it

2012-08-24 Thread Joachim Schmitz
Implementation includes getitimer(), but for now it is static. Supports ITIMER_REAL only. Signed-off-by: Joachim Schmitz --- May need a header file for ITIMER_*, struct itimerval and the prototypes, But for now, and the HP NonStop platform this isn't needed, here has ITIMER_* and struct timeval

RE: [PATCH 2/2] Support for setitimer() on platforms lacking it

2012-08-24 Thread Joachim Schmitz
Signed-off-by: Joachim Schmitz --- Seems it needs my mkdir() "ignoretraile slash" patch first to be applied cleanly... It is independent of it otherwise. git-compat-util.h | 5 + 1 file changed, 5 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index 34f040f..a047221 1006

Re: [PATCH 0/6] Gettext poison rework

2012-08-24 Thread Nguyen Thai Ngoc Duy
On Fri, Aug 24, 2012 at 3:51 PM, Ævar Arnfjörð Bjarmason wrote: >> [1] http://bugs.locamotion.org/show_bug.cgi?id=2450 >> [2] http://translate.sourceforge.net/wiki/toolkit/podebug > > The reason I didn't do something like this to begin with is that > gettext/glibc doesn't have support for fake loc

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Nguyen Thai Ngoc Duy
On Thu, Aug 23, 2012 at 9:20 PM, Thomas Rast wrote: > At the very least it should be possible to change in_merge_bases() to > not do any of the post-filtering; perhaps like the patch below. It > passes the test suite. The whole "merge bases of A and a list of Bs" > thing is blowing my overheated

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

2012-08-24 Thread Philip Oakley
From: "Junio C Hamano" Sent: Friday, August 24, 2012 5:23 AM Jeff King writes: It may be (?) that it is a good time to think about a 'datedepth' capability to bypass the current counted-depth shallow fetch that can cause so much trouble. With a date limited depth the relevant tags could als

Re: a small git proposal

2012-08-24 Thread Catalin Pol
Thanks for the tip. It should give me a good starting point for what I'm about to do, since notes seem to be able to add comments for objects without changing the commit tree (which was one of the things I was aiming for and quite frankly, one of the parts that worried me on the implementation side

RE: [PATCH v2] Support non-WIN32 system lacking poll() while keeping the WIN32 part intact

2012-08-24 Thread Joachim Schmitz
> From: Joachim Schmitz [mailto:j...@schmitz-digital.de] > Sent: Friday, August 24, 2012 11:45 AM > To: Junio C Hamano (gits...@pobox.com) > Cc: git@vger.kernel.org; Erik Faye-Lund (kusmab...@gmail.com) > Subject: [PATCH v2] Support non-WIN32 system lacking poll() while keeping the > WIN32 part in

libgit2 status

2012-08-24 Thread greened
What is the status of libgit2 WRT the overall git project? I recall that there was some discussion of basing bits of git on libgit2 once it matures. I ask because I'm starting a project to improve the abysmal speed of git-subtree split. It's unbearably slow at the moment and as far as I can puzz

[PATCH] branch -v: align even when the first column is in UTF-8

2012-08-24 Thread Nguyễn Thái Ngọc Duy
Branch names are usually in ASCII so they are not the problem. The problem most likely comes from "(no branch)" translation, which is in UTF-8 and makes length calculation just wrong. Signed-off-by: Nguyễn Thái Ngọc Duy --- So far all git translations are utf-8 compatible. Branch names may use

Re: misleading diff-hunk header

2012-08-24 Thread Jeff King
On Tue, Aug 21, 2012 at 10:52:03AM -0700, Junio C Hamano wrote: > >>> diff.{type}.xfuncname seems to start searching backwards in > >>> from the beginning of the hunk, not the first differing line. > >> [...] > >>> @@ -4,4 +4,5 @@ int call_me(int maybe) > >>> > >>>int main() > >>>{ > >>>

Re: misleading diff-hunk header

2012-08-24 Thread Tim Chase
On 08/24/12 09:29, Jeff King wrote: > On Tue, Aug 21, 2012 at 10:52:03AM -0700, Junio C Hamano wrote: > > diff.{type}.xfuncname seems to start searching backwards in > from the beginning of the hunk, not the first differing line. [...] > @@ -4,4 +4,5 @@ int call_me(int maybe) >>

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Jeff King
On Fri, Aug 24, 2012 at 11:43:40AM +0200, Thomas Rast wrote: > > Start from A and B. Follow from B to find 'x' and paint it in blue, > > follow from A to find 'y' and paint it in amber. Follow from 'x' to > > '1', paint it in blue. Follow from 'y' to '1', paint it in amber > > but notice that i

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Junio C Hamano
Thomas Rast writes: > Well, yeah, you snipped this part from my original post :-) > > } Even if this turns out to be flawed, we should also identify uses of > } in_merge_bases() where the real question was is_descendant_of() [I > } somewhat suspect that's all of them], and then replace is_descend

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Junio C Hamano
Thomas Rast writes: > Junio C Hamano writes: > ... >> Start from A and B. Follow from B to find 'x' and paint it in blue, >> follow from A to find 'y' and paint it in amber. Follow from 'x' to >> '1', paint it in blue. Follow from 'y' to '1', paint it in amber >> but notice that it already is

Re: [PATCH 0/6] Gettext poison rework

2012-08-24 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Still WIP but I'm getting closer. I dropped test-poisongen and started > to use podebug [2] instead. Less code in git. podebug does not preserve > shell variables yet. I'll follow that up at upstream [1]. Thanks; this looks promising. -- To unsubscribe from this l

Re: [PATCH v2] Support non-WIN32 system lacking poll() while keeping the WIN32 part intact

2012-08-24 Thread Junio C Hamano
"Joachim Schmitz" writes: > There is a downside with this: In order to make use of it, in Makefile it > adds "-Icompat/win32" to COMPAR_CFLAGS. This results in > compat/win32/dirent.h to be found, rather than /usr/include/dirent.h. > This should be fine for WIN32, but for everybody else may no

Re: in_merge_bases() is too expensive for recent "pu" update

2012-08-24 Thread Junio C Hamano
Jeff King writes: > I thought you were just interested in speeding up is_descendent_of. You > should be able to do that without a generation number. Just start from A > and B as above, do the two-color painting, and do not add the parents of > any two-color commits (because you know they are ance

Re: [PATCH v2] Prefer sysconf(_SC_OPEN_MAX) over getrlimit(RLIMIT_NOFILE,...)

2012-08-24 Thread Junio C Hamano
"Joachim Schmitz" writes: > Signed-off-by: Joachim Schmitz > --- > As discussed now as a small helper function rather than #ifdef/#endif in the > primary flow of the code. > And hopefully without having screwed up whitespace and line breaks The formatting looks fine. Perhaps I am being overly

Re: misleading diff-hunk header

2012-08-24 Thread Jeff King
On Fri, Aug 24, 2012 at 10:29:09AM -0400, Jeff King wrote: > > Would this be sufficient? Instead of looking for the first line that > > matches the "beginning" pattern going backwards starting from one line > > before the displayed context, we start our examination at the first line > > shown in

Re: [PATCH] branch -v: align even when the first column is in UTF-8

2012-08-24 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Branch names are usually in ASCII so they are not the problem. The > problem most likely comes from "(no branch)" translation, which is in > UTF-8 and makes length calculation just wrong. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > So far all git translations

Re: [PATCH 1/2] Ignore trailing slash in mkdir() on platforms that can't deal with this

2012-08-24 Thread Junio C Hamano
As the compat/mkdir.c file includes git-compat-util.h and expects the declaration of the new function to be found in it, it does not make any sense to have this as two patches. I'll squash them into one for now, but it would have been even more complete to have an update to the Makefile to actuall

Re: [PATCH] contrib: GnomeKeyring support + generic helper implementation

2012-08-24 Thread Junio C Hamano
"Philipp A. Hartmann" writes: > All, > > the following patch series proposes enhancements to the credential helper > implementations in the contrib section. The detailed development history > can be found at GitHub [1]. > > The first patch adds a GnomeKeyring credential backend. The GnomeKeyr

RE: [PATCH 1/2] Ignore trailing slash in mkdir() on platforms that can't deal with this

2012-08-24 Thread Joachim Schmitz
> From: Junio C Hamano [mailto:gits...@pobox.com] > Sent: Friday, August 24, 2012 7:44 PM > To: Joachim Schmitz > Cc: git@vger.kernel.org > Subject: Re: [PATCH 1/2] Ignore trailing slash in mkdir() on platforms that > can't deal with this > > As the compat/mkdir.c file includes git-compat-util.h

RE: [PATCH v2] Prefer sysconf(_SC_OPEN_MAX) over getrlimit(RLIMIT_NOFILE,...)

2012-08-24 Thread Joachim Schmitz
> From: Junio C Hamano [mailto:gits...@pobox.com] > Sent: Friday, August 24, 2012 6:44 PM > To: Joachim Schmitz > Cc: git@vger.kernel.org > Subject: Re: [PATCH v2] Prefer sysconf(_SC_OPEN_MAX) over > getrlimit(RLIMIT_NOFILE,...) > > "Joachim Schmitz" writes: > > > Signed-off-by: Joachim Schmitz

RE: [PATCH v2] Support non-WIN32 system lacking poll() while keeping the WIN32 part intact

2012-08-24 Thread Joachim Schmitz
> From: Junio C Hamano [mailto:gits...@pobox.com] > Sent: Friday, August 24, 2012 6:07 PM > To: Joachim Schmitz > Cc: git@vger.kernel.org; Erik Faye-Lund > Subject: Re: [PATCH v2] Support non-WIN32 system lacking poll() while keeping > the WIN32 part intact > > "Joachim Schmitz" writes: > > > T

[RFC] Support for HP NonStop

2012-08-24 Thread Joachim Schmitz
Hi folks On top of the patches I’ve submitted so far, which were needed for HP NonStop, but possibly useful for other platforms too, here is one that is at least in parts NonStop specific diff --git a/git-compat-util.h b/git-compat-util.h index a047221..d6a142a 100644 --- a/git-compat-util.h ++

Re: [PATCH v2] Support non-WIN32 system lacking poll() while keeping the WIN32 part intact

2012-08-24 Thread Junio C Hamano
"Joachim Schmitz" writes: > Different, but related question: would poll.[ch] be allowed to #include > "git-compat-util.h"? Seeing other existing generic wrappers directly under compat/, e.g. fopen.c, mkdtemp.c, doing so, I would say why not. Windows folks (I see Erik is already CC'ed, which is

Re: [RFC] Support for HP NonStop

2012-08-24 Thread Junio C Hamano
"Joachim Schmitz" writes: > Hi folks > > On top of the patches I’ve submitted so far, which were needed for HP > NonStop, > but possibly useful for other platforms too, here is one that is at least in > parts NonStop specific > > diff --git a/git-compat-util.h b/git-compat-util.h > index a0472

git no longer prompting for password

2012-08-24 Thread Iain Paton
Hi List, A recent update to git 1.7.12 from 1.7.3.5 seems to have changed something - trying to push to a smart http backend no longer prompts for a password and hence fails the server auth. The server is currently running git 1.7.9 behind apache 2.4.3 with an almost verbatim copy of the apach

RE: [RFC] Support for HP NonStop

2012-08-24 Thread Joachim Schmitz
> From: Junio C Hamano [mailto:gits...@pobox.com] > Sent: Friday, August 24, 2012 10:13 PM > To: Joachim Schmitz > Cc: git@vger.kernel.org > Subject: Re: [RFC] Support for HP NonStop > > "Joachim Schmitz" writes: > > > Hi folks > > > > On top of the patches I’ve submitted so far, which were need

Re: git no longer prompting for password

2012-08-24 Thread Jeff King
On Fri, Aug 24, 2012 at 09:19:28PM +0100, Iain Paton wrote: > A recent update to git 1.7.12 from 1.7.3.5 seems to have changed > something - trying to push to a smart http backend no longer prompts > for a password and hence fails the server auth. > [...] > Backtracking through the versions I've s

Re: [PATCH] contrib: GnomeKeyring support + generic helper implementation

2012-08-24 Thread Jeff King
On Fri, Aug 24, 2012 at 11:15:36AM -0700, Junio C Hamano wrote: > > The third and fourth patches port the existing helpers to this generic > > implementation. > > > It struck me somewhat odd to see a new one added as the first step > in the series, and then "the generic", the third patch only to

Re: [PATCH] contrib: GnomeKeyring support + generic helper implementation

2012-08-24 Thread Junio C Hamano
Jeff King writes: > However, the shared bits are simple enough that maybe that is not a > concern. An interesting test would be to add a 5/4 porting Erik's win32 > credential helper, since that is the platform least like our other ones. Very true. > So I am OK with this series, but I am also OK

Re: [RFC] Support for HP NonStop

2012-08-24 Thread Junio C Hamano
"Joachim Schmitz" writes: > Reminds me of a related issue: in compat/fnmatch/fnmatch.c there is this: > #if HAVE_STRING_H || defined _LIBC > # include > #else > # include > #endif > > There's no place where HAVE_STRING_H get set > This looks wrong to me,... This is because it is a borrowed fil

bug: when applying binary diffs, -p0 is ignored

2012-08-24 Thread Colin McCabe
I found a bug in git's handling of binary diff segments. When applying binary diffs using -p0, the prefix (or --strip) argument is ignored. For example, try this: git apply -p0 --binary <<'EOF' diff --git a/init.tar.gz a/init.tar.gz new file mode 100644 index 0

Re: [PATCH] Document the --done option.

2012-08-24 Thread Junio C Hamano
Junio C Hamano writes: > "Eric S. Raymond" writes: > >> --- > > A forgotten Sign-off? Ping? Just telling us that this is Signed-off is fine. Thanks. > > Sverre, the text matches my understanding as well as what be56862 > (fast-import: introduce 'done' command, 2011-07-16) says it did. > Ack?

Re: [PATCH/RFC] git svn: don't introduce new paragraph for git-svn-id

2012-08-24 Thread Robert Luberda
Junio C Hamano wrote: > Eric Wong writes: >> >> I think having "svn" in "svn.trimsvnlog" twice is redundant and not ideal. >> Perhaps just --trim-log and svn.trimlog? > > Do we ever want to trim "our" log when relaying the Git commits back > to subversion? Having "svn" in "trimsvnlog" makes it c

Re: [PATCH/RFC] git svn: optionally trim imported log messages

2012-08-24 Thread Robert Luberda
Junio C Hamano writes: Hi, Junio, for some reason I don't get mails from you, I've just discovered your e-mails on gmane news list. Anyway many thanks for your comments, I'll fix them and send updated patch next week. >> +When committing to svn from git (as part of 'commit-diff', 'set-tree' >>

Re: [PATCH/RFC] git svn: optionally trim imported log messages

2012-08-24 Thread Junio C Hamano
Robert Luberda writes: >> I think it would be saner to call them "trailers" to avoid >> confusion. > > Thanks, I haven't got any idea how to call them, especially because > existing git documentation refers to them just by using the word `line', > e.g.: > > git-am.txt: Add a `Signed-off-by:`

Re: [PATCH/RFC] git svn: handle errors and concurrent commits in dcommit

2012-08-24 Thread Robert Luberda
Eric Wong wrote: Hi, > > Oops, I'll push the following out since Junio already merged your > original: I can see that you haven't pushed the change yet. Maybe it would be a good idea to fix other style mistakes (extra spaces after redirections, lack of spaces after function names, `[' used ins

Re: misleading diff-hunk header

2012-08-24 Thread Tim Chase
On 08/24/12 11:44, Jeff King wrote: > With the old code, you'd get: > > diff --git a/old b/new > index f384549..1066a25 100644 > --- a/old > +++ b/new > @@ -2,3 +2,3 @@ one >two > -three > +three -- modified >four > > So the hunk header is

[PATCH] Improve "Not a git repository" error messages

2012-08-24 Thread travis . carden
From: Travis Carden The former messages changed grammatical subject in the middle. Signed-off-by: Travis Carden --- This is my first attempt at contributing to the Git project. I'm kind of testing the water with a simple patch to see how friendly the community is. Thanks! setup.c |4 ++--

Re: misleading diff-hunk header

2012-08-24 Thread Junio C Hamano
Tim Chase writes: > If the documented purpose of "diff -p" (and by proxy > diff.{type}.xfuncname) is to show the name of the *function* > containing the changed lines, Yeah, the documentation is misleading, but I do not offhand think of a better phrasing. Perhaps you could send in a patch to

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

2012-08-24 Thread Michael Haggerty
On 08/23/2012 10:54 AM, Jeff King wrote: > On Thu, Aug 23, 2012 at 10:10:31AM +0200, mhag...@alum.mit.edu wrote: > >> 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

Re: bug: when applying binary diffs, -p0 is ignored

2012-08-24 Thread Junio C Hamano
Colin McCabe writes: > I found a bug in git's handling of binary diff segments. > > When applying binary diffs using -p0, the prefix (or --strip) argument > is ignored. Thanks for a report. An ancient bug well spotted. Perhaps this will help. -- >8 -- Subject: apply: compute patch->def_name c

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

2012-08-24 Thread Michael Haggerty
On 08/23/2012 11:07 AM, Jeff King wrote: > On Thu, Aug 23, 2012 at 10:10:42AM +0200, mhag...@alum.mit.edu wrote: > >> Subject: Re: [PATCH 17/17] fetch_refs(): simplify logic >> [...] >> static void filter_refs(struct ref **refs, int *nr_heads, char **heads) > > The subject should be "filter_refs

[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