Re: Review of git multimail
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 2, 2013, 22:21 UTC
- Message-ID
- <7vsizwiowt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1372793019-12162-1-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 10 quoted lines
>> def get(self, name, default=''): >> try: >> values = self._split(read_git_output( >> ['config', '--get', '--null', '%s.%s' % (self.section, name)], >> env=self.env, keepends=True, >> )) > > Wait, what is the point of using --null and then splitting by hand > using a poorly-defined static method? Why not drop the --null and > splitlines() as usual?
You may actually have spotted a bug or misuse of "--get" here.
With this sample configuration:
$ cat >sample <<\EOF
[a]
one = value
one = another [b]
one = "value\nanother"
EOFA script cannot differentiate between them without using '--null'.
$ git config -f sample --get-all a.one
$ git config -f sample --get-all b.oneBut that matters only when you use "--get-all", not "--get". If this method wants to make sure that the user did not misuse a.one as a multi-valued configuration variable, use of "--null --get-all" followed by checking how many items the command gives you back would be a way to do so.