Generate git diff from a list of commits -
given range of commits such as
b9dc80c commit msg 1 #530 88a4d3c commit 1010bce commit msg 2 #530 040ac6d commit msg 3 #530 6b72683 commit ed17416 commit f49bbbd commit msg 4 #530
i see diff of changes in commits #530
. far, have appropriate hashes in convinient format.
git log --oneline | grep #530 | awk -f" " '{print $1}' | xargs echo # b9dc80c 1010bce 040ac6d f49bbbd
can somehow "merge" these commits 1 diff? is, merge in memory, without affecting original repository. know can cherry pick commits in separate branch , diff that, complicated.
the use case want see changes ticket id specified.
example:
echo > file git add file && git commit "first" echo b > file git add file && git commit "second #xx" echo > file git add file && git commit "third #xx" the-special-command
with "diff" had in mind, "comparing" #xx
commits should give empty output rather 2 separate changes file
.
there 2 options:
- script merge-the-commits-to-temporary-branch dance.
- use
combinediff
command patchutils package.
edit: can simplify "log | grep" log --grep
, ask hashes --format
.
Comments
Post a Comment