From nobody Thu Jul 30 17:16:24 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h9wpc397Dz6mhD9 for ; Thu, 30 Jul 2026 17:16:24 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h9wpc2PFKz446M for ; Thu, 30 Jul 2026 17:16:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785431784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zpm4dk3YBft8knrIJDE+vOgKqtdIRA66L39bJk/8gnA=; b=qzMDkj77VH7luyFKRsZ0pNzQiXWb7tkdiz84aPgW6kBhMIpxPr/iZghRbFjAWlujgNB5xi ccGEYWqU3DdohcUvGsLBOHFGMefkctQDDlIg7KMl0wM7oDHg1Gp98n2KADni/TXmcYC6hn MN2IWJxr+qKNEMdm/CwRs2lHzWEgt08bgEUGWp7Kus4rmInGdqwuAjLTDVjUKchnYvf6lz nZPtUOoEVkcXzMlrpLQLZmVHWFT+jlBMosHrI5mCsx0SgX1l3PDoJxWFbRYuk25a1ZGgSL ZEBTFwAl8X3B3Z6Oj7UXhm5M22hTU///7XW3xjvcSV4fL3z4fWA2urK1N6p7LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785431784; a=rsa-sha256; cv=none; b=dB3BrYWwtsLyx2dnz3Ur9ubiTqIgZwGNVe+SutF2z1CpeYeV4DNCIOUpVkPZwaf1d4fwFw CiUZgLQ01JSisVomITCW3F80166qudaOw4MpMoRrkiG94+Nqa2VcdDRiggzEC1/K6NC2ov yJPg8jXmhjooNapUHTSrvpXTE4+7Ltt2e24V02AaOd9/ah7UkDnkHZ9L+uzXfkF/yKu50G Irtjmz9HxIE8JmMaIAyPlJi9EefMMeQBDgZzKghr/nsVvQV9WA/7DVKw/7zWpRd1yF6E93 re9Jwdy/X4JZ1xhR+i4p0JP35INtYZ97rRM2nEE1fKNeaMvOcIYEKqZBYBVbcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785431784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zpm4dk3YBft8knrIJDE+vOgKqtdIRA66L39bJk/8gnA=; b=e+YaMy4qiDH1qPn8qTSPkY3+w6RPHMKLVvUbv625Pg9c4uE3nYPpwPwTTHfkDZaeATosd0 ESA4qppYxB+nJHcimNYavyCY7U68xs+3OTHaXSextOOvkqG2UXIJkJWg4S/eiB7mJljbGb OxQZg3xAVczhhhCAHOJW2WbGubUTlrT8pAaxhpeV/Jv2ZZrEHGwIRUNUrX0CZOr/LC8s4w CHlBadSTyQDgdGM2VOYRhuMM3glTp+RXItisKqH2UtP5S6EXKpwoevIgEt1qmjrjR1Nee8 xZKtSuuvosdXa6OtKjkjNHqqAb3qobcQ29/HOS0N8USXIO1KAy8Kk1SOavVB1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9wpc16Gdz6w2 for ; Thu, 30 Jul 2026 17:16:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a10c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Jul 2026 17:16:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a7677a680f21 - main - git-mfc: Add --abort and --continue flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7677a680f21e15bd67b29b0948538879320c451 Auto-Submitted: auto-generated Date: Thu, 30 Jul 2026 17:16:24 +0000 Message-Id: <6a6b86e8.3a10c.2d22bd5b@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a7677a680f21e15bd67b29b0948538879320c451 commit a7677a680f21e15bd67b29b0948538879320c451 Author: Mark Johnston AuthorDate: 2026-07-30 17:09:51 +0000 Commit: Mark Johnston CommitDate: 2026-07-30 17:09:51 +0000 git-mfc: Add --abort and --continue flags Instead of making the user run the underlying git-cherry-pick command after a conflict. Requested by: des Reviewed by: des Differential Revision: https://reviews.freebsd.org/D58514 --- tools/tools/git/git-mfc | 66 +++++++++++++++++++++++++++++++++-------------- tools/tools/git/git-mfc.1 | 24 +++++++++++++---- 2 files changed, 65 insertions(+), 25 deletions(-) diff --git a/tools/tools/git/git-mfc b/tools/tools/git/git-mfc index c6c4ea2b786a..4b1a9e15cc98 100755 --- a/tools/tools/git/git-mfc +++ b/tools/tools/git/git-mfc @@ -419,9 +419,8 @@ def cherry_pick(commits, edit=False): result = subprocess.run(cmd, capture_output=False) if result.returncode != 0: print("\nCherry-pick failed.", file=sys.stderr) - print("Resolve the conflict and run 'git cherry-pick --continue',", - file=sys.stderr) - print("or run 'git cherry-pick --abort' to give up.", file=sys.stderr) + print("Resolve the conflict and run 'git mfc --continue',", file=sys.stderr) + print("or run 'git mfc --abort' to give up.", file=sys.stderr) sys.exit(1) @@ -432,35 +431,38 @@ def main(): 'automatically including fixup commits.', ) parser.add_argument( - '-e', '--edit', action='store_true', - help='Edit the commit message before committing', + '--abort', action='store_true', + help='Abort a cherry-pick in progress', ) parser.add_argument( - '-n', action='store_true', - help='List the commits that would be cherry-picked, but do not act', + '--all', action='store_true', + help='With --pending/--dangling, show commits from all authors', ) parser.add_argument( '-a', '--author', type=str, default=None, help='Filter --pending/--dangling results by author (default: ignore author)', ) - parser.add_argument( - '--all', action='store_true', - help='With --pending/--dangling, show commits from all authors', - ) parser.add_argument( '--baking', action='store_true', - help='With --pending, also show commits whose MFC-after period ' - 'has not yet elapsed', + help='With --pending, also show commits whose MFC-after period has not yet elapsed', ) parser.add_argument( '-c', '--committer', type=str, default=None, help='Filter --pending/--dangling results by committer (default: current user)', ) + parser.add_argument( + '--continue', action='store_true', dest='continue_', + help='Continue cherry-picking after resolving a conflict', + ) parser.add_argument( '--dangling', action='store_true', help='Find cherry-picked commits in the current branch that are ' 'missing fixup commits from the origin branch', ) + parser.add_argument( + '-e', '--edit', action='store_true', + help='Edit the commit message before committing', + ) parser.add_argument( '-f', '--force', action='store_true', help='Cherry-pick commits even if they appear to be already present', @@ -469,6 +471,10 @@ def main(): '--ignore-reverts', action='store_true', help='Cherry-pick commits even if they were reverted upstream', ) + parser.add_argument( + '-n', action='store_true', + help='List the commits that would be cherry-picked, but do not act', + ) parser.add_argument( '--pending', action='store_true', help='Show upstream commits with MFC-after tags that are ready to ' @@ -488,11 +494,21 @@ def main(): ) args = parser.parse_args() - if args.dangling and args.pending: - err(1, 'usage error: --dangling and --pending are mutually exclusive') - if (args.dangling or args.pending) and len(args.commits) > 0: - err(1, 'usage error: revisions cannot be specified with --dangling or --pending') - if not args.dangling and not args.pending and len(args.commits) == 0: + mode = [] + if args.dangling: + mode.append('--dangling') + if args.pending: + mode.append('--pending') + if args.abort: + mode.append('--abort') + if args.continue_: + mode.append('--continue') + if len(mode) > 1: + err(1, 'usage error: only one of --dangling, --pending, --abort, ' + 'or --continue may be specified') + if len(mode) == 1 and len(args.commits) > 0: + err(1, f'usage error: revisions cannot be specified with {mode[0]}') + if len(mode) == 0 and len(args.commits) == 0: err(1, 'usage error: at least one revision is required') origin = args.origin if args.origin else origin_branch() @@ -509,13 +525,13 @@ def main(): upstream = remote + '/' + origin - if not args.n: + if not args.n and not args.abort and not args.continue_: repo.remotes[remote].fetch(origin) # Do we want to filter commits by author or committer? By default, use # the current git user's email to match the committer field. author = committer = None - if not getattr(args, 'all'): + if not args.all: user_email = repo.config_reader().get_value('user', 'email', default=None) if args.author: author = args.author @@ -547,6 +563,16 @@ def main(): else: status = f"ready on {date_str}" print(f'{commit_summary(commit)} ({status})') + elif args.abort: + result = subprocess.run(['git', 'cherry-pick', '--abort'], + capture_output=False) + if result.returncode != 0: + err(1, "failed to abort cherry-pick") + elif args.continue_: + result = subprocess.run(['git', 'cherry-pick', '--continue'], + capture_output=False) + if result.returncode != 0: + err(1, "failed to continue cherry-pick") else: tomfc, reverted = mfcclosure(repo, upstream, args.commits) diff --git a/tools/tools/git/git-mfc.1 b/tools/tools/git/git-mfc.1 index 9121c253f3a9..a79bb131cd2e 100644 --- a/tools/tools/git/git-mfc.1 +++ b/tools/tools/git/git-mfc.1 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd June 26, 2026 +.Dd July 28, 2026 .Dt GIT-MFC 1 .Os .Sh NAME @@ -31,6 +31,10 @@ .Op Fl -all .Op Fl -origin Ar branch .Op Fl r Ar remote +.Nm +.Fl -continue +.Nm +.Fl -abort .Sh DESCRIPTION The .Nm @@ -76,8 +80,10 @@ All commits are cherry-picked using a single .Xr git-cherry-pick 1 invocation. If a conflict occurs, resolve it and run -.Dq git cherry-pick --continue -to proceed with the remaining commits. +.Nm Fl -continue +to proceed with the remaining commits, or +.Nm Fl -abort +to give up. .It In .Fl -pending @@ -108,6 +114,8 @@ are considered. .Pp The following options are available: .Bl -tag -width "-a author" +.It Fl -abort +Abort a cherry-pick in progress. .It Fl a Ar author , Fl -author Ar author With .Fl -pending @@ -126,6 +134,8 @@ By default, the value of from .Xr git-config 1 is used. +.It Fl -continue +Continue cherry-picking after resolving a conflict. .It Fl -all With .Fl -pending @@ -136,7 +146,9 @@ show commits from all authors instead of only the current user. Find cherry-picked commits in the current branch that are missing fixup commits from the origin branch. Cannot be combined with -.Fl -pending +.Fl -pending , +.Fl -abort , +.Fl -continue , or revision arguments. .It Fl e , Fl -edit Open the commit message in an editor before committing each cherry-pick. @@ -178,7 +190,9 @@ Show upstream commits with .Dq MFC after: tags that are ready to be cherry-picked. Cannot be combined with -.Fl -dangling +.Fl -dangling , +.Fl -abort , +.Fl -continue , or revision arguments. .It Fl r Ar remote , Fl -remote Ar remote Specify the git remote to fetch from.