From: Michael Meffie Date: Mon, 14 Oct 2019 17:42:23 +0000 (-0400) Subject: Add git-gerrit examples on backporting page X-Git-Url: http://git.openafs.org/?p=openafs-wiki.git;a=commitdiff_plain;h=b6de40806a8f6e1972c05d9643b5272f5e6b78de Add git-gerrit examples on backporting page --- diff --git a/devel/Backporting.mdwn b/devel/Backporting.mdwn index 9754e3f..d261afd 100644 --- a/devel/Backporting.mdwn +++ b/devel/Backporting.mdwn @@ -18,6 +18,9 @@ Note that unlike most git based projects, OpenAFS developers have adopted a linear commit history. Merge commits are generally avoided, and developers generally run git rebase frequently before submitting changes to gerrit. +An optional set of wrapper scripts called [[GitGerrit]] are available to search +gerrit from command line, fetch commits by the legacy gerrit number, and to +assist in cherry picking commits to stable branches. Master branch inclusion ----------------------- @@ -48,9 +51,23 @@ Example: git fetch origin git checkout origin/openafs-stable-1_8_x git cherry-pick -e -x origin/master~ + + git commit --amend + git show + -Alternatively, you can run `git commit --amend` immediately after each -cherry-pick to remove rhe Change-ID. +Run `git commit --amend` immediately after each cherry-pick to verify the +cherry-pick command has a new Change-ID. + +Alternately, the [[GitGerrit]] git-gerrit-cherry-pick tool can be used to +cherry pick by gerrit number and will automatically update the Change-Id +in the commit message: + +Example: + + git fetch origin + git checkout origin/openafs-stable-1_8_x + git gerrit-cherry-pick In the event the cherry-pick fails, due to code skew between the branches, it may be necessary to manually fix the merge conflict and run `git cherry-pick --continue` @@ -78,6 +95,12 @@ Example: git checkout origin/openafs-stable-1_6_x git cherry-pick -e -x origin/openafs-stable-1_8_x~ +Example with [[GitGerrit]]: + + git fetch origin + git checkout origin/openafs-stable-1_6_x + git gerrit-cherry-pick --branch origin/openafs-stable-1_8_x + In the event the cherry-pick fails, due to code skew between the branches, it may be necessary to manually fix the merge conflict and run `git check-pick --continue` to complete the cherry pick. In this case, the `(cherry picked from commit...)`