public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* git gc destroys autostash
@ 2024-02-07 20:52 Orgad Shaneh
  2024-02-07 21:05 ` Junio C Hamano
  2024-02-07 21:47 ` Kristoffer Haugsbakk
  0 siblings, 2 replies; 3+ messages in thread
From: Orgad Shaneh @ 2024-02-07 20:52 UTC (permalink / raw)
  To: git

Running git gc --prune=now during rebase with autostash deletes the
autostash object, and it cannot be recovered when the rebase ends.

Example:

#!/bin/sh

git init
echo 1 > foo; git add foo; git commit -m 'Initial commit'
echo 2 > foo; git add foo; git commit -m 'Second commit'
echo 3 > foo; git rebase -i --autostash HEAD^
# Choose edit
git gc --prune=now
git rebase --continue
# fatal: '3b88163a1bff3859a005554c168d94e5357ee45b' is not a stash-like commit
# error: cannot store 3b88163a1bff3859a005554c168d94e5357ee45b
# Successfully rebased and updated refs/heads/master.

Thanks,
- Orgad

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-07 21:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 20:52 git gc destroys autostash Orgad Shaneh
2024-02-07 21:05 ` Junio C Hamano
2024-02-07 21:47 ` Kristoffer Haugsbakk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox