Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Bob Hiestand
On Thu, Feb 14, 2013 at 8:02 PM, Matt Neuburg mattne...@gmail.com wrote:

 My files have all been renamed, so to diff one of them to an earlier
 commit I'm saying this sort of thing:

 git diff HEAD:newname cb3e0a5fa8:oldname

 I have to keep a list of the new names and old names beside me at all
 times. This seems nuts. Is there a better way? Clearly git can tell from
 the history when a file has been renamed, so why do I have to tell it the
 old name of each file? Thx.


Have you tried the '-M' option to diff?

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Matt Neuburg

On Feb 15, 2013, at 7:48 AM, Bob Hiestand bob.hiest...@gmail.com wrote:

 
 On Thu, Feb 14, 2013 at 8:02 PM, Matt Neuburg mattne...@gmail.com wrote:
 My files have all been renamed, so to diff one of them to an earlier commit 
 I'm saying this sort of thing:
 
 git diff HEAD:newname cb3e0a5fa8:oldname
 
 I have to keep a list of the new names and old names beside me at all times. 
 This seems nuts. Is there a better way? Clearly git can tell from the history 
 when a file has been renamed, so why do I have to tell it the old name of 
 each file? Thx.
 
 Have you tried the '-M' option to diff? 

Yes, have you? It seems to have no effect when you supply an explicit filename 
- presumably *because* you are supplying an explicit filename. That's exactly 
my point.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Bob Hiestand
On Fri, Feb 15, 2013 at 10:31 AM, Matt Neuburg mattne...@gmail.com wrote:

  Have you tried the '-M' option to diff?

 Yes, have you? It seems to have no effect when you supply an explicit
 filename - presumably *because* you are supplying an explicit filename.
 That's exactly my point.


I have; your post didn't restrict the use to only filtering by path.  I
don't see a way to filter by path and allow it to work without scripting it
yourself.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Matt Neuburg

On Feb 15, 2013, at 9:24 AM, Bob Hiestand bob.hiest...@gmail.com wrote:

 your post didn't restrict the use to only filtering by path

It did; it showed an example of what I'm having to do, where I'm explicitly 
comparing HEAD:newfile with oldCommit:oldfile. That is what I need to do: 
compare a particular file with its version in the past. The question is, is 
there a way to do this without my having to supply the old name of the same 
file, every darned time. One thinks there should be, because, after all, git 
does know the old name (as is proved by its ability to log backwards through 
it).

Whenever one has to do something dumb and repetitive, a computer should be 
doing it for you. That's what I'm asking for in this case. I have dozens of 
these files to do these comparisons with, a lot. m.

PS It isn't my fault that the files were all renamed. Orders from on high, 
don't you know.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Thomas Ferris Nicolaisen
On Friday, February 15, 2013 9:04:25 PM UTC+1, Matt Neuburg wrote:


 On Feb 15, 2013, at 9:24 AM, Bob Hiestand bob.hi...@gmail.comjavascript: 
 wrote: 

  your post didn't restrict the use to only filtering by path 

 It did; it showed an example of what I'm having to do, where I'm 
 explicitly comparing HEAD:newfile with oldCommit:oldfile. That is what I 
 need to do: compare a particular file with its version in the past. The 
 question is, is there a way to do this without my having to supply the old 
 name of the same file, every darned time. One thinks there should be, 
 because, after all, git does know the old name (as is proved by its ability 
 to log backwards through it). 

 Whenever one has to do something dumb and repetitive, a computer should be 
 doing it for you. That's what I'm asking for in this case. I have dozens of 
 these files to do these comparisons with, a lot. m. 

 PS It isn't my fault that the files were all renamed. Orders from on high, 
 don't you know.


If you are comparing many files in one diff, have a look 
at http://stackoverflow.com/questions/7759193/git-diff-renamed-file

If you want to single down to the diff on a single file, there is no first 
class way to do this in Git. You could do a feature request to the Git 
developer list https://gist.github.com/tfnico/4441562, and argue that it 
belongs in git diff. I agree that it would be useful, but not sure the 
developers will feel the same way.

Some GUI tools support showing the history of a single file. You can then 
select two revisions and do a compare between the two.

I guess you could script it by parsing the output of a git log with the two 
revisions and the filename in one of them, finding the old file-name, and 
then using it in a second diff call.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Matt Neuburg

On Feb 15, 2013, at 1:57 PM, Thomas Ferris Nicolaisen wrote:

 If you want to single down to the diff on a single file, there is no first 
 class way to do this in Git. You could do a feature request to the Git 
 developer list, and argue that it belongs in git diff. I agree that it would 
 be useful, but not sure the developers will feel the same way.

Interesting. It is odd to me that you can say git diff commit1..commit2 -- 
myFile and that this usually works but suddenly stops working merely because 
myFile got renamed somewhere between commit and commit2. It feels like breakage 
and it surprises me that the developers don't feel it that way (but obviously 
they don't, or they would have done something about it).

 Some GUI tools support showing the history of a single file. You can then 
 select two revisions and do a compare between the two.
 
 I guess you could script it by parsing the output of a git log with the two 
 revisions and the filename in one of them, finding the old file-name, and 
 then using it in a second diff call.

Thanks. I think that's just what I'll do! m.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[git-users] git diff when file has been renamed

2013-02-14 Thread Matt Neuburg
My files have all been renamed, so to diff one of them to an earlier commit 
I'm saying this sort of thing:

git diff HEAD:newname cb3e0a5fa8:oldname

I have to keep a list of the new names and old names beside me at all 
times. This seems nuts. Is there a better way? Clearly git can tell from 
the history when a file has been renamed, so why do I have to tell it the 
old name of each file? Thx.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.