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
Unknown Object (File)
Sun, Sep 13, 7:42 AM
Unknown Object (File)
Fri, Sep 11, 6:02 PM
Unknown Object (File)
Tue, Sep 8, 10:54 AM
Unknown Object (File)
Sat, Sep 5, 1:33 PM
Unknown Object (File)
Sat, Sep 5, 1:03 PM
Unknown Object (File)
Sat, Sep 5, 3:29 AM
Unknown Object (File)
Sat, Sep 5, 2:06 AM
Unknown Object (File)
Fri, Sep 4, 9:43 AM
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.