Actually, even if I do dnot do git mv explicitely, but move, rename & edit a 
file, git somehow detectes it automatically! It shows matching percentage in 
git status. I guess it compares missing files with new files to detect file 
moves. Nice work!

> ----- Original Message -----
> From: Konstantin Khomoutov
> Sent: 09/01/11 10:38 PM
> To: fossil-users@lists.fossil-scm.org
> Subject: Re: [fossil-users] Diff after move
> 
> On Thu, 1 Sep 2011 18:16:07 +0200
> Stephan Beal <sgb...@googlemail.com> wrote:
> 
> > > DirB/file.txt. And, finally, 'fossil diff DirB/file.txt' resulted in
> > > 'fossil.exe: file DirB/file.txt does not exist in checkin:'
> > >
> > > Looks like a bug in the diff command but please confirm it if you
> > > can.
> > 
> > i think the message is correct: the file does not exist in the checkIN
> > because DirB/file.txt has never been committed. It exists in the
> > checkOUT, but no the checkIN.
> I think that the original poster meant that while the message can be
> absolutely correct, this behaviour itself has little sense.
> Consider how it's (sensibly) handled by Git:
> 
> C:\tmp\foo>git init
> Initialized empty Git repository in C:/tmp/foo/.git/
> 
> C:\tmp\foo>md a
> 
> C:\tmp\foo>md b
> 
> C:\tmp\foo>touch a\aaa.txt
> 
> C:\tmp\foo>git add a\aaa.txt
> 
> C:\tmp\foo>git commit -m "add a\aaa.txt"
> [master (root-commit) ec7b3f6] add a\aaa.txt
>  0 files changed, 0 insertions(+), 0 deletions(-)
>  create mode 100644 a/aaa.txt
> 
> C:\tmp\foo>git mv a\aaa.txt b
> 
> C:\tmp\foo>echo test >b\aaa.txt
> 
> C:\tmp\foo>git diff b\aaa.txt
> diff --git a/b/aaa.txt b/b/aaa.txt
> index e69de29..9eb3931 100644
> --- a/b/aaa.txt
> +++ b/b/aaa.txt
> @@ -0,0 +1 @@
> +test
> 
> C:\tmp\foo>git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #       renamed:    a/aaa.txt -> b/aaa.txt
> #
> # Changes not staged for commit:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working
> # directory)
> #
> #       modified:   b/aaa.txt
> #
> 
> Two points to note here:
> 1) `git mv` also moves the file physically.
>    Yes, this is debatable, but I think Git does The Right Thing here
>    following the principle of least surprise.
> 2) `git diff` works on the moved file.
>    Same here: it's quite sensible for the user to expect the VCS to know
>    the file has been renamed and be able co compare its state in the
>    "active" check-in with its current on-disk state.
> _______________________________________________
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
> 

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to