Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
I found a bug in the git repository:
It's not a bug in the git repository. The git repository is fine, and this kind of errors never changes that (not now, and not in the future). The bug is in the git blame command.
In this case, someone copied the file and modified it before checking in the copy. In order to help git, a fake commit in between, where the file is unmodified would probably "fix" git blame (and is probably the recommended practice for anyone copying and modifying files, if at all possible), however, git already deals with this.
Check out the difference between:
git show 9eb55816 git show --find-copies-harder 9eb55816
There should be a similar difference between
git blame 9eb55816 git blame --find-copies-harder 9eb55816
But there isn't, so that is a bug (I'd say). But the nice thing is, this bug can be fixed without corrupting repositories.
I'm not quite sure how the --find-copies-harder can be made the default.
BTW, this is my /etc/gitconfig:
[alias] c = commit -a -m packall = !rm -rf .git/ORIG_HEAD .git/FETCH_HEAD .git/index .git/logs .git/info/refs .git/objects/pack/pack-*.keep .git/refs/original .git/refs/patches .git/patches .git/gitk.cache && git prune --expire now && git repack -a -d --window=200 && git gc copystrain = !git-copystrain newroot = !git-newroot newbranch = !git-newbranch removeattics = !git-removeattics makepatch = format-patch -k --stdout applypatch = am -k --whitespace=nowarn stgmail = !git-stgmail edit = !git-edit getcommit = !git-getcommit putcommit = !git-put-commit appendgrafts = !git-appendgrafts cvscommit = cvsexportcommit -v -c -u -w [repack] UseDeltaBaseOffset = true [diff] renames = copies [svn] noMetadata = true addAuthorFrom = true useLogAuthor = true [pack] compression = 9 # threads = 2 [user] name = Stephen R. van den Berg email = srb@cuci.nl
Ah yes, and one more generic tip... If you are juggling with patches (in your local branches), I suggest you take a look at "stg" (it's a supporting package to git).
Try the following on a branch of yours:
git checkout mybranch stg init stg uncommit -n 10 stg pop stg pop stg series
Now change a file.
stg refresh stg push -a
Et voila, commit changed in the past without much effort.