diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-07-29 18:22:29 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-07-29 18:22:29 +0000 |
| commit | b9ea73ceb35c54f46be558493537743784797f4d (patch) | |
| tree | b531e51ee1906f6e90ea5ec5b57c5abffd68114f | |
| parent | d8bcb13b79b4aa6156b852a0da04ca9f52c63ac0 (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-x | tools/tools/git/git-arc.sh | 10 |
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() |
