1

After doing extensive modifications, I'd like to run a validation script to ensure the changes are correct: the changes are not quite trivial to perform mechanically, but are very easy to check.

To do that, I'd like the validation script to be called once per file modified, with the original & modified files as input. git show $REV:$PATH can probably get partway there (assuming no renames), but I wonder if there's something built in or easily accessible without "brute-forcing" it.

Masklinn
  • 34,759
  • 3
  • 38
  • 57

1 Answers1

0

A git show commit_id --name-only will list the files part of a commit.

That means, for each file, you can retrieve a single file from a specific revision in Git.

You mentioned:

 git show $REV:$PATH

For the same path:

git show $REV~1:$PATH

That will give you the original content, before the (committed) modification

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250