My project underwent multiple directory renames and directory splitting. gitk deals with that very nicely and is capable of tracking a file from head to all file revisions down to the very first one.
Emacs, however, seems to stumble upon the first rename. It only lists a few recent revisions when doing Ctrl-x v l (Tools > Version Control > Show History on the menu, vc-git-print-log function in vc-git.el):
commit 13172930ab094badeab81cd2e05119d2a4c1f58a
Author: WinWin <winwin@example.com>
Date: Tue Jul 12 18:17:27 2011 -0600
commit comment
commit 0b52ca957a79a26e51bdd6f7193ef913c4abdc7b
Author: WinWin <winwin@example.com>
Date: Tue Jul 10 10:39:12 2011 -0600
commit comment
commit 8ca577e532849203646867527921b66aa1162dbd
Author: WinWin <winwin@example.com>
Date: Tue Jul 10 08:01:59 2011 -0600
commit comment
commit 9e623a23ad485d0937fe5409162f07434be8ca63
Author: WinWin <winwin@example.com>
Date: Tue Jul 10 01:50:39 2011 -0600
commit comment
Since I am used to the way Emacs built-in support for Version Control works (finger habits from the CVS days…), I wonder whether it is possible to enable it to track the entire revision history, despite the renames, just as gitk does, without using a completely different package?
You have other packages for integrating git with Emacs, as described here (maggit, git-emacs or egg, an old fork from maggit).
What you need to check, in git.el or in those other implementation, is how they implement git log:
Only a
git log -M -Cwill find renames and copiesof a file(*) (or at least agit log --follow).(Also, check your git version)
(*): Not exactly for one file: –follow is the right option when displaying the log for one file. See the last part of this answer to know why.
That being said, without changing anything to your current package, you can check your local
git config, and try:and see if that changes the default
git.el logresult.The OP WinWin reports:
--followis the right option use for rename and copy detection for one given file.C:\emacs-23.2\lisp\vc-git.el(and deletingvc-git.elcin same folder, this is important!), adding “--follow” to the(defun vc-git-print-log ...part is enough for said option to be active.Note: to understand the difference between
-Cand-Moptions, and--follow, see this threadJakub Narębski mentioned in May 2010 (and that still seems accurate in July 2011):
To which, Eli Barzilay adds:
Jeff King answers:
About the config settings, Jeff King mentions: