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

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

Download raw body.

Thread
On Sat, Mar 12, 2022 at 10:35:44AM +0100, Omar Polo wrote:
> 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.

That might change eventually. Renames are difficult but need to be
dealt with somehow. The current approach (do nothing) is simply the
easiest to implement :)

> 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
> 

You do not yet have to parse any of these headers. You could just treat
them as noise, for now.

Have you taken a look at Subversion's patch.c: choose_target_filename()?
That seems to be what your code is trying do achieve? If not, am I just
misunderstanding what problem you trying to solve?