Page MenuHomeFreeBSD

D58129.id181707.diff
No OneTemporary

D58129.id181707.diff

diff --git a/tools/tools/git/git-mfc b/tools/tools/git/git-mfc
--- a/tools/tools/git/git-mfc
+++ b/tools/tools/git/git-mfc
@@ -360,17 +360,16 @@
return list(results.values())
-def cherry_pick(commit, edit=False):
- """Cherry-pick a single commit with -x. Abort on failure."""
+def cherry_pick(commits, edit=False):
+ """Cherry-pick a list of commits with -x. Abort on failure."""
cmd = ['git', 'cherry-pick', '-x', '-m1']
if edit:
cmd.append('-e')
- cmd.append(commit.hexsha)
+ cmd.extend([c.hexsha for c in commits])
result = subprocess.run(cmd, capture_output=False)
if result.returncode != 0:
- print(f"\nCherry-pick of {commit.hexsha} ({commit.summary}) failed.",
- file=sys.stderr)
- print("Resolve the conflict and then re-run git mfc to continue,",
+ 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)
sys.exit(1)
@@ -521,13 +520,16 @@
print(commit.hexsha, commit.summary)
return
+ topick = []
for commit in tomfc:
if commit.hexsha in already_picked:
print(f"Skipping {commit.hexsha[:12]} {commit.summary} "
f"(already cherry-picked)")
continue
print(f"Cherry-picking {commit.hexsha[:12]} {commit.summary}")
- cherry_pick(commit, edit=args.edit)
+ topick.append(commit)
+ if topick:
+ cherry_pick(topick, edit=args.edit)
if __name__ == '__main__':
diff --git a/tools/tools/git/git-mfc.1 b/tools/tools/git/git-mfc.1
--- a/tools/tools/git/git-mfc.1
+++ b/tools/tools/git/git-mfc.1
@@ -68,13 +68,16 @@
.Pp
Commits that have already been cherry-picked to the current branch are
automatically skipped.
-This allows the same
-.Nm
-command to be re-run after resolving a conflict without re-applying
-earlier commits.
Use
.Fl f
to override this behavior.
+.Pp
+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.
.It
In
.Fl -pending

File Metadata

Mime Type
text/plain
Expires
Tue, Jul 14, 3:39 AM (13 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35052934
Default Alt Text
D58129.id181707.diff (2 KB)

Event Timeline