git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: Implementing branch attributes in git config
Date: Mon, 08 May 2006 17:54:41 -0700	[thread overview]
Message-ID: <7virogc90u.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0605081731440.3718@g5.osdl.org> (Linus Torvalds's message of "Mon, 8 May 2006 17:37:29 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> On Mon, 8 May 2006, sean wrote:
>> 
>> One option, which I don't really like and comes with its own set of 
>> problems, would be to do something like:
>> 
>> [branch1]
>>     streetname = "p4/BrAnCH"
>> [branch2]
>>     streetname = "origin"
>
> You don't actually need that.
>
> We could easily do
>
> 	[branch]
> 		name = "p4/BrAnCH"
> 		url = git://git.kernel.org/...
> 		pull = master
>
> 	;
> 	; Repeating the "[branch]" section here isn't
> 	;  needed, but doesn't hurt either, and is
> 	; more readable
> 	;
> 	[branch]
> 		name = "origin"
> 		url = ...
> 		pull = ...
>
> because the config file is always parsed linearly, and just 
> trigger on "branch.name", and keep that around when parsing 
> anything else.
>
> The problem with _that_ is that "git repo-config" can't add this kind of 
> setup sanely: it doesn't understand that kind of statefulness.

Wait a minute...  Statefulness is not the issue, I think.

How would you tell your updated repo-config what to update and
what to look up?

	- I want the url for branch whose name is "origin"

	- I want to fetch their "for-linus" branch when fetching
          from the branch whose name is "jgarzik" from now on.

In these query and update, you _are_ naming the branch with
name="xxx"; you just made "name" a special attribute.

Now, how would that compare with:

        [branch.jgarzik]
                url = git://git.kernel.org/...
                fetch = for-linus

or
	[branch."JGarzik"]
                url = git://git.kernel.org/...
                fetch = for-linus

I would say if we are grouping things together, if we can give
name to each group, _and_ if we are going to refer to the group
with its name, we are better off making the groups into distinct
sections _and_ make the syntax obvious that what name refers to
the section.  I think [branch.jgarzik] syntax is more obvious
than your example where "name =" line is implicitly used as a
keyword to differenciate multiple occurrences of [branch]
sections.

Having said that, perhaps you have something more elaborate in mind,
e.g.

	repo-config --get branch.url where name = 'origin'
	repo-config --get branch.name where url like 'git://%'
	repo-config branch.url 'git://git.kernel.org/...' where name = foo

;-) ;-) ;-) ???  If that is what you are after, then I agree
your syntax is more generic and suitable.  But otherwise I fail
to see its point.

