From nobody Thu Jul 30 17:16:24 2026 X-Original-To: dev-commits-src-all@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 4h9wpj5glXz6mhJr for ; Thu, 30 Jul 2026 17:16:29 +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 4h9wpj2tC7z43hG for ; Thu, 30 Jul 2026 17:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785431789; 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=X6uE6hezYa+45SSS2LOzWzOuETRPwVilR1N3p1CbsORwDRvFODKdpW5DXpFnC9grL7wG4U 5+8eF3yFnNCu/hbB9IRqMcZ8v8MjNkDPnzp3U9jCYq/tVa43/zpv9iHwe1dhkUapVPxMwe hz+0mTQTO74KlVmzVerrF6mkwiDTz6vGzDOABK75VLPiH27d3x5HcLsG+ugROkKClpoP1y SJSbTFEIV77q67bq8gMSj2u8gpH5J1dmtmbL9z1qd+sEioDyM7Y9uehkOSd+yugttrR9yP zDabPxUT435/j1Yxtvu+CAsO1XqRxeh8Gm722og6+dzukbGEm9S18Je5I67yzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785431789; a=rsa-sha256; cv=none; b=IxkOZ9Ackz9BLT1Ux9hmcykjlWeEyMCUTDJJAR6eDvUUEolBTasiZGHm7oyuY2AJwZFrNg r2dTYIwNaH5Lhso5FYiLjpled2QW4sufdKtK7DCNPAhnZCmrIacqmRlgvsptv/1RgUvIMn /BqJQkoVd4PikqO244NQwWBz4m/UGpXhSb6ziw3dpRyjufpCqN4Mjy4jXhT8ztsGQd/ypj Z0N23Uyk2zwaz0zryRYfzw/8da5qJVUlnkpDOHAqsB2w3k3FLRO3UGKrua+IgH6vazaMDW g8X3vmx50XcNrmkAC23U3I1IZk55GzeLpwZ/1ewquT8xc/tagcjAXihwnMxYpQ== 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=1785431789; 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=HUDzjs1Pvq7WQERveemfVZwqbulJOMOxkI0yq/s+3GidAzag4sVMzGiyznuJhMNf2vWIKI R8k3hMvHLGrplaMB0gzOfsBH6R+2YlDmZAASdZsxUrMcyL8cp6r16l935M+PZrh8N36kM9 ZacwLwXFbAKMKOcSvyv3VWgu4xK6gYOl9e9Yr18lR3HuvONPsL7lFccZv88zT8/QAjDarw tFC7451zrg+dr65ahKtcro/jmhqBD2gZxyiweykqKpQSF08GDKcv4icwenDBKtMbaYvWac Fd5k7F90pPhudaBo/6HSOQRxMYRHpPR9QLS9QohtMoL+SBVKSMhQUzhEM2w2SA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9wpj1jsJz6w4 for ; Thu, 30 Jul 2026 17:16:29 +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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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.