2

I have a partially working command I am using to get all the changed/new files between two Git commits, that being:

git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $head_commit_id $older_commit_id | xargs tar -cf project.tar -T -

This has been working fine, but I recently did some filename changes where only the case was changed of the starting letter - I thought this would be covered by the R flag in the filter definition; but when I exported the files I got all the files, but they still had their previous filenames.

Am I doing something wrong here!?

Edit: I just noticed I am also not getting new files either; so that's possibly also related to the changed filenames too?

Brett
  • 19,449
  • 54
  • 157
  • 290
  • Did you look at http://stackoverflow.com/questions/3368590/show-diff-between-commits ? – MikeJRamsey56 Feb 24 '17 at 17:52
  • @MikeJRamsey56 Yes, I believe if I remove the ` | xargs tar -cf project.tar -T - ` part at the end then I just get a diff output. – Brett Feb 24 '17 at 17:55
  • By default `git diff-tree` *does not* do rename detection, so you will never get any `R` files. But if you are working on a case-folding file system, file name `Foo` and file name `foo` are the same name anyway, so you get nothing at all. Note: If you are asking for a diff from newer to older, you get instructions on how to *un*-do things. An added file (from older to newer) will give you a *delete* instruction (to change newer to older), and your filter excludes `D`. – torek Feb 24 '17 at 20:18
  • Did you try option --find-renames[=] ? – MikeJRamsey56 Feb 24 '17 at 20:41
  • I have posted a new question as this one was getting a little out of order and I needed to explain things better: http://stackoverflow.com/questions/42458005/need-to-get-all-file-differences-added-modified-renamed-between-two-git-comi – Brett Feb 25 '17 at 15:39

0 Answers0