On Thu, Nov 22, 2018 at 4:07 AM Jean-Yves Avenard <jyaven...@mozilla.com>

> Hi
> > On 21 Nov 2018, at 3:54 am, Ehsan Akhgari <ehsan.akhg...@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.

Indeed.  Kats was asking me about how we can possibly support skipping over
these commits in searchfox.org, and I pointed this tool to him as well.
I'm hoping that he would be able to find a way to integrate hyper-blame
with searchfox so that more people can benefit from this.  (I am not sure
how frequently people run blame tools locally...)

For Mercurial, "# skip-blame" is just a text token that Mercurial's revset
syntax can parse out of commit messages.  The revset syntax also supports
reading external files.  Felipe, gps and I talked a bit about adding a
similar .hg-blame-ignore-revs file in the tree which can contain Mercurial
sha1 changeset IDs for the rewrite commits to be skipped over, and people
would be able to use the file through an alias that can be configured in
~/.hgrc (possible to set it up via ./mach bootstrap).  Not sure if Felipe's
investigations have lead to results yet.

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

Indeed we can.  I would be happy to review a patch.  I think the file can
contain both the cinnabar and the gecko-dev sha1 variants of the rewrite
commit(s), since sha1s that are non-existent in a repo will just be ignored.

dev-platform mailing list

Reply via email to