CLI Bug: loss of committed file additions due to b...
# report-bugs
w
CLI Bug: loss of committed file additions due to bug in
gt undo
gt --version 1.6.1 git version 2.49.0 I had untracked file additions and file modifications that I committed with
gt c -am "branch_name"
. I then ran
gt undo
which restored the file modifications. However it deleted all of the 'untracked' files which I had added. This is an extremely frustrating bug as it has led to a days worth of work lost. Is there any method in which I can restore these files?
p
(If applicable) To help us repro, please send the following if you haven't already: - PR links, screenshots, and/or debug output if applicable - Repro steps - Does this happen consistently? Just to you or others on your team also? - Is this a regression? Is the problem new? - If you're having an issue with the CLI, please send us debug logs using
gt feedback --with-debug-context <any message>
hey Walker, that is super frustrating! I think why this occurred is
gt undo
undoes the most recent Graphite mutation, restoring the repository to its state before the mutation was applied. The
gt create -am
command is a single Graphite mutation, even though under the hood that command performs multiple git operations. Since your untracked files only came into existence in the git history as part of that single mutation (when they were staged and committed), undoing the mutation removed them entirely.
w
In that case I'll be warning my team not to use the
undo
operations since it's critically bugged
e
I'm just another user, just curious about this bug. Since they were git operations and the files were committed, wouldn't the changes still be present in the
git reflog
?
w
reflog is branch-specific though right? Since the branch was destroyed with the undo I don’t think reflog can save my work
e
reflog is not branch specific. If you can't find it there, git fsck would likely still have your changes
v
since you committed the files, they're not actually untracked; you will likely find them in reflog, and they should still be in git odb
➕ 1
p
hey all, this has been included in the latest stable version of the CLI! Check out the changelog for it here: 1.7.0. See how to update here.