[RFH] Finding all commits that touch the same files as a specific commit
- From
- Sverre Rabbelier <alturin@gmail.com>
- Date
- Jul 12, 2008, 15:58 UTC
- Message-ID
- <bd6139dc0807120858vc058451lb10933b5225c8521@mail.gmail.com>
Heya,
Currently I do the following: $git diff-tree --name-status --no-commit-id -r <hash> To get all the files touched by the commit, I do: $git rev-list HEAD -- all the returned paths here This works perfectly, except when the subtree merge strategy is used, since in that case I get (example from git.git): $ git diff-tree --name-status --no-commit-id -r 5821988f97b827f6ba81dfeebff932067c88ba6c M git-gui.sh M lib/diff.tcl $ git rev-list HEAD -- git-gui.sh lib/diff.tcl $
Now it was noticed on #git that git log has a --follow argument which -does- catch the rename, but it only works on one file at a time. So, my question is this: How do I find all commits that touch the same files as a specific commit? I have described my current approach above, which does not work when the subtree merge strategy is used. I am not stuck to this approach though, if someone comes up with a better way to do this than with 'git diff-tree' / 'git rev-list' I'm fine by that. I provided with my current approach in the hope that someone comes up with a similar solution which means I'll have to edit less ;).
-- Cheers, Sverre Rabbelier