From: Junio C Hamano <gitster@pobox.com>
To: Tiago de Bem Natel de Moura <t.nateldemoura@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git diff-tree do not honor diff.orderfile config
Date: Sat, 06 Jul 2024 00:38:28 -0700 [thread overview]
Message-ID: <xmqqsewn2cnf.fsf@gitster.g> (raw)
In-Reply-To: <CAJFVNCfz_-Dvd0ctc4w-2jsthyPFxy=HOutj=3PbNnQ-Gsz84A@mail.gmail.com> (Tiago de Bem Natel de Moura's message of "Fri, 5 Jul 2024 11:28:23 +0100")
Tiago de Bem Natel de Moura <t.nateldemoura@gmail.com> writes:
> What did you do before the bug happened? (Steps to reproduce your issue)
> The config `diff.orderfile` is not being honored in the `git diff-tree` command
> as stated by the documentation.
>
> What did you expect to happen? (Expected behavior)
> The output ordered by the pattern file.
>
> What happened instead? (Actual behavior)
> Output has normal order.
The diff-files, diff-index, and diff-tree ignore most (if not all)
of the end-user configuration variables in order to give a stable
output, which writers of scripts would expect to see out of these
plumbing commands.
Those who use these plumbing commands should still be able to use
the equivalent command line option to afffect their behaviour. In
this case, something like
orderfile=$(git config diff.orderfile)
git diff-tree ${orderfile:+"-O$orderfile"} ...
would be what script writers would do when the output is not for
machine consumption inside the script, but is to be shown to the
end-user directly and they want to pretend as if they used the 'git
diff' Porcelain command, which pays attention to the configuration
variable".
But when the command is the final output phase (as opposed to a step
in the multi-step logic your script implements, e.g. diff-files
produces a list of changed files to be read by other commands and
processed by your other commands in the downstream on the same
pipeline) and that is why it is a good idea to pay attention to the
configuration, using "git diff" not "diff-tree" may be more natural
thing to do.
Thanks.
prev parent reply other threads:[~2024-07-06 7:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 10:28 git diff-tree do not honor diff.orderfile config Tiago de Bem Natel de Moura
2024-07-05 21:04 ` Taylor Blau
2024-07-06 7:02 ` Jeff King
2024-07-06 22:10 ` Junio C Hamano
2024-07-08 12:49 ` Tiago de Bem Natel de Moura
2024-07-06 7:38 ` Junio C Hamano [this message]
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=xmqqsewn2cnf.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=t.nateldemoura@gmail.com \
/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).