From: Phillip Wood <phillip.wood123@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Peter Hutterer <peter.hutterer@who-t.net>,
git@vger.kernel.org, David Heidelberg <david@ixit.cz>,
Dragan Simic <dsimic@manjaro.org>
Subject: Re: [PATCH v3] diff: add diff.srcPrefix and diff.dstPrefix configuration variables
Date: Wed, 13 Mar 2024 16:18:23 +0000 [thread overview]
Message-ID: <9449a421-c6ea-427c-a600-73c6f99ccf0d@gmail.com> (raw)
In-Reply-To: <xmqqbk7if8vj.fsf@gitster.g>
On 13/03/2024 15:29, Junio C Hamano wrote:
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
>>> With a custom prefix those scripts will break, having an option that
>>> forces the a/ and b/ prefix helps. Plus the man page explicitly says:
>>> Use the default source and destination prefixes ("a/" and "b/").
>>> So let's stick with that behaviour then.
>>
>> As I understand it the purpose of --default-prefix is to override all
>> the prefix related config settings so this seems like a very sensible
>> choice.
>
> It would be nice to update the description of '--default-prefix' so
> that nobody has to say "As I understand it" anymore ;-)
That's a good idea
> As we are selling .{src,dst}Prefix as a thing that sets the default
> prefix, we'd need to break the loop somehow, and "hardcoded" below
> is my attempt to do so, but I am not sure if I succeeded.
>
> Documentation/diff-options.txt | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git c/Documentation/diff-options.txt w/Documentation/diff-options.txt
> index aaaff0d46f..62eaa46d84 100644
> --- c/Documentation/diff-options.txt
> +++ w/Documentation/diff-options.txt
> @@ -864,9 +864,10 @@ endif::git-format-patch[]
> Do not show any source or destination prefix.
>
> --default-prefix::
> - Use the default source and destination prefixes ("a/" and "b/").
> - This is usually the default already, but may be used to override
> - config such as `diff.noprefix`.
> + Use the hardcoded default source and destination prefixes
> + ("a/" and "b/"). This is designed to be used to override
> + configuration variables such as `diff.noprefix` and
> + `diff.srcPrefix`.
That looks clear to me. I think the only other config variable that
affects the prefix is "diff.mnemonicPrefix" so if we're going to update
the description to mention "diff.srcPrefix" maybe we should mention that
one as well or just say something like "This is designed to be used to
override the configuration variables `diff.*Prefix`.".
Best Wishes
Phillip
> --line-prefix=<prefix>::
> Prepend an additional prefix to every line of output.
next prev parent reply other threads:[~2024-03-13 16:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 2:32 [PATCH] diff: add diff.srcprefix and diff.dstprefix option support Peter Hutterer
2024-03-11 18:06 ` Junio C Hamano
2024-03-12 0:57 ` [PATCH v2] diff: add diff.srcprefix and diff.dstprefix configuration variables Peter Hutterer
2024-03-12 19:23 ` Junio C Hamano
2024-03-12 19:29 ` Dragan Simic
2024-03-12 23:15 ` [PATCH v3] diff: add diff.srcPrefix and diff.dstPrefix " Peter Hutterer
2024-03-13 2:15 ` Dragan Simic
2024-03-13 3:26 ` Dragan Simic
2024-03-13 15:06 ` Phillip Wood
2024-03-13 15:14 ` Dragan Simic
2024-03-13 15:24 ` Junio C Hamano
2024-03-13 15:28 ` Dragan Simic
2024-03-13 15:04 ` Phillip Wood
2024-03-13 15:29 ` Junio C Hamano
2024-03-13 16:18 ` Phillip Wood [this message]
2024-03-13 17:55 ` Junio C Hamano
2024-03-14 5:06 ` Peter Hutterer
2024-03-13 20:23 ` Dragan Simic
2024-03-15 1:03 ` [PATCH v4] " Peter Hutterer
2024-03-15 3:53 ` Dragan Simic
2024-03-15 5:54 ` [PATCH v5] " Peter Hutterer
2024-03-15 6:02 ` Dragan Simic
2024-03-15 17:00 ` Junio C Hamano
2024-03-15 19:13 ` Dragan Simic
2024-03-16 5:57 ` Junio C Hamano
2024-03-16 6:41 ` Dragan Simic
2024-03-18 3:49 ` Peter Hutterer
2024-03-18 4:39 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9449a421-c6ea-427c-a600-73c6f99ccf0d@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=david@ixit.cz \
--cc=dsimic@manjaro.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peter.hutterer@who-t.net \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).