From owner-dev-commits-doc-all@freebsd.org Sun Jun 20 15:49:18 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8805653279 for ; Sun, 20 Jun 2021 15:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7HCL2yT1z3nxC; Sun, 20 Jun 2021 15:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C18471F; Sun, 20 Jun 2021 15:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15KFnICW037948; Sun, 20 Jun 2021 15:49:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15KFnI96037947; Sun, 20 Jun 2021 15:49:18 GMT (envelope-from git) Date: Sun, 20 Jun 2021 15:49:18 GMT Message-Id: <202106201549.15KFnI96037947@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Warner Losh Subject: git: 4387bac4cd - main - committer-guide/git: Add what to do for pushing main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4387bac4cdff2c52b2b65166ea3e54ce1590aa14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2021 15:49:18 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/doc/commit/?id=4387bac4cdff2c52b2b65166ea3e54ce1590aa14 commit 4387bac4cdff2c52b2b65166ea3e54ce1590aa14 Author: Warner Losh AuthorDate: 2021-06-20 15:43:35 +0000 Commit: Warner Losh 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.