2

I noticed this line after I committed something just now:

[master 6c15628] <Commit message>
 1 files changed, 49 insertions(+), 44 deletions(-)
 rewrite <filename> (63%)

Which I think is really cool, that git knew that I rewrote that file (i.e., the rewrite <filename> (63%) part). This has me more interested. Is there any git command to get a list of all commits/files that have been "rewritten" by git's standards?

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • I don't believe there is a way to list all such occurrences, no. – Amber Sep 15 '10 at 04:11
  • http://stackoverflow.com/questions/1265040 can offer interesting alternatives, but maybe not *exactly* what you are looking for. – VonC Sep 15 '10 at 04:20
  • 1
    Thanks for the advice. http://stackoverflow.com/questions/1046276/git-rewrite-90 is also related. It suggests that this is actually a "similarity index". Actually, search for "similarity" on http://www.kernel.org/pub/software/scm/git/docs/git-diff.html. It seems like it should be possible using some of those options and some bash tools, right? – asmeurer Sep 15 '10 at 04:34
  • 1
    have you tried `git diff --stat | grep rewrite` ? – mb14 Nov 22 '10 at 13:43

1 Answers1

1

Git doesn't really have a standard; this is just a UI presentation heuristic. Its output on this point might vary from version or version, or based on various other conditions.

If you wanted, you could probably write a script that used Git's similarity index with some threshold you specify to list the information you're interested in.

Phil Miller
  • 36,389
  • 13
  • 67
  • 90