Make WordPress Core

Opened 16 months ago

Last modified 16 months ago

#56029 new defect (bug)

.git-blame-ignore-revs causes other revisions to be ignored

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

Previously: #55422

It appears that the .git-blame-ignore-revs file is causing revisions other than those listed to be ignored when using the "View blame prior to this change" button on GitHub. This might be a bug in GitHub or it might be a side effect of how Git ignores revisions and produces an inability to keep track of changes to a line across major changes.

Steps to reproduce:

The actual previous revision was the Code is Poetry commit ([42343]) which is listed in .git-blame-ignore-revs. Prior to this commit, there was 97fcbef ([29221]) which is an actual functional change which is being ignored.

Removing the code formatting and pinking commits from the blame views is useful, but preventing history from being accurately traced back is a problem.

Options:

  • Ask GitHub to investigate or advise
  • Remove the .git-blame-ignore-revs file for now

cc @helen

Change History (2)

#1 @costdev
16 months ago

Confirmed as also occurring in VS Code with the GitLens extension and the following in settings.json:

{
    "gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".git-blame-ignore-revs"]
}

#2 @costdev
16 months ago

Using Git, adding the ignore-revs file with this command:

git config --local blame.ignoreRevsFile .git-blame-ignore-revs

Produces this result:

git blame -L946,946 src/wp-includes/pluggable.php

# Output (Incorrect)
78a2c0f7815 wp-includes/pluggable.php (Ryan Boren 2008-08-21 00:08:25 +0000 946) list( $username, $expiration, $token, $hmac ) = $cookie_elements;

Removing the ignore-revs file with this command:

git config --local blame.ignoreRevsFile ""

And instead passing the -w flag produces this result:

git blame -w -L946,946 src/wp-includes/pluggable.php

# Output (Correct)
97fcbef707e (Andrew Nacin 2014-07-18 09:12:05 +0000 946) list( $username, $expiration, $token, $hmac ) = $cookie_elements;

This does indeed point to the behaviour of the ignore-revs file.

Note: See TracTickets for help on using tickets.