Page MenuHome

git blame: add file to help ignore cleanup commits
ClosedPublic

Authored by Ankit Meel (ankitm) on Oct 16 2020, 2:17 PM.
Tags
None
Tokens
"Like" token, awarded by campbellbarton."100" token, awarded by EAW."Like" token, awarded by Poulpator."Love" token, awarded by HooglyBoogly."Love" token, awarded by dfelinto."Love" token, awarded by brecht.

Details

Summary

For git version 2.23 and above:
To enable the ignorance for one command,

git blame --ignore-revs-file=.git-blame-ignore-revs <other options>

To set this permanently for blender,

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

To disable the ignorance for one command,

git blame --ignore-revs-file="" <other options>

Effect of this option considering rB3e101759b1b726e3cc16c69b2619cd1d82b00a8e

$ git blame build_files/cmake/Modules/FindOpenColorIO.cmake -L 72,+3
b93da9b01e16 (Sergey Sharybin 2012-09-15 10:03:17 +0000 72)   SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
3e101759b1b7 (Campbell Barton 2020-10-05 16:02:32 +1100 73) ENDIF()
b93da9b01e16 (Sergey Sharybin 2012-09-15 10:03:17 +0000 74) 

$ git blame --ignore-revs-file=.git-blame-ignore-revs build_files/cmake/Modules/FindOpenColorIO.cmake -L 72,+3
b93da9b01e16 (Sergey Sharybin 2012-09-15 10:03:17 +0000 72)   SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
b93da9b01e16 (Sergey Sharybin 2012-09-15 10:03:17 +0000 73) ENDIF()
b93da9b01e16 (Sergey Sharybin 2012-09-15 10:03:17 +0000 74) 

https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt
https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile

Diff Detail

Repository
rB Blender
Branch
ignore (branched from master)
Build Status
Buildable 10754
Build 10754: arc lint + arc unit

Event Timeline

Ankit Meel (ankitm) requested review of this revision.Oct 16 2020, 2:17 PM
Ankit Meel (ankitm) created this revision.
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Oct 16 2020, 2:21 PM
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Oct 16 2020, 2:29 PM
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Oct 16 2020, 2:38 PM
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)

add another commit

These instructions from chromium seem pretty reasonable to me:
https://chromium.googlesource.com/chromium/src.git/+/80a809a3566fe87ecbf2d7255ff7af4a7ee2fcb8/.git-blame-ignore-revs

They say to only do this for large commits, which I agree with. Also because you can't modify this file in the same commit due to the hash changing, and so it requires a second commit.

.gitblame-ignore-revs
2

The common name for this is git-blame-ignore-revs, not gitblame-ignore-revs.

18

I don't think we need to add dates here, just the first line of the commit message is enough.

Ankit Meel (ankitm) updated this revision to Diff 30025.EditedOct 16 2020, 5:41 PM
Ankit Meel (ankitm) marked 2 inline comments as done.
  • Rename to git-blame- from gitblame-
  • Remove dates, add notes, clarifications.

For ease of access, changes made in this update https://developer.blender.org/P1715

Brecht Van Lommel (brecht) accepted this revision.EditedOct 16 2020, 6:02 PM

Fine with me now, but wait for other core developers to give feedback as well, in particular @Campbell Barton (campbellbarton) who does most of these kinds of commits.

This revision is now accepted and ready to land.Oct 16 2020, 6:02 PM

This is brilliant :)

.git-blame-ignore-revs
5 ↗(On Diff #30025)

"the actual committer" is ambiguous, as both people mentioned here are actual committers. "before the ignored commit" is better IMO.

  • "actual committer" > "ignored commit".
Ankit Meel (ankitm) marked an inline comment as done.Oct 18 2020, 3:53 PM
This revision now requires review to proceed.Oct 19 2020, 4:41 PM

This is a welcome feature, only minor notes to add.

  • The example in this proposal uses: .gitblame-ignore-revs, instead of .git-blame-ignore-revs which is used in this patch (and seems most common).

    Mentioning this since it didn't work for me at first.
  • Reminder that our developer docs should be updated once this is on.
.git-blame-ignore-revs
44–45 ↗(On Diff #30072)

I don't think smaller commits like this are worth adding (28 lines changed), I'd rather limit this to larger changes.

This revision is now accepted and ready to land.Oct 27 2020, 4:33 AM
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Oct 27 2020, 10:44 AM
This revision was automatically updated to reflect the committed changes.
Ankit Meel (ankitm) marked an inline comment as done.