git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git refs migrate does not migrate stash entries

From
Karthik Nayak <karthik.188@gmail.com>
Date
Jan 22, 2025, 06:03 UTC
Message-ID
<CAOLa=ZQmPRXSNtZfm7noMoUgBYp4+BcOgikkCY+JyAc6n1OuUQ@mail.gmail.com>
In-Reply-To
<Z5BTQRlsOj1sygun@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 34 quoted lines
> After the recent fix for reflog migrations posted to the list, I
> converted two work repositories. Unfortunately, it doesn't appear as
> though the reflog for `refs/stash` was converted, so I think I may have
> lost my stashes.  While I would have liked to retain them, fortunately
> they were not essential in these repos and I can live without them, but
> we probably do want to fix this issue since users in general will want
> to maintain them.
>
> Here's a shell script that reproduces the problem on the latest `next`:
> ----
> #!/bin/sh -e
>
> rm -fr test-repo
> git version
> git init -b dev test-repo
> cd test-repo
> touch abc.txt
> git add abc.txt
> git commit -m +
> echo abc >abc.txt
> git stash
> git show stash@{0}
> git stash list -p
>
> echo "Converting..."
> git refs migrate --ref-format=reftable
>
> echo "Now using reftable."
>
> git stash show
> git show stash@{0}
> git stash list -p
> ----
>
Confirming that I can also reproduce the issue.
Show 9 quoted lines
> My expectation is that the script exits 0 and prints the stashes a
> second time, but it exits early and unsuccessfully and the stashes don't
> appear to be preserved.  It does appear to work correctly if you comment
> out the `git refs migrate` command.
>
> I would have liked to have done more investigation, but I'm dealing with
> some administrivia in my personal life that has taken up more of my
> evenings than I would have liked, so I have not done so.
>

I didn't investigate it yet, over the top, it seems like the reflog is migrated, however the detection and display doesn't work for some reason:

  $ git for-each-ref --include-root-refs
  0652ae7d444e73ed8bee7ca7a0b66e4413386297 commit	HEAD
  0652ae7d444e73ed8bee7ca7a0b66e4413386297 commit	ORIG_HEAD
  0652ae7d444e73ed8bee7ca7a0b66e4413386297 commit	refs/heads/dev
  2652bce3ffc3769feb7eca552d3dbe27ff901aaf commit	refs/stash
I will spend time on this week.
Show 6 quoted lines
> I also apologize for sending a constant barrage of bug reports that
> might make it seem like I'm dissatisfied with the work on reftable, when
> in fact that's not the case and I do very much appreciate the work being
> done.  I did promise Patrick that I'd try it out and be the guinea pig,
> and so I'm doing so.  I'm excited to see it end up in its final state.
> --

If anything, this is really useful and I really appreciate you putting efforts to report these bugs. This helps us improve the bridge and also helps the community overall.

Thanks for your work!
> brian m. carlson (they/them or he/him)
> Toronto, Ontario, CA
Previous: brian m. carlson
Message 2 of 2 in “git refs migrate does not migrate stash entries”
  1. brian m. carlsonJan 22, 2025
  2. Karthik NayakJan 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.