git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mustafa Zengin <mzengin88@gmail.com>
To: git@vger.kernel.org
Subject: git difftool -I and git diff -I behave differently
Date: Thu, 11 Mar 2021 12:18:50 -0800	[thread overview]
Message-ID: <CAJ-1jP7fy95V5ROj0gE3UC9zn5f=8pTTGy1Y7cwQtx7DidEhqw@mail.gmail.com> (raw)

Hi,

git difftool and git diff behave differently for option -I.

Repro steps:
1. Add a line with "text" into a file (without the quotes)
2. Run
  git diff -I"text"
3. Observe that no output is returned
4. Run
  git difftool -I"text"
5. Observe that the assigned diff tool is opened with the change
including "text".

Expected:
In step 5, no diff is shown.

My expectation is based on three things:
1. -S and -G options behave the same for `git diff` and `git difftool`.
2. Quote from https://git-scm.com/docs/git-difftool
    "See git-diff[1] for the full list of supported options."
   It implies that all `git diff` options are inherited to `git difftool`.
3. It looks like the command is attempting to parse the option so it
is not completely ignored. If I make the regex malformed, e.g.
     git difftool -I"*text"
   I get back:
     error: invalid regex given to -I: '*text'

StackOverflow post:
https://stackoverflow.com/questions/66574689/git-difftool-with-i-option

Versions tested:
Windows: git version 2.30.0.windows.1
Ubuntu: git version 2.30.2

Thanks,
Mustafa

                 reply	other threads:[~2021-03-11 20:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAJ-1jP7fy95V5ROj0gE3UC9zn5f=8pTTGy1Y7cwQtx7DidEhqw@mail.gmail.com' \
    --to=mzengin88@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).