Page MenuHomeFreeBSD

git-arc: Make git arc patch -r smarter
ClosedPublic

Authored by markj on Jul 29 2026, 1:39 PM.
Tags
None
Referenced Files
F174950323: D58532.diff
Wed, Oct 7, 3:51 AM
F174877712: D58532.diff
Tue, Oct 6, 5:37 PM
Unknown Object (File)
Sun, Oct 4, 4:59 AM
Unknown Object (File)
Sun, Sep 27, 1:53 PM
Unknown Object (File)
Sun, Sep 27, 1:51 PM
Unknown Object (File)
Sun, Sep 27, 1:50 PM
Unknown Object (File)
Sat, Sep 26, 5:28 PM
Unknown Object (File)
Wed, Sep 16, 8:17 PM
Subscribers

Details

Summary
  • 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jul 29 2026, 1:39 PM

Thanks, this works great for me. Sample output:

> git arc patch -c -r D57785
Applying D57785...
fetch: https://reviews.freebsd.org/D57785.diff: size of remote file is not known
/dev/stdout                                            613  B 9394  Bps    00s
Checking patch sys/kern/link_elf.c...
error: while searching for:
                   &resid, td);
               if (error != 0)
                       goto out;
               bzero(segbase + segs[i]->p_filesz,
                   segs[i]->p_memsz - segs[i]->p_filesz);
       }

       ef->dynamic = (Elf_Dyn *) (mapbase + phdyn->p_vaddr - base_vaddr);

error: patch failed: sys/kern/link_elf.c:1213
Applying patch sys/kern/link_elf.c with 1 reject...
Rejected hunk #1.
This revision is now accepted and ready to land.Jul 29 2026, 1:41 PM
This revision was automatically updated to reflect the committed changes.