git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix branches file configuration

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 26, 2008, 07:29 UTC
Message-ID
<7v4paugcyn.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0803260240570.19665@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 16 quoted lines
> On Tue, 25 Mar 2008, Junio C Hamano wrote:
>
>> ...  I am reasonably sure about "fetching from $URL/bar"
>> part, but I am unsure about "store in foo/bar" part.
>> 
>> Any Cogito survivers out there who knows how this was supposed to have
>> worked?  We can go back and look at git-fetch.sh (in contrib/examples),
>> but I'd rather be lazy ;-)
>
> This code actually is from Linus, nearly 2 years ago, converting 
> git-push.sh; I then moved it from builtin-push.c to remote.c and later 
> added support to remote.c for the fetch side aspects while leaving that 
> part of the code alone. Of course, I didn't realize at any point that, as 
> a fetch configuration, a branches configuration ever stored things 
> anywhere, and it looks like it didn't with a slash. (See line 115 of 
> 755225de:git-parse-remote.sh)
Yeah, it slowly comes back to me.

I think the Penguin desire that triggered this mysterious syntax was something like defining:

 $ echo >.git/branches/garzik git://git.kernel.org/pub/scm/linux/kernel/jgarzik
and being able to say:
 $ git fetch garzik/netdev-2.6 for-linus
 $ git fetch garzik/libata-dev master
Show 9 quoted lines
> So I guess there should be:
>
>> >  	add_url_alias(remote, p);
>> > -	add_fetch_refspec(remote, branch);
>         if (!slash)
>> > +	strbuf_addf(&branch, ":refs/heads/%s", remote->name);
>> > +	add_fetch_refspec(remote, strbuf_detach(&branch, 0));
>> >  	remote->fetch_tags = 1; /* always auto-follow */
>> >  }

Yeah, sounds like it. Will queue in 'next', for eventual inclusion in 'maint'. This is a 1.5.4 regression fix, together with "push --tags" fix we discussed today.

Previous: Daniel BarkalowNext: Junio C Hamano
Message 6 of 8 in “Fix branches file configuration”
  1. Fix branches file configurationDaniel Barkalow, Mar 25, 2008
  2. Andrew MortonMar 25, 2008
  3. Junio C HamanoMar 25, 2008
  4. Andrew MortonMar 26, 2008
  5. Daniel BarkalowMar 26, 2008
  6. Junio C HamanoMar 26, 2008
  7. Junio C HamanoMar 26, 2008
  8. git-fetch test: test tracking fetch results, not just FETCH_HEADJunio C Hamano, Mar 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.