There seems to be something that happened to my lo...
# how-do-i
a
There seems to be something that happened to my local
gt
metadata as I lost an entire stack locally that’s already been submitted as a stack. What’s the best way to get that back? I tried to do a series of
gt dsg <branch-name>
then repeat up the stack, but when I tried to do another stack submit, it gave me the message that I cannot perform that action on an untracked branch. So I tried tracking the branches, but they weren’t in a stack anymore. Not a huge loss if I lose the ability to manage this stack with
gt
moving forward as it’s very small and will be merged in the next day or two. But this is a good thing for me to understand so that, as more of my team adopts it, I can help them through it.
a
Seems strange & far from optimal that you lost a stack. cc @Jacob Gold
a
It could very well be a misunderstanding on my part when it comes to collaborating with another team member who isn’t using graphite, so it very well could be self inflicted
a
Can you try the following:
Copy code
$ gt dsg <top of stack>
$ gt bb
// For all branches in stack...
$ gt branch track
$ gt ss
You might need a
gt ss --force
Our collaboration workflow also leaves something to be desired
a
Looks like
gt branch track
is trying to set the parent to
main
Oh, I missed that there’s the
ss
step, let me start over
a
So for the base branch, that is correct. For the upstack ones you can do
gt branch track --parent <downstack branch>
a
Ok, should I stack submit in between the track steps, or wait until it’s all done?
a
Wait till all done
This is far from optimal though...
a
New error
ERROR: core-1272-api-update-graphql-to-support-checkbox is not in the history of core-1273-frontend-add-checkbox-to-storefront.
🫠 1
Agreed re: far from optimal, but this is fortunately a very low impact on my end. It’s 4 branches to the stack and I am very familiar with using git rebase to manage this particular stack moving forward
a
Ok let's try this...
Copy code
$ gt dsg <bottom of stack>
$ gt branch track <bottom of stack>

$ gt dsg <bottom of stack + 1>
$ gt branch track <bottom of stack + 1> 
$ gt branch checkout <bottom of stack + 1> 
$ gt upstack onto <bottom of stack>
@Jacob Gold is likely the best to figure this out, so will wait till he responds if the above doesn't work
Ok so the answer is
gt downstack track
a
Yeah, something still isn’t quite right here. I’m going to try and remove my local branches, as they don’t have anything that’s not in remote, then try this process
j
I just read through the thread — does starting with a
gt downstack get <top>
work?
That should result in all the branches being tracked properly from the get-go
a
It didn’t seem to, no
Now that I have no local branches for this stack, I can try again though and see how it fares
👍 1
Yeah, that seems to be working now
🚀 2
Hmmm… maybe not 😞
I did the
gt dsg <top>
and that pulle down the four branches as I expected. I was able to branch up/down on them. Then I went to
main
and did a
dsg
on another branch, now my git log only shows the bottom of the stack and the rest are gone
message has been deleted
Again, this isn’t paramount to my day to day at the moment. I can manually handle these branches as needed and can reset and start fresh for future stack work. But I can also empathize with you wanting to know how to fix this so that it doesn’t happen to others. I’m in no rush, but more than happy to help keep sending data / troubleshooting things on my end
I’m actually about to wrap my day, but anything you want me to try, just drop it in here and I’ll give it a whirl tomorrow. Thanks to you both!