Re: [PATCH] doc: fix quoting bug in credential cache example
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 1, 2020, 06:20 UTC
- Message-ID
- <xmqq368kp457.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200501055738.GB23665@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> I think we can either clarify that with a note at the beginning of the > list, or we can just present it as config, like: > > diff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt > index 1814d2d23c..c756ecb8fd 100644 > --- a/Documentation/gitcredentials.txt > +++ b/Documentation/gitcredentials.txt > @@ -216,20 +216,25 @@ Here are some example specifications: > > ---------------------------------------------------- > # run "git credential-foo" > -foo > +[credential] > +helper = foo
I like this style of "clarification"; it makes it clear that we are explaining the value in the config-file syntax.
> # or you can specify your own shell snippet
> -!f() { echo "password=`cat $HOME/.secret`"; }; f
> +[credential]
> +helper = "!f() { echo \"password=`cat $HOME/.secret`\"; }; f"But I do not think the "tentative shell function" trick is necessary. I personally think it is oversold ;-) For this particular one,
[credential]
helper = !echo \"password=`cat $HOME/.secret`\"should be sufficient, perhaps? You do not even need to understand how shell functions work to understand it.
Also, "git config" indents the "var = value" lines, so it would look more natural if we indented our examples in a similar way.
Thanks.