From nobody Fri Jul 10 14:46:43 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 4gxZR74BvPz6lFMD for ; Fri, 10 Jul 2026 14:46:43 +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 4gxZR72t2dz3w80 for ; Fri, 10 Jul 2026 14:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783694803; 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=HdwuGdCEA6fhb3QsmFiZXKciGwxYED56iy/mzc1by4Y=; b=rjXKIdNQLFvfHz5+tkyH20TJZL8Mg0s0X1kkGOyeVQU85Xo8PiAhy8D1UufrIgZ+nwEabl KSM+T4hlewNVXqIGgu+ZPQqls3u4ghpoiXaIK7fC3Mr/nSxWz0EgGqEjwpxp7nu1Hkivlz QyXQXxEQWQrurggb1/ZE4+qYIcsC9/R++jR6RrrsTP1sxoPun1q/v/zn2GGQcBpht97f2o qWLW7t7BCpPcUePRHCwnGYBazftx9hP/0Lx8FxPuUo1cWsM6bdiRol3DbOhJ+LKpSSZX7V 6DYQdU/eWRWPjZyrLpaSxL6jrMSgWs5YX2ESBObDRWvq0/n0DBggoFPge8iHvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783694803; a=rsa-sha256; cv=none; b=x22YKXRdWEHAkUcW7eihsqF+DucCbNhyB0I402dvUdmWeiuikfzc16QAHihgNEXzLWjNDv 3+DZo+HbmDj9LZLqFEtd08xX9eJeOimXjBNfIH54yiJ6PGVgpGgjCz/w04zDvwTjHdeK0s 0tLqPToiPADvESz6keQOl/e0K2lpV16xEK+cYTx0gxLhFM0MHa7Y7Rso+Ph19U2pr7H5+b UB6JhGaG1SfXn728ic36//SWneQVT8+35uz1zBqAt7rz+qTl3RSCJM/WQdIIlnLGvrpNph vF66sGp/K2KuYPwoEn2K1oyi3tPGhR3PyyVnqydBCHC1Usv3lOxRouqbvnYYcg== 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=1783694803; 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=HdwuGdCEA6fhb3QsmFiZXKciGwxYED56iy/mzc1by4Y=; b=I+2cMVzTkPBmHK5STqCAo6bm2DpIZeLp7fUd8vHAuITJJ7sWwa2n48pzW3PhU3R413gqJ4 r3uFJ09zYfVBZKqDyKcTlp2Xf15CBp3XRVd3btplzlWhHWB5GvQVgh7sqPPvOrS6zfWwzD fzrdG/iBAdfutEibWY7g0nKpyN/xArgyxGBi+DzMCjKKrIEUu8rVcI/rT8iuRLX97HiETR 0hSqjkD6GLqs5qIxpoIPPfeAjriZVMkTjjLaNpJu9cYzFVsoY8Z585ulVbjaVp1NUwvtSh spllU+na1OA0yyLUSUdlMu8TImJzhoTMqxEIcWDLOgRKFjUG6OZ4NIb0UopL1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gxZR70wG4z1067 for ; Fri, 10 Jul 2026 14:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2738c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 10 Jul 2026 14:46:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1f091ad283e9 - main - git-mfc: Filter pending and dangling commits by committer 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: 1f091ad283e9e9815f568d6fdf2b58d1e75f02b3 Auto-Submitted: auto-generated Date: Fri, 10 Jul 2026 14:46:43 +0000 Message-Id: <6a5105d3.2738c.210dbc97@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1f091ad283e9e9815f568d6fdf2b58d1e75f02b3 commit 1f091ad283e9e9815f568d6fdf2b58d1e75f02b3 Author: Mark Johnston AuthorDate: 2026-07-10 14:44:09 +0000 Commit: Mark Johnston CommitDate: 2026-07-10 14:44:09 +0000 git-mfc: Filter pending and dangling commits by committer Previously we searched commits based on the author email address, but this isn't really right: if I commit something from a contributor, I'm still responsible for MFCing it, so really we should be filtering on the committer. Add a new --committer option to filter results by committer email address, defaulting to the user.email value in the git config. Keep the --author option, but don't filter by author unless the option is explicitly specified. Reported by: des Reviewed by: des Differential Revision: https://reviews.freebsd.org/D58126 --- tools/tools/git/git-mfc | 49 +++++++++++++++++++++++++++++------------------ tools/tools/git/git-mfc.1 | 13 +++++++++++-- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/tools/tools/git/git-mfc b/tools/tools/git/git-mfc index c3ff474add3e..513a7f150e3c 100755 --- a/tools/tools/git/git-mfc +++ b/tools/tools/git/git-mfc @@ -31,6 +31,11 @@ def commit_summary(commit): return f'{commit.hexsha} ("{commit.summary}")' +def commit_match(commit, author, committer): + return (author is None or author in commit.author.email) and \ + (committer is None or committer in commit.committer.email) + + def origin_branch(): """ Determine the default origin branch by parsing sys/conf/newvers.sh. @@ -245,7 +250,7 @@ def mfc_origins(repo, commit, warn=False): return origins -def dangling(repo, upstream, author=None): +def dangling(repo, upstream, author=None, committer=None): """ Find commits in the current branch which have been cherry-picked from upstream but are missing fixup commits. @@ -258,7 +263,7 @@ def dangling(repo, upstream, author=None): refs = mfc_origins(repo, commit, warn=True) for ref in refs: picked.append(ref.hexsha) - if author is None or author in commit.author.email: + if commit_match(ref, author, committer): mine.append(ref.hexsha) # Create a mapping of all upstream commits to their fixups, # tracking reverts as we go. @@ -301,7 +306,7 @@ def mfc_after(commit): return None -def pending(repo, upstream, author=None, baking=False): +def pending(repo, upstream, author=None, committer=None, baking=False): """ Find commits in the upstream branch that have an "MFC after:" tag, whose waiting period has elapsed, and which have not been cherry-picked to the @@ -339,8 +344,7 @@ def pending(repo, upstream, author=None, baking=False): # Not yet eligible for MFC. continue - if author is not None and author not in commit.author.email: - # Don't report commits that don't match the requested author. + if not commit_match(commit, author, committer): continue committed = datetime.datetime.fromtimestamp( @@ -388,7 +392,7 @@ def main(): ) parser.add_argument( '-a', '--author', type=str, default=None, - help='Filter --pending/--dangling results by author (default: current user)', + help='Filter --pending/--dangling results by author (default: ignore author)', ) parser.add_argument( '--all', action='store_true', @@ -399,6 +403,10 @@ def main(): 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( '--dangling', action='store_true', help='Find cherry-picked commits in the current branch that are ' @@ -455,24 +463,27 @@ def main(): if not args.n: repo.remotes[remote].fetch(origin) - show_all = getattr(args, 'all') - if show_all: - author = None - elif args.author: - author = args.author - elif args.dangling or args.pending: - author = repo.config_reader().get_value('user', 'email', default=None) - if author is None: - err(1, "could not determine user email; use -a or --all") - else: - author = None + # 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'): + user_email = repo.config_reader().get_value('user', 'email', default=None) + if args.author: + author = args.author + + if args.committer: + committer = args.committer + else: + committer = user_email + if committer is None: + err(1, "could not determine user email; use -c or --all") if args.dangling: - missing = dangling(repo, upstream, author=author) + missing = dangling(repo, upstream, author=author, committer=committer) for fixup, commit in missing: print(f'{commit_summary(fixup)} fixes {commit_summary(commit)}') elif args.pending: - results = pending(repo, upstream, author=author, + results = pending(repo, upstream, author=author, committer=committer, baking=args.baking) for commit, ready_date, ready in results: date_str = ready_date.strftime('%Y-%m-%d') diff --git a/tools/tools/git/git-mfc.1 b/tools/tools/git/git-mfc.1 index acd27ef3cbcb..a730eae7ee6b 100644 --- a/tools/tools/git/git-mfc.1 +++ b/tools/tools/git/git-mfc.1 @@ -19,6 +19,7 @@ .Nm .Fl -pending .Op Fl a Ar author +.Op Fl c Ar committer .Op Fl -all .Op Fl -baking .Op Fl -origin Ar branch @@ -26,6 +27,7 @@ .Nm .Fl -dangling .Op Fl a Ar author +.Op Fl c Ar committer .Op Fl -all .Op Fl -origin Ar branch .Op Fl r Ar remote @@ -84,7 +86,7 @@ scans the origin branch for commits with tags whose waiting period has elapsed and which have not already been cherry-picked to the current branch. Commits that have been reverted upstream are excluded. -By default, only commits authored by the current user +By default, only commits committed by the current user .Pq as determined by Xr git-config 1 are shown. .It @@ -96,7 +98,7 @@ Instead, finds commits in the current branch that have been cherry-picked from the origin branch but are missing associated fixup commits. Fixup commits that have been reverted upstream are excluded. -By default, only cherry-picks authored by the current user +By default, only cherry-picks committed by the current user .Pq as determined by Xr git-config 1 are considered. .El @@ -109,6 +111,13 @@ With or .Fl -dangling , filter results to commits whose author email contains the given string. +By default, the author field of commits is ignored. +.It Fl c Ar committer , Fl -committer Ar committer +With +.Fl -pending +or +.Fl -dangling , +filter results to commits whose committer email contains the given string. By default, the value of .Va user.email from