The command git show --pretty="format:" --name-status bd61ad98 will show a list of all the files modified/added/deleted in the last commit where bd61ad98 is the commit ID. The output looks like this:
[trusktr@rocketship express.git]$ git show --pretty="format:" --name-status bd61ad98
A test.txt
D test3.txt
M wp-atom.php
What about a command that shows the same information but for all the commits from the last push? FOr example, if a file was deleted (D), then re-added (A), then modified (M), the ideal status would be M for modified. In other words, the net effect is that the file was modified.
Is there any such command? Even if the command were to list the duplicate statuses for files, that’d be fine. I could write a script that can determine the net effect.
Perhaps there’s a way to compare diffs and output a list of files modified/deleted/added?
The reason I need such a file is that I’m making a script that will update another location using FTP based on this info.
You really want
git diff-tree; see my other answer to your other question, too. 🙂Edit for details:
will give you the changes (in the formats documented for git-diff-tree) made either between commit1 and (I think) its immediate parent (if commit2 is omitted), or between commit1 and commit2.
You can also give it an actual tree-ID but then you must give it both tree IDs since it will not be able to find the parent, e.g.:
(obviously the ID will vary).
If you have a branch name that refers to “what we last sent out”, e.g., branch
THEYHAVE, and you want to send them what’s on branchTESTED, you could do:and use the various letter codes and values in
$nhashand so on to extract the files (“git cat-file -p $nhash” will get you the contents of the file even in a--barerepo).(You can simplify this with
--name-statusfor your case, probably.)Once you have everything FTP-ed to where it should go, you can then use
git update-refto move the branch-label THEYHAVE to whatever the branch named TESTED names (it might be a good idea to usegit rev-parseonce to grab the ID of that branch “up front”, in case it moves while you’re doing all this work).