Rename discards history

22 views
Skip to first unread message

Andrzej Borucki

unread,
Apr 30, 2013, 5:07:18 PM4/30/13
to msy...@googlegroups.com
I make changes in my project, rename, move files, but history discards.To see it, I create test repository on:
https://bitbucket.org/aborucki/test
I create repository and make some changes and commits with pushes to bitbucket

Test rename file
1.Most intuitive way: first change name first.txt to ren_first.txt and change this file,
next I type "mv first.txt ren_first.txt" and commit it
>mv first.txt ren_first.txt
-> mv: cannot stat `first.txt': No such file or directory

2. Second way: first type "mv second.txt ren_second.txt", next change it and commit
git status: deleted and added

--> I rename, not delete!
>git commit
>git commit -a

3. Third way: first type "mv third.txt ren_third.txt", next change it and commit with -a

only now
 2 files changed, 3 insertions(+)
 rename third.txt => ren_third.txt (100%)

Success !?
I push; git push
BAD
even third file has not history!!!!!!

https://bitbucket.org/aborucki/test/history-node/a9d856f4abe8/ren_third.txt?at=master

It is git error or very non intuitive ?

Philip Oakley

unread,
May 1, 2013, 6:19:57 AM5/1/13
to msy...@googlegroups.com
This is normal. Git takes snapshots of your worktree. Changes sets are determined after the event by a set of heuristics, so all you need to do is adjust the setting for the heuristics..
 
If you want to look back at Linus Torvalds' view on this have a look at http://article.gmane.org/gmane.comp.version-control.git/217
 
It does take a little while to appreciate, but it is why Git works [In old money it is 'configuration status accounting' - such as Mil-Std 482 - what do you have, not how did you get here?]
 
Philip
Reply all
Reply to author
Forward
0 new messages