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

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: three bugs related to merge commits
To:
James Cook <falsifian@falsifian.org>, gameoftrees@openbsd.org
Date:
Mon, 17 Apr 2023 00:02:53 +1000

Download raw body.

Thread
On 23-04-16 10:43PM, Mark Jamsek wrote:
> On 23-04-16 10:40PM, Mark Jamsek wrote:
> > On 23-04-14 03:52PM, Stefan Sperling wrote:
> > > On Mon, Mar 13, 2023 at 12:01:42AM +0000, James Cook wrote:
> > > > I recently noticed the following bugs. I just verified that they still
> > > > happen with the lastest got, commit 264c43dd.
> > > > 
> > > > Two of them have scripts to reproduce; the other's pretty simple.
> > >  
> > > I would like to fix these issues but haven't found time to take
> > > a closer look yet, sorry.
> > 

In regards to the first two bugs, the second branch and merge commit
appear to be a red herring: simply committing to main in another work
tree has the same effect:

----8<------------
#!/bin/sh -e

mkdir gotdebug
cd gotdebug

# create repo with file f
gotadmin init r.git
mkdir import
touch import/f
got import -m first -r r.git import

# checkout two work trees: wt1 and wt2
for wt in wt1 wt2; do
	got checkout r.git $wt
done

# add and commit file g in wt2
cd wt2
echo g > g
got add g
got commit -m "add g in wt2"
gcommit=$(cd ../r.git && git show --no-patch --pretty='format:%H')

# back in wt1, edit file f and commit the change without 'got update'
cd ../wt1
echo f > f
got commit -m f

echo "commit $gcommit 'add g in wt2' is gone"
echo "but the file it committed is now part of the last commit from wt1"
------------>8----

-- 
Mark Jamsek <fnc.bsdbox.org|got.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68