git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: "Matthias Aßhauer" <mha1993@live.de>, git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Elijah Newren" <newren@gmail.com>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: Re: gitk regression in version 2.36.0
Date: Sat, 23 Apr 2022 11:27:40 +0200	[thread overview]
Message-ID: <8424860b-e557-55b1-49a0-246a2eb112d4@web.de> (raw)
In-Reply-To: <AM0PR04MB6019ECF053F1FB7B29D75AB7A5F69@AM0PR04MB6019.eurprd04.prod.outlook.com>

Am 23.04.22 um 07:25 schrieb Matthias Aßhauer:
> Git 2.36.0 (or more precisely 244c27242f (diff.[ch]: have diff_free()
> call clear_pathspec(opts.pathspec), 2022-02-16)) introduced some
> change in behaviour that causes gitks highlight feature not to work
> correctly anymore.
>
> Here's a quick reproducer based on git.git:
>
> git checkout 244c27242f44e6b88e3a381c90bde08d134c274b~1
> make install
> git checkout 244c27242f44e6b88e3a381c90bde08d134c274b
> PATH=~/bin:$PATH ~/bin/gitk
> # In commit 4c53a8c20f (Git 2.35.1, 2022-01-28) (2nd from the top)
> # right click GIT-VERSION-GEN and select "Highlight this only".
> # You'll see 4c53a8c20f (Git 2.35.1, 2022-01-28) and
> # 89bece5c8c (Git 2.35, 2022-01-24) highlighted, but not the surrounding
> # commits. Exit gitk.
> make install
> PATH=~/bin:$PATH ~/bin/gitk
> # In commit 4c53a8c20f (Git 2.35.1, 2022-01-28) (2nd from the top)
> # right click GIT-VERSION-GEN and select "Highlight this only".
> # Almost every non-merge commmit will be highlighted.
>
> I think this is a change in behaviour in `git diff-tree`, but I'm
> honestly not sure what arguments gitk passes to `git diff-tree`, so
> I'm struggling to figure out what exactly changed.
>
> This issue was originally reported as a Git for Windows issue [1],
> but I can also reproduce it on Linux.
>
> [1] https://github.com/git-for-windows/git/issues/3815

gitk does something like this to find commits that touched that file
(just with more commits):

   # v2.25.3
   $ git rev-parse 4c53a8c20f ff5b7913f0 | git diff-tree -r -s --stdin GIT-VERSION-GEN
   4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a

   # 244c27242f (diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec), 2022-02-16))
   $ git rev-parse 4c53a8c20f ff5b7913f0 | git diff-tree -r -s --stdin GIT-VERSION-GEN
   4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a
   ff5b7913f0af62c26682b0376d0aa2d7f5d74b2e

Somewhere in diff-tree a struct diff_options is reused between commits,
and the caller expects its pathspec to be preserved, but 244c27242f
clears it.  With the path filter gone, the following commits match.

René

      parent reply	other threads:[~2022-04-23  9:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23  5:25 gitk regression in version 2.36.0 Matthias Aßhauer
2022-04-23  5:54 ` Junio C Hamano
2022-04-23  6:05   ` Junio C Hamano
2022-04-23 10:13   ` René Scharfe
2022-04-23 16:00     ` Junio C Hamano
2022-04-25 17:45       ` [PATCH] 2.36 gitk/diff-tree --stdin regression fix Junio C Hamano
2022-04-25 22:37         ` [PATCH] t4013: diff-tree --stdin with pathspec Junio C Hamano
2022-04-26 10:09         ` [PATCH] 2.36 gitk/diff-tree --stdin regression fix Phillip Wood
2022-04-26 13:45           ` Phillip Wood
2022-04-26 15:16             ` Junio C Hamano
2022-04-26 15:26             ` Junio C Hamano
2022-04-26 16:11               ` Junio C Hamano
2022-04-27 16:42                 ` René Scharfe
2022-04-27 18:06                   ` René Scharfe
2022-04-27 20:03                     ` Junio C Hamano
2022-04-23  9:27 ` René Scharfe [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8424860b-e557-55b1-49a0-246a2eb112d4@web.de \
    --to=l.s.r@web.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=mha1993@live.de \
    --cc=newren@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).