Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2026 18:27:58 +0000
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b9ea73ceb35c - main - git-arc: Make git arc patch -r smarter
Message-ID:  <6a6a462e.3cfc9.1b0ff97d@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=b9ea73ceb35c54f46be558493537743784797f4d

commit b9ea73ceb35c54f46be558493537743784797f4d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-29 18:22:29 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-07-29 18:22:29 +0000

    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
---
 tools/tools/git/git-arc.sh | 10 +++++-----
 1 file 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()


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6a462e.3cfc9.1b0ff97d>