Repository : ssh://git@diktynna/doc
On branches: backup-redmine/2023-01-14,main
commit 6237b61f8f7d4271f13512137cce6287b6bc63ae Author: Sven Eckelmann sven@narfation.org Date: Sat Dec 17 13:26:33 2022 +0000
doc: batman-adv/SubmittingLinux: switch to non-controversy git branch names
6237b61f8f7d4271f13512137cce6287b6bc63ae batman-adv/SubmittingLinux.textile | 104 ++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 52 deletions(-)
diff --git a/batman-adv/SubmittingLinux.textile b/batman-adv/SubmittingLinux.textile index 2fca888f..b41318b3 100644 --- a/batman-adv/SubmittingLinux.textile +++ b/batman-adv/SubmittingLinux.textile @@ -8,7 +8,7 @@ We currently submit patches for Linux from our next branch. I try to give a shor Following steps must always be done:
* get the linux-integration + batman-adv repository -* get the newest patches from next and maint +* get the newest patches from main and stable * check for compat code * squash/cleanup patches * fix "Fixes: " and other commit id references @@ -27,10 +27,10 @@ Following steps must always be done:
h2. Rules for patch handling
-* new patches enter batman-adv.git master branch -* new patches are forwarded to David from master branch -* master branch is closed whenever net-next is closed -* new patches for master should be avoided when Linux -rc7/final is near (which will cause the closing of net-next) +* new patches enter batman-adv.git main branch +* new patches are forwarded to David from main branch +* main branch is closed whenever net-next is closed +* new patches for main should be avoided when Linux -rc7/final is near (which will cause the closing of net-next)
h2. Variables
@@ -38,9 +38,9 @@ There are different basepoints/references used when preparing the
* GIT_OM_SERVER ** server from which the open-mesh.org repositories are retrieved -* LM_MASTER +* LM_MAIN ** name of branch in batman-adv.git which points to the latest patch already ported to linux-merge.git:batadv/net-next -* LM_MAINT +* LM_STABLE ** name of branch in batman-adv.git which points to the latest patch already ported to linux-merge.git:batadv/net * BASE_NETNEXT ** some recent commit in net-next.git which should be used as base commit for the patches which will be applied (chose wisely) @@ -49,8 +49,8 @@ There are different basepoints/references used when preparing the
<pre> GIT_OM_SERVER="git+ssh://git@open-mesh.org" -LM_MASTER=ecsv/lm_master -LM_MAINT=ecsv/lm_maint +LM_MAIN=ecsv/lm_main +LM_STABLE=ecsv/lm_stable BASE_NETNEXT=v4.16-rc1 BASE_NET=v4.16-rc1 </pre> @@ -69,16 +69,16 @@ git -C linux-merge branch base/net-next --track origin/base/net-next git -C linux-merge branch batadv/net --track origin/batadv/net git -C linux-merge branch batadv/net-next --track origin/batadv/net-next git clone "${GIT_OM_SERVER}/batman-adv.git" batman-adv -git -C batman-adv branch "${LM_MASTER}" --track "origin/${LM_MASTER}" -git -C batman-adv branch "${LM_MAINT}" --track "origin/${LM_MAINT}" +git -C batman-adv branch "${LM_MAIN}" --track "origin/${LM_MAIN}" +git -C batman-adv branch "${LM_STABLE}" --track "origin/${LM_STABLE}" </pre>
The next step is to make sure that out linux-merge.git branches are either on top or equal the chosen. It should also be checked first that it is really a basepoint in the chosen branches
<pre> git -C linux-merge remote update --prune -git -C linux-merge branch -r --contains="${BASE_NET}" net/master -git -C linux-merge branch -r --contains="${BASE_NETNEXT}" net-next/master +git -C linux-merge branch -r --contains="${BASE_NET}" net/main +git -C linux-merge branch -r --contains="${BASE_NETNEXT}" net-next/main
git -C linux-merge switch base/net git -C linux-merge merge --ff-only "origin/base/net" @@ -93,27 +93,27 @@ git -C linux-merge push origin base/net base/net-next
Problems during this have to either be fixed by using a correct base commit, fixing the local branches or by rebasing the remaining patches on the batadv/* branches on top of the base commits (think twice before rebasing).
-The same has to be done for the batman-adv repository. Here it is is important to update the maint branch manually after releases. Otherwise it would look like patches which were already submitted to net-next have to be send again to net. But make sure that there are no actual fixes between ${LM_MAINT} and origin/maint which were missed earlier +The same has to be done for the batman-adv repository. Here it is is important to update the stable branch manually after releases. Otherwise it would look like patches which were already submitted to net-next have to be send again to net. But make sure that there are no actual fixes between ${LM_STABLE} and origin/stable which were missed earlier
<pre> git -C batman-adv remote update --prune
-git -C batman-adv switch "${LM_MAINT}" -git -C batman-adv merge --ff-only "origin/${LM_MAINT}" +git -C batman-adv switch "${LM_STABLE}" +git -C batman-adv merge --ff-only "origin/${LM_STABLE}"
-git -C batman-adv switch "${LM_MASTER}" -git -C batman-adv merge --ff-only "origin/${LM_MASTER}" +git -C batman-adv switch "${LM_MAIN}" +git -C batman-adv merge --ff-only "origin/${LM_MAIN}" </pre>
h2. get the newest patches
-h3. from master +h3. from main
<pre> cd batman-adv -git switch -C rebase --no-track origin/master -GIT_SEQUENCE_EDITOR="sh -c 'git rev-list --reverse --no-merges '\''${LM_MASTER}..origin/master'\'' --not origin/maint|awk '\''{ print "pick "$1}'\'' > $1' $@" \ - git rebase -i origin/maint --onto "${LM_MASTER}" --no-ff +git switch -C rebase --no-track origin/main +GIT_SEQUENCE_EDITOR="sh -c 'git rev-list --reverse --no-merges '\''${LM_MAIN}..origin/main'\'' --not origin/stable|awk '\''{ print "pick "$1}'\'' > $1' $@" \ + git rebase -i origin/stable --onto "${LM_MAIN}" --no-ff </pre>
This patches have to be cleaned up. First these these changes have to be squashed so that "Fixes: " patches are squashed together with the patches which introduced the problem (when they exist). Also compat code has to be removed. Both things can be identified with git log: @@ -121,20 +121,20 @@ This patches have to be cleaned up. First these these changes have to be squashe Patches with "Fixes: " lines:
<pre> -git log --grep='^Fixes: ' "${LM_MASTER}"..rebase +git log --grep='^Fixes: ' "${LM_MAIN}"..rebase </pre>
The extra stuff which should not be submitted can be identified via:
<pre> -git log --stat --oneline "${LM_MASTER}"..rebase -- compat-sources compat-include README.external CHANGELOG Makefile .gitignore .gitattributes compat.h gen-compat-autoconf.sh README -git log -p -SUGLY_HACK "${LM_MASTER}"..rebase +git log --stat --oneline "${LM_MAIN}"..rebase -- compat-sources compat-include README.external CHANGELOG Makefile .gitignore .gitattributes compat.h gen-compat-autoconf.sh README +git log -p -SUGLY_HACK "${LM_MAIN}"..rebase </pre>
This can all be cleaned up by using git-rebase and then marking the relevant commits for editing. It may also be a good idea to move patches like "Start-new-development-cycle" to the front
<pre> -git rebase -i "${LM_MASTER}" +git rebase -i "${LM_MAIN}"
# edit the commit message to point to the correct upstream commit -- just search in linux-merge for the commit name git commit --amend @@ -152,30 +152,30 @@ git rebase --continue It is a good idea to check again if some file was missed. It is also a good idea to manually check the commit messages for other commit references:
<pre> -git log --stat "${LM_MASTER}"..rebase +git log --stat "${LM_MAIN}"..rebase </pre>
If everything looks good then these patches should be formatted (make sure that you don't have some old patches in the directory). The branch of already prepared patches has to be updated
<pre> -git format-patch -s "${LM_MASTER}"..rebase -git switch "${LM_MASTER}" -git merge --ff-only origin/master -git push origin "${LM_MASTER}" +git format-patch -s "${LM_MAIN}"..rebase +git switch "${LM_MAIN}" +git merge --ff-only origin/main +git push origin "${LM_MAIN}" </pre>
-Save the generated patches to a save place. Lets call this place $EXPORTED_PATCHES_MASTER +Save the generated patches to a save place. Lets call this place $EXPORTED_PATCHES_MAIN
-h3. from maint +h3. from stable
-Make sure that ${LM_MASTER} was updated after a release correctly and ${LM_MASTER}..origin/maint is containing patches which were send to net-next +Make sure that ${LM_MAIN} was updated after a release correctly and ${LM_MAIN}..origin/stable is containing patches which were send to net-next
The rest of the rebase process works similar to the next process
<pre> cd batman-adv -git switch -C rebase --no-track origin/maint -git rebase -i "${LM_MAINT}" +git switch -C rebase --no-track origin/stable +git rebase -i "${LM_STABLE}" </pre>
This patches have to be cleaned up. First these these changes have to be squashed so that "Fixes: " patches are squashed together with the patches which introduced the problem (when they exist). Also compat code has to be removed. Both things can be identified with git log: @@ -183,20 +183,20 @@ This patches have to be cleaned up. First these these changes have to be squashe Patches with "Fixes: " lines:
<pre> -git log --grep='^Fixes: ' "${LM_MAINT}"..rebase +git log --grep='^Fixes: ' "${LM_STABLE}"..rebase </pre>
The extra stuff which should not be submitted can be identified via:
<pre> -git log --stat --oneline "${LM_MAINT}"..rebase -- compat-sources compat-include README.external CHANGELOG Makefile .gitignore .gitattributes compat.h gen-compat-autoconf.sh README -git log -p -SUGLY_HACK "${LM_MAINT}"..rebase +git log --stat --oneline "${LM_STABLE}"..rebase -- compat-sources compat-include README.external CHANGELOG Makefile .gitignore .gitattributes compat.h gen-compat-autoconf.sh README +git log -p -SUGLY_HACK "${LM_STABLE}"..rebase </pre>
This can all be cleaned up by using git-rebase and then marking the relevant commits for editing. It may also be a good idea to move patches like "Start-new-development-cycle" to the front
<pre> -git rebase -i "${LM_MAINT}" +git rebase -i "${LM_STABLE}"
# edit the commit message to point to the correct upstream commit -- just search in linux-merge for the commit name git commit --amend @@ -214,23 +214,23 @@ git rebase --continue It is a good idea to check again if some file was missed. It is also a good idea to manually check the commit messages for other commit references or missing signed-off-by:
<pre> -git log --stat "${LM_MAINT}"..rebase +git log --stat "${LM_STABLE}"..rebase </pre>
If everything looks good then these patches should be formatted (make sure that you don't have some old patches in the directory). The branch of already prepared patches has to be updated
<pre> -git format-patch -s "${LM_MAINT}"..rebase -git switch "${LM_MAINT}" -git merge --ff-only origin/maint -git push origin "${LM_MAINT}" +git format-patch -s "${LM_STABLE}"..rebase +git switch "${LM_STABLE}" +git merge --ff-only origin/stable +git push origin "${LM_STABLE}" </pre>
-Save the generated patches to a save place. Lets call this place $EXPORTED_PATCHES_MAINT +Save the generated patches to a save place. Lets call this place $EXPORTED_PATCHES_STABLE
h2. Apply patches on linux-merge
-h3. from master +h3. from main
The patches were already exported. So they only have to be applied in the correct branch
@@ -238,12 +238,12 @@ The patches were already exported. So they only have to be applied in the correc cd linux-merge git switch batadv/net-next git merge --ff-only origin/batadv/net-next -./scripts/checkpatch --strict "${EXPORTED_PATCHES_MASTER}"/*.patch -git am -s "${EXPORTED_PATCHES_MASTER}"/*.patch +./scripts/checkpatch --strict "${EXPORTED_PATCHES_MAIN}"/*.patch +git am -s "${EXPORTED_PATCHES_MAIN}"/*.patch git push origin batadv/net-next </pre>
-h3. from maint +h3. from stable
The patches were already exported. So they only have to be applied in the correct branch
@@ -251,8 +251,8 @@ The patches were already exported. So they only have to be applied in the correc cd linux-merge git switch batadv/net git merge --ff-only origin/batadv/net -./scripts/checkpatch --strict "${EXPORTED_PATCHES_MAINT}"/*.patch -git am -s "${EXPORTED_PATCHES_MAINT}"/*.patch +./scripts/checkpatch --strict "${EXPORTED_PATCHES_STABLE}"/*.patch +git am -s "${EXPORTED_PATCHES_STABLE}"/*.patch git push origin batadv/net </pre>