On Tue, 9 May 2006, sean wrote:
That's what my stupid patch does now. It seems to work well for all cases,
but if we were to care, we could have some special heuristics for
different section names (ie "if subsection is all lower-case
alphanumerics, and the section name is one of the following, use the
old-fashioned format").
I don't see _why_ we'd ever do that, but we certainly _could_, if it were
to make more sense that way for some section name.
However, if you already use a syntax like
[section.subsection]
key = 1
and then do
git-repo-config --replace-all section.subsection.new 2
it will actually keep the old section header, so you'll end up with
[section.subsection]
key = 1
new = 2
but if you create a _new_ subsection (and since subsections are now case
sensitive, this example is a "new" subsection):
git-repo-config --replace-all section.SubSection.new 3
you will now have
[section.subsection]
key = 1
new = 2
[section "SubSection"]
new = 3
(ie notice how it did _not_ replace the old "section.subsection.new",
because of how this is a _different_ subsection due to the subsectin
rules, and notice how it will always create the new subsection with
quotes).
So you _can_ continue to use the old subsection format, and it will work
the way it always did, except for the fact that it would now be deprecated
(if there were any multi-level users, which I don't think there are), and
it is now case-sensitive (which makes sense in the new format with ""
around it, but is illogical in the old deprecated one).
> It seems to handle everything, you have me convinced.
Hey, it was fun, and the only ugly part was the write-out of the quoted
format.
And it should be perfectly easy to use. Modulo double-quotes in branch
names, you can do trivial things like
git repo-config "branch.$branchname.remote" "git://git.kernel.org/..."
and it will do the obvious thing.
My one complaint is that I think we should add an empty line for the case
where we add a new sub-section to the end of a file. That's not a new
problem, but that was really the only visually ugly part I noticed during
testing.
You _can_ be user-friendly and machine-parseable at the same time!
Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Ingo Molnar | [bug] block subsystem related crash with latest -git |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Adrian Bunk | Re: net/ipv4/fib_trie.c - compile error (Re: 2.6.23-rc3-mm1) |
git: | |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
