contrib: add "git-backport-merge" script for backporting merge commits in NetworkManager
On the main branch, we commonly rebase our WIP branches to latest HEAD, before merging them with "--no-ff". The effect is to have a merge commit that acts as a parentheses around the set of patches. When backporting such a branch, we should preserve that structure and take the merge commit too. We should must use `git cherry-pick -x` to record the commit IDs of the original patch. This script helps with that. Also hook it up in "contrib/scripts/nm-setup-git.sh" to create an alias for it. This alias has the advantage, of fetching the latest version of the script from "main" or "origin/main", so it also works on older branches.
This commit is contained in:
@@ -109,6 +109,7 @@ git_config_reset blame.markUnblamableLines true
|
||||
git_config_add notes.displayref 'refs/notes/bugs'
|
||||
git_config_add remote.origin.fetch 'refs/notes/bugs:refs/notes/bugs'
|
||||
git_config_reset remote.origin.pushurl 'git@gitlab.freedesktop.org:NetworkManager/NetworkManager.git'
|
||||
git_config_add 'alias.backport-merge' '! (git show main:contrib/scripts/git-backport-merge || git show origin/main:contrib/scripts/git-backport-merge) | bash -s -'
|
||||
|
||||
if [ "$NO_TEST" != 1 ]; then
|
||||
printf "Run with \"--no-test\" or see \"-h\"\n" >&2
|
||||
|
Reference in New Issue
Block a user