"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: two small fixes for got patch
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 12 Mar 2022 10:35:44 +0100

Download raw body.

Thread
Stefan Sperling <stsp@stsp.name> wrote:
> Why should differing paths be an error?

because it seemed like the simplest way to deal with the rename case,
given also that the rest of got doesn't treat the rename specially.

It also makes the parsing a little bit harder, consider the case of a
diff generated after "git mv foo bar":

| % git show 530e3dd
| diff --git a/foo b/bar
| similarity index 100%
| rename from foo
| rename to bar

(and since got patch can parse diffs produced by git -- even if there is
no test case for this atm -- it should be able to apply also such diffs)

I agree however that's an interesting feature to support and below is
what I've been hacking on since yesterday.  It doesn't handle the "pure
rename" diffs as generated by git but the parser can be tweaked in a
follow-up commit possibly.

Anyway, if possible, I'd like to commit the previous diff as is and
posticipate this for a bit: I have a few diff queued up that I think are
ready for review that would need to be edited if this went in.
Furthermore, I'd like to think about the rename case a bit more as I
don't really like the complexity added to apply_patch.