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

From:
"Omar Polo" <op@omarpolo.com>
Subject:
Re: fix stage -p vs. revert bug
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 13 Jul 2025 11:47:56 +0200

Download raw body.

Thread
Stefan Sperling <stsp@stsp.name> wrote:
> There is a bug where changes staged via stage -p disappear from the
> work tree during 'got revert'. This happens when revert runs on a file
> which has some changes staged while other changes in this file are not
> yet staged.
> 
> The patch below adds test coverages and fixes the bug. ok?

looks good to me; ok op@

> 
> 
> do not clobber changes staged via stage -p during 'got revert'
> 
> While we must install staged blob contents during revert if there are
> staged changes, the base blob ID recorded in the file index must always
> reflect the actual base blob from the base commit. Setting the base blob
> ID to that of a staged blob causes problems. The staged blob's ID is
> tracked in a separate field.
> 
> 
> M  TODO                       |    0+   1-
> M  lib/worktree.c             |   31+  10-
> M  regress/cmdline/revert.sh  |  209+   0-
> 
> 3 files changed, 240 insertions(+), 11 deletions(-)
> 
> commit - 2f46ecd27c3d285e0a82670ff8dc042db5e58d5d