On a related topic, I have always been torn about the "for"
convention.  While I think it was a cute hack, it would break
quite badly once we start doing anything complex.

	[branch]
        	url = git://git.kernel.org/... for jgarzik
                fetch = for-linus for jgarzik
                proxy = none

        	url = git://git.kernel.org/... for torvalds
                fetch = master for torvalds

  parent reply	other threads:[~2006-05-09  0:54 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-07 21:34 Implementing branch attributes in git config Pavel Roskin
2006-05-07 22:24 ` Junio C Hamano
2006-05-08  0:43   ` Johannes Schindelin
2006-05-08  0:05 ` Linus Torvalds
2006-05-08  0:18   ` Linus Torvalds
2006-05-08  0:25   ` Linus Torvalds
2006-05-08  1:05     ` Johannes Schindelin
2006-05-08  1:21       ` Pavel Roskin
2006-05-08  1:27         ` Johannes Schindelin
2006-05-08  1:55           ` Pavel Roskin
2006-05-08  9:00             ` Junio C Hamano
2006-05-08 12:17               ` Johannes Schindelin
2006-05-08 15:15               ` Pavel Roskin
     [not found]   ` <20060507203458.439d8815.seanlkml@sympatico.ca>
2006-05-08  0:34     ` sean
2006-05-08  0:55       ` Linus Torvalds
2006-05-08  1:04         ` Pavel Roskin
     [not found]         ` <20060507211145.36fb1be4.seanlkml@sympatico.ca>
2006-05-08  1:11           ` sean
2006-05-08  0:36   ` Pavel Roskin
2006-05-08  0:43     ` Linus Torvalds
2006-05-08  1:27       ` Junio C Hamano
     [not found]         ` <20060507213445.66a2a3b0.seanlkml@sympatico.ca>
2006-05-08  1:34           ` sean
2006-05-08  1:45             ` Johannes Schindelin
     [not found]               ` <20060507214429.623905a6.seanlkml@sympatico.ca>
2006-05-08  1:44                 ` sean
2006-05-08  2:29             ` Junio C Hamano
     [not found]               ` <20060507223918.6112f0c1.seanlkml@sympatico.ca>
2006-05-08  2:39                 ` sean
2006-05-08 23:20                   ` Daniel Barkalow
     [not found]                     ` <20060508193005.40f249a1.seanlkml@sympatico.ca>
2006-05-08 23:30                       ` sean
2006-05-08 23:44                         ` Johannes Schindelin
     [not found]                           ` <20060508200826.2b0f34a6.seanlkml@sympatico.ca>
2006-05-09  0:08                             ` sean
2006-05-09  0:23                               ` Johannes Schindelin
2006-05-09  0:37                               ` Linus Torvalds
     [not found]                                 ` <20060508204933.539ddd8b.seanlkml@sympatico.ca>
2006-05-09  0:49                                   ` sean
2006-05-09  0:54                                 ` Junio C Hamano [this message]
2006-05-09  1:05                                   ` Linus Torvalds
2006-05-09  1:18                                     ` Junio C Hamano
2006-05-09  1:30                                       ` Linus Torvalds
2006-05-09  5:31                                         ` Junio C Hamano
2006-05-09  1:57                                       ` Linus Torvalds
     [not found]                                         ` <20060508224721.045a48fb.seanlkml@sympatico.ca>
2006-05-09  2:47                                           ` sean
2006-05-09  3:08                                             ` Linus Torvalds
     [not found]                                               ` <20060508230752.43118643.seanlkml@sympatico.ca>
2006-05-09  3:07                                                 ` sean
2006-05-09  4:11                                                   ` Linus Torvalds
2006-05-09  4:28                                                     ` Jakub Narebski
2006-05-09 11:21                                                       ` Johannes Schindelin
2006-05-09 15:29                                                         ` Linus Torvalds
2006-05-09 18:03                                                         ` Junio C Hamano
2006-05-09 19:24                                                           ` Linus Torvalds
     [not found]                                                             ` <20060509154459.40cc0d13.seanlkml@sympatico.ca>
2006-05-09 19:44                                                               ` sean
     [not found]                                                                 ` <20060509180955.373a2c1d.seanlkml@sympatico.ca>
2006-05-09 22:09                                                                   ` sean
2006-05-09 22:42                                                                     ` Junio C Hamano
     [not found]                                                                       ` <20060509184519.5a707231.seanlkml@sympatico.ca>
2006-05-09 22:45                                                                         ` sean
     [not found]                                                                         ` <20060509190708.4ee6656e.seanlkml@sympatico.ca>
2006-05-09 23:07                                                                           ` sean
2006-05-09 23:23                                                                         ` Pavel Roskin
2006-05-10  0:17                                                                     ` Linus Torvalds
     [not found]                                                                       ` <20060509210857.27df014e.seanlkml@sympatico.ca>
2006-05-10  1:08                                                                         ` sean
2006-05-10  2:08                                                                           ` Linus Torvalds
2006-05-10  7:19                                                                             ` Martin Langhoff
2006-05-10 11:07                                                                               ` Johannes Schindelin
2006-05-10 15:37                                                                               ` Linus Torvalds
2006-05-10 16:03                                                                                 ` Jakub Narebski
2006-05-10 23:17                                                                                 ` Martin Langhoff
2006-05-10 23:55                                                                                   ` Linus Torvalds
2006-05-11  0:11                                                                                     ` Linus Torvalds
2006-05-11  9:51                                                                                       ` Jeff King
2006-05-11 11:39                                                                                         ` Jeff King
2006-05-11  0:13                                                                                     ` Martin Langhoff
2006-05-11 10:30                                                                                       ` Johannes Schindelin
2006-05-11  1:53                                                                                     ` Nicolas Pitre
2006-05-11  6:02                                                                                       ` Jakub Narebski
     [not found]                                                                       ` <20060509213853.0fd8af0f.seanlkml@sympatico.ca>
2006-05-10  1:38                                                                         ` sean
2006-05-11 17:22                                                             ` Junio C Hamano
2006-05-09  4:20                                                 ` Pavel Roskin
2006-05-09 11:26                                               ` Martin Waitz
2006-05-09 11:34                                                 ` Johannes Schindelin
2006-05-08 23:40                     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7virogc90u.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).