Re: Implementing branch attributes in git config
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 8, 2006, 00:25 UTC
- Message-ID
- <Pine.LNX.4.64.0605071718440.3718@g5.osdl.org>
- In-Reply-To
- <Pine.LNX.4.64.0605071629080.3718@g5.osdl.org>
On Sun, 7 May 2006, Linus Torvalds wrote:
Show 5 quoted lines
> > The downside is that if you start using config files like this, you > literally can't go back to older git versions. They'll refuse to touch > such a config file (rather than just ignoring the new entries) and will > exit with nasty messages. That might be unacceptable.
Side note: with this syntax, the _users_ will all just basically do
if (!strncmp(name, "branch.", 7)) {
branch = name + 7;
dot = strchr(branch, '.');
if (!dot)
return -1;
*dot++ = 0;
.. we now have the branchname in "branc",
and the rest in "dot" ..and if your branch names are purely alphabetical and lower-case, you can now write
[branch.origin] remote = true url = git://git.kernel.org/... fetch = master
[branch.master] pull = origin
and it will be parsed _exactly_ the same as
["origin"] remote = true url = git://git.kernel.org/... fetch = master
["master"] pull = origin
while the [branch.origin] syntax allows old versions of git to happily ignore it. So that would be a kind of cheesy work-around: the new double-quoted format is only _required_ for any branch-names that have special characters in it.
Linus