From: Phil Pennock Date: Wed, 18 Jan 2017 16:39:24 +0000 (-0500) Subject: Recording merge technique in git history X-Git-Tag: exim-4_89_RC1~40 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=585546e0a422f5fe172258c9054a7840697d9ec0;p=exim.git Recording merge technique in git history This is an empty commit which exists for this commit message, documenting how I handled GitHub PR 52, which was 228 separate commits, each fixing the spelling of one word. The submitter's approach made it easy to consider and approve/reject each independently, so was valuable, but I didn't want so many commits in our history. A few aspects of the shell commands rely upon Zsh: `read -q` for getting a single Y/N response; `$IFS` containing ASCII NUL (and builtins handling NUL inside strings) for parsing `.git/MERGE_RR`; anonymous function calls so that I could abort cleanly if I wanted to. git log --pretty=tformat:%h master..github/pr/52 > ../1.consider touch ../2.keep for F in $(<../1.consider); do git show $F | cat -v; read -q "keep?Keep $F ? " && echo $F >> ../2.keep; echo; echo =============================; done That let me iterate through each, selecting 214/228 commits to apply in one pass. Two PR commits were held for a separate commit, because they fixed behavioural bugs. So 216/228 were accepted. A couple warranted minor post-fixing as part of the first PR. for F in $(<../2.keep ) ; do (){ git cherry-pick -n $F && continue; for junk fn in $(<.git/MERGE_RR); do [[ -n $fn ]] || break; if vi $fn; then git add $fn; else return 1; fi; done } || break; done vi src/src/filter.c && git add src/src/filter.c vi src/src/dns.c && git add src/src/dns.c GIT_AUTHOR_NAME='Josh Soref' GIT_AUTHOR_EMAIL='jsoref@users.noreply.github.com' git commit and similarly for the second commit. One more commit from the PR requires chasing with a contributor whose name is natively in a non-Roman alphabet and who appears to have changed the Romanisation, to check how they'd like it handled. I will chase under separate cover. ---