Date: Sun, 20 Jun 2021 15:49:18 GMT From: Warner Losh <imp@FreeBSD.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org Subject: git: 4387bac4cd - main - committer-guide/git: Add what to do for pushing main Message-ID: <202106201549.15KFnI96037947@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/doc/commit/?id=4387bac4cdff2c52b2b65166ea3e54ce1590aa14 commit 4387bac4cdff2c52b2b65166ea3e54ce1590aa14 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-06-20 15:43:35 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-06-20 15:47:18 +0000 committer-guide/git: Add what to do for pushing main git arc stage lands commits on main. Some people think it's more natural to put changes on main and push that. Document how to do that as an alternative to the somewhat safer way of rebasing a branch and pushing that branch otno main. Also add tags to these sections so we (I?) can reference them easily when people ask. Sponsored by: Netflix --- .../en/articles/committers-guide/_index.adoc | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/documentation/content/en/articles/committers-guide/_index.adoc b/documentation/content/en/articles/committers-guide/_index.adoc index 1d1d3df923..444aec401b 100644 --- a/documentation/content/en/articles/committers-guide/_index.adoc +++ b/documentation/content/en/articles/committers-guide/_index.adoc @@ -1705,6 +1705,7 @@ Everything should just apply. If not, then you'll need to resolve the diffs. https://docs.github.com/en/free-pro-team@latest/github/using-git/resolving-merge-conflicts-after-a-git-rebase[This github document] can help you navigate this process. +[[git-push-upstream]] ===== Time to push changes upstream First, ensure that the push URL is properly configured for the upstream repository. @@ -1726,8 +1727,10 @@ freefall% gen-gitconfig.sh on freefall.freebsd.org to get a recipe that you can use directly, assuming /usr/local/bin is in the PATH. -The below command merges the 'working' branch into the upstream main line. +The below command merges the `working` branch into the upstream main line. It's important that you curate your changes to be just like you want them in the FreeBSD source repo before doing this. +This syntax pushes the `working` branch to main, moving the `main` branch forward. +You will only be able to do this if this results in a linear change to `main1 (eg no merges). [source,shell] .... @@ -1744,6 +1747,28 @@ If your push is rejected due to losing a commit race, rebase your branch before % git push freebsd working:main .... +[[git-push-upstream-alt]] +===== Time to push changes upstream (alternative) + +Some people find it easier to merge their changes to their local `main` before pushing to the remote repository. +Also, `git arc stage` moves changes from a branch to the local `main` when you need to do a subset of a branch. +The instructions are similar to the prior section: +[source,shell] +.... +% git checkout main +% git merge --ff-only `working` +% git push freebsd +.... + +If you lose the race, then try again with +[source,shell] +.... +% git pull --rebase +% git push freebsd +.... +These commands will fetch the most recent `freebse/main` and then rebase the local `main` changes on top of that, which is what you want when you lose the commit race. +Note: merging vendor branch commits will not work with this technique. + ===== Finding the Subversion Revision You'll need to make sure that you've fetched the notes (see the `No staged changes migration` section above for details.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106201549.15KFnI96037947>