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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Force push fails
To:
Chris Narkiewicz <hello@ezaquarii.com>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 25 Aug 2023 09:56:32 +0200

Download raw body.

Thread
On Fri, Aug 25, 2023 at 01:39:12AM +0100, Chris Narkiewicz wrote:
> I'm trying to force-push something using vanilla git. I did some git rebase -i
> to drop unwanted work and I try to push it to origin:
> 
> [tn@ross154]~/Devel/project% git push origin main        
> To ssh://dev.int.etacassiopeiae.net/project
>  ! [rejected]        main -> main (non-fast-forward)
> error: failed to push some refs to 'ssh://dev.int.etacassiopeiae.net/project'
> hint: Updates were rejected because the tip of your current branch is behind
> hint: its remote counterpart. Integrate the remote changes (e.g.
> hint: 'git pull ...') before pushing again.
> hint: See the 'Note about fast-forwards' in 'git push --help' for details.
> 
> So far so good, this is expected. Now, I'm trying to force:
> 
> [tn@ross154]~/Devel/project% git push origin main --force
> Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
> gotsh: bad packfile with zero objects
> fatal: remote error: bad packfile with zero objects
> 
> Is it supported?
> 
> Best regards,
> Chris Narkiewicz

Hi Chris,

It sounds like your are hitting a bug which was fixed in April:

"fix spurious empty packfile error from gotd when rewinding a branch"
https://got.gameoftrees.org/?action=diff&commit=cc88020e952af813c1e01b91ab6516969562e972&path=got.git

The fix was shipped in got 0.87.
However, it is not part of 0.86 which is the version of Got that was
shipped with OpenBSD 7.3. Are you running gotd 0.86 on OpenBSD 7.3?

For the time being I would recommend tracking -current on servers
running gotd because gotd is still relatively fresh software which
is receiving fairly important fixes over time. We are not providing
backports via -stable packages yet. If you don't mind tracking
-current on this machine then sysupgrade -s; sysmerge; pkg_add -u;
and /etc.rc.d/gotd restart is all that should be needed.

Alternatively it is possible to compile the latest code of gotd
on OpenBSD 7.3 or on -current, replacing the binaries installed
by the gotd package:

  $ mkdir ~/src
  $ cd ~/src
  $ got clone ssh://anonymous@got.gameoftrees.org/got.git
(
got.gameoftrees.org SSH fingerprints are:
1024 SHA256:aDX3rrQNDfIA5lyXIbynY+goiomgR4Cdx5j4qmWq26I (DSA)
256 SHA256:kmeRVbw2BLak1iZJIv6/AkNhGqW97WIu58SeH8kUfls (ECDSA)
256 SHA256:jvQMQNSKE+p7roYA3Tl8/giZyOUqL7emXS+lJT7KMQ4 (ED25519)
3072 SHA256:q/CWVAukwojxNL3srvWhfHZX00t+eO1IhmnwFAEhE6o (RSA)
)
  $ got checkout got.git
  $ cd got
  $ make obj
  $ make server
  # doas make server-install GOT_RELEASE=Yes
  # doas /etc/rc.d/gotd restart

You should now have current gotd running - does that fix the issue?

Cheers,
Stefan