0

My situation is: We have a huge old unformatted codebase that a lot of people have contributed to.

We want to reformat the entire thing, but the problem is, we will lose our entire git history if we do.

It will look like our whole codebase was updated in 2016 by a single user.

My Question is: Are there any plugins in android studio that let the user modify git revision/annotation history settings to ignore specific revision numbers or commits by a certain user and display the revision history from the previous user that edited that line of code?

I've looked all over and haven't found anything so far.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
sirFunkenstine
  • 8,135
  • 6
  • 40
  • 57

3 Answers3

1

I don't think this is possible.
But what you can do is, if you annotate and see, the line was last changed by that reformat, right click the annotation stuff in the gutter and select Annotate previous revision and you will see the Annotations from the previous revision on in a new Editor.

Vampire
  • 35,631
  • 4
  • 76
  • 102
1

You did not found answer since it cannot be done

Git is designed in a way that each commit is pointing t its previous one and any attempt to re-write history will result in a rebase.

enter image description here


If you wish to delete certain commits made by user you can do it using filter-branch of BFG but again it will result in rebase.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • That was not the question. OP does not want to manipulate the Git history, but make Android Studio (IntelliJ IDEA) not consider a certain commit when calculating annotations (blame information). ;-) – Vampire Jul 05 '16 at 11:57
0

The following removes most, but not all of the blamed lines. If a line cannot be attributed to a previous commit, then it is attributed to the refactoring commit

Create a file: .git-blame-ignore-revs

  • one line per ignored commit hash, # for comments
git config --local blame.ignoreRevsFile .git-blame-ignore-revs

https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revltrevgt

Do not define the config globally as it will break git blame for repositories without this file: git blame with optional ignorerevsfile

DA_123
  • 337
  • 3
  • 10