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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: checkout -E and existing files
To:
Omar Polo <op@omarpolo.com>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Sat, 16 Sep 2023 13:26:48 +0200

Download raw body.

Thread
On Sat, Sep 16, 2023 at 01:00:05PM +0200, Omar Polo wrote:
> I was overly eager to optimize when I suggested to set {c,m}time to
> epoch in the fileindex when checking out over existing files because
> the usual (?) case would be to checkout over a previous checkout (or
> something that resembles it.)
>
> However, it seems easier to propagate the info upward from
> install_blob() rather than -E down from cmd_checkout().

This approach is fine with me.

> diff just to illustrate, still lacking a regress.

Tweaking test_checkout_into_nonempty_dir somehow to cover this code
path should be sufficieut.
 
> P.S. is the manpage wrong too by the way?  It says that the statuses
>      for checkout are A and E, no mention of ? is done.  Should we
>      return E for this case or add ? to the listing?

It should say 'E', and test_checkout_into_nonempty_dir checks for 'E'.

I am not sure why '?' shows up in naddy's test case. Could you try to
tweak the existing test such that '?' gets triggered and then fix the
implementation to say 'E' instead?