[git] Add method to ignore reformat commits during blame

RESOLVED FIXED in Firefox 65

Status

enhancement
RESOLVED FIXED
7 months ago
7 months ago

People

(Reporter: jya, Assigned: jya)

Tracking

Trunk
mozilla65

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Assignee

Description

7 months ago
From moz-dev:

Hi

On 21 Nov 2018, at 3:54 am, Ehsan Akhgari <ehsan.akhgari@gmail.com> wrote:


You will break the blame on VCS with this change

Yes and no. Of course, just like many tree-wide mass changes in the past
(e.g. the MPL2 header update), this will remain in the log.

Mercurial and Git both support a -w argument to ignore whitespace with
annotate/blame.

In addition, modern versions of Mercurial have `hg annotate --skip
<revset>` which allows you to specify a revset used to select revisions to
skip over when annotating.

Last but not least, we will tag the changeset’s commit message with
“skip-blame” so that Mercurial would automatically ignore the reformat
changeset for blame operations.

I’ve found the Google’s depot_tools hyper-blame particularly useful here.

It takes a .git-blame-ignore-revs file containing the list of commits to ignore.

$ cat .git-blame-ignore-revs 
abd6d77c618998827e5ffc3dab12f1a34d6ed03d

That’s with Sylvestre single commit changing dom/media (hg SHA1: 0ceae9db9ec0be18daa1a279511ad305723185d4)

$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH=$PATH:$PWD/depot_tools

now git hyper-blame will behave in the same fashion as git blame, but ignore that particular commit.

I’m guessing we could make this .git-blame-ignore-revs part of the tree, assuming though everyone must use git-cinnabar.
Assignee

Comment 1

7 months ago
This file allows to ignore specific commits when using Google's hyper-blame utility

For now just contains mercurial commit 0ceae9db9ec0be18daa1a279511ad305723185d4 "Bug 1204606 - Reformat of dom/media r=jya"

abd6d77c618998827e5ffc3dab12f1a34d6ed03d is the cinnabar's SHA1
804b8b8883ba2a6795b0fcf65ebcb18306b6416b is the gecko-dev one.
Assignee

Updated

7 months ago
Assignee: nobody → jyavenard

Comment 2

7 months ago
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5b3cb1cb51e3
Add .git-blame-ignore-revs file. r=Ehsan

Comment 3

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5b3cb1cb51e3
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Assignee

Updated

7 months ago
See Also: → 1511887
Attachment #9029340 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.