4

Is it possible to squash a merge but retain the authorship for use with git-blame?

spinlock
  • 3,737
  • 4
  • 35
  • 46
  • 2
    Squashing takes multiple commits and maps them to a single commit, so not sure how one would preserve authorship, since there could be many authors. – David Deutsch Jun 16 '15 at 20:51
  • @DavidDeutsch: That's the issue I'm running into in a nutshell. I'm breaking a folder from a 2 year old project into it's own addon so I don't want to get blamed for all the code in there (it's convenient to see who wrote what) but retaining the entire history is a bit cumbersome. – spinlock Jun 16 '15 at 20:56
  • 2
    What is cumbersome about retaining the entire history? That's exactly the sort of thing that Git was designed to be good at. – Greg Hewgill Jun 16 '15 at 22:15
  • The best you could possibly hope for is for git-blame(1) to respect the `co-authored-by` trailer so that all authors get blamed for that same commit. (This does not seem to be the case.) But there is no way for the blame-information for each commit to propagate since you have destroyed/discarded that metadata. – Guildenstern May 06 '23 at 12:33
  • You could commit the squash commit as author `Don’t Blame Me <>`. – Guildenstern May 06 '23 at 12:33

0 Answers0