Michael Haggerty <mhag...@alum.mit.edu> writes:
> I would be happy to add the checking that you described, but I didn't
> have the impression that it is the usual convention. Does code that
> wants a single value from the config usually verify that there is
> one-and-only-one value, or does it typically just do the equivalent of
> "git config --get" and use the returned (effectively the last) value?
In most cases, variables are "one value per key" and follow "the
last one wins" rule, which is the reason why we read from the most
generic to the most specific (i.e. $GIT_DIR/config is read last).
For such uses, reading from "--get", and not from "--get-all", is
absolutely the right thing to do.
But then as Ram said, there probably is not a need for --null; you
can just read from textual "--get" to the end without any splitting
(using splitlines is of course wrong if you do so).
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html