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

Re: Default remote branch for local branch

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Apr 14, 2006, 18:26 UTC
Message-ID
<200604142026.44070.Josef.Weidendorfer@gmx.de>
In-Reply-To
<20060414161627.GA27689@pasky.or.cz>
On Friday 14 April 2006 18:16, you wrote:
Show 15 quoted lines
> Dear diary, on Sun, Apr 02, 2006 at 06:17:29PM CEST, I got a letter
> where Josef Weidendorfer <Josef.Weidendorfer@gmx.de> said that...
> > > I would write the config like this:
> > > 
> > > [branch-upstream]
> > > master = linus
> > > ata-irq-pio = irq-pio
> > > ata-pata = pata-drivers
> > 
> > That is not working, as said above. But with above syntax extension,
> > with s/=/for/ it would be fine.
> 
> I'm sorry but I'm slow and I don't see it - why wouldn't this work?
> (Except that the key name is case insensitive, which isn't too big a
> deal IMHO.)
Hmm...
* IMHO "keys are case insensitive" is enough to not qualify for branch
names: currently, branch names are case sensitive, and with above syntax you
effectively change this rule (you can not distinguish upstreams for "master"
vs. "MASTER").
* a dot currently seems to be allowed in branch names. For config keys, the
dot separates subkeys.
* I thought it is a convention for config keys to be alphanum only,
eg. "/" isn't allowed, too (which is mandatory for branch names).
Unfortunately, I found nothing about allowed chars for config keys in the
documentation.
 
Show 5 quoted lines
> I for one think that the 'for'-syntax is insane - it's unreadable (your
> primary query is by far most likely to be "what's the upstream when on
> branch X", not "what branches is this upstream for"), would convolute
> the configuration file syntax unnecessarily and would possibly also
> complicate the git-repo-config interface.

As far as I remember, the "... for ..." syntax was suggested by Linus for the proxy.command config a long time ago. The original proposal there was to use an URL as key part (as far as I can remember).

That said,
> Pavel's syntax is much nicer. 
... I agree with you here.

My suggestion would be to allow an optional syntax in the config file which is mapped by git-repo-config to the normalized "... for ..."-scheme. Eg. it should not be mandatory to specify "for ..." after the value of a key. So instead of

  branch.upstream = linus for master
you should be able to say
  [branch]
  upstream for master = linus
Josef
Previous: Petr BaudisNext: Jakub Narebski
Message 13 of 15 in “Default remote branch for local branch”
  1. Pavel RoskinApr 1, 2006
  2. Junio C HamanoApr 1, 2006
  3. Pavel RoskinApr 1, 2006
  4. Josef WeidendorferApr 2, 2006
  5. Junio C HamanoApr 2, 2006
  6. Josef WeidendorferApr 2, 2006
  7. Andreas EricssonApr 3, 2006
  8. Josef WeidendorferApr 3, 2006
  9. Andreas EricssonApr 3, 2006
  10. Junio C HamanoApr 3, 2006
  11. Josef WeidendorferApr 3, 2006
  12. Petr BaudisApr 14, 2006
  13. Josef WeidendorferApr 14, 2006
  14. Jakub NarebskiApr 1, 2006
  15. Jakub NarebskiApr 1, 2006

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.