Re: [PATCH] Merge non-first refs that match first refspec
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Sep 28, 2007, 21:38 UTC
- Message-ID
- <Pine.LNX.4.64.0709281728310.5926@iabervon.org>
- In-Reply-To
- <7vps02o55q.fsf@gitster.siamese.dyndns.org>
On Fri, 28 Sep 2007, Junio C Hamano wrote:
Show 35 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > > > Daniel Barkalow <barkalow@iabervon.org> writes: > > > >> Beats me; Junio, what's your test case? > > > > I can paste tomorrow (it is a clone of git.git at work). I do > > not use .git/config but .git/remotes/origin and explicit four > > separate Pull: lines and going over http. > > Here are the files. Note that I use traditional layout and > always have 'master' checked out when I initiate 'git pull'. > > : xyzzy git.git/master; cat .git/config > [core] > logallrefupdates = true > > [diff] > color = auto > > [showbranch] > default = --topo-order > default = master > default = next > default = pu > > [alias] > co = checkout > : xyzzy git.git/master; cat .git/remotes origin > URL: http://repo.or.cz/r/alt-git.git/ > Pull: master:origin > Pull: next:next > Pull: +pu:pu > Pull: maint:maint > Pull: todo:todo
The strcmp fails because the config uses an abbreviation and the server doesn't. Forget my first attempt, and try replacing the strcmp on line 105 with "!remote->fetch[0].pattern", which is what we're really checking, anyway.
(If this is the first refspec we're on, and we don't have a per-branch config, and we got a match, and the refspec isn't a pattern, merge it; anything that matches according to get_fetch_map is a satisfactory match, even if it doesn't look quite the same.)
I'll do up an actual patch after dinner if nobody beats me to it.
-Daniel *This .sig left intentionally blank*