aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-07-29 18:22:29 +0000
committerMark Johnston <markj@FreeBSD.org>2026-07-29 18:22:29 +0000
commitb9ea73ceb35c54f46be558493537743784797f4d (patch)
treeb531e51ee1906f6e90ea5ec5b57c5abffd68114f
parentd8bcb13b79b4aa6156b852a0da04ca9f52c63ac0 (diff)
git-arc: Make git arc patch -r smarter
- Make it work even when git arc isn't run from the root of the repo. - If the patch fails to apply, let git partially apply the patch and generate rej files for inspection. While here, remove the return value from apply_rev(), it's never actually used. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D58532
-rwxr-xr-xtools/tools/git/git-arc.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index f2a325f3452a..72605d49d40f 100755
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -609,14 +609,15 @@ apply_rev()
parents=$(diff2parents "$rev")
for parent in $parents; do
echo "Applying parent ${parent}..."
- if ! apply_rev $parent $commit $raw $stack; then
- return 1
- fi
+ apply_rev $parent $commit $raw $stack
done
fi
+ # If a patch fails to apply, the corresponding command below will exit
+ # with a non-zero status and terminate the script.
if $raw; then
- fetch -o /dev/stdout "https://reviews.freebsd.org/${rev}.diff" | git apply --index
+ fetch -o /dev/stdout "https://reviews.freebsd.org/${rev}.diff" | \
+ git -C "$(git rev-parse --show-toplevel)" apply --index --reject
else
arc patch --skip-dependencies --nobranch --nocommit --force $rev
fi
@@ -624,7 +625,6 @@ apply_rev()
if ${commit}; then
patch_commit $rev
fi
- return 0
}
gitarc__patch()