From: Johannes Altmanninger <aclopte@gmail.com>
To: git@vger.kernel.org
Subject: Unexpected behavior on diff -I<regex> --name-only
Date: Mon, 14 Dec 2020 20:00:54 +0100 [thread overview]
Message-ID: <20201214190054.lrdllbpf6jfrz573@gmail.com> (raw)
Since v2.28.0-2-g296d4a94e7 (diff: add -I<regex> that ignores matching changes)
diff -I<regex> can be used to suppress hunks of only matching lines.
This interacts in a surprising way with --name-only, which lists
all changed files, regardless of whether they are filtered out by -I<regex>:
git diff HEAD~ -I '' # always empty
git diff HEAD~ -I '' --name-only # not empty, "-I" does nothing
It could be nice to only show names of files with matching hunks
(or reject this combination of options?).
next reply other threads:[~2020-12-14 19:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-14 19:00 Johannes Altmanninger [this message]
2020-12-14 19:49 ` Unexpected behavior on diff -I<regex> --name-only Junio C Hamano
2020-12-16 23:18 ` Johannes Altmanninger
2020-12-16 23:18 ` [PATCH] diff: suppress --name-only paths where all hunks are ignored Johannes Altmanninger
2020-12-17 1:27 ` Re* " Junio C Hamano
2020-12-20 22:34 ` Johannes Altmanninger
2020-12-21 19:29 ` 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=20201214190054.lrdllbpf6jfrz573@gmail.com \
--to=aclopte@gmail.com \
--cc=git@vger.kernel.org \
/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).