Closed Bug 1509369 Opened 2 years ago Closed 2 years ago
[git] Add method to ignore reformat commits during blame
47 bytes, text/x-phabricator-request
|Details | Review|
From moz-dev: Hi On 21 Nov 2018, at 3:54 am, Ehsan Akhgari <email@example.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.
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.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/5b3cb1cb51e3 Add .git-blame-ignore-revs file. r=Ehsan
Include Bug 1511181
You need to log in before you can comment on or make changes to this bug.