EXTREME BUG HIGH PRIORITY <The Graphite docs for >...
# report-bugs
z
EXTREME BUG HIGH PRIORITY The Graphite docs for `gt create` describe
--insert
as:
Copy code
-i, --insertInsert this branch between the current branch and its child. If there are multiple children, prompts you to select which should be moved onto the new branch.
Maybe I'm dumb, but if you have
main > B
and you want
main > A > B
, this implies you should checkout
main
and do
gt create --insert A
and be prompted that
B
is the correct child. But I just did this and graphite inserted
A
in between EVERY branch that is a child of
main
. I hope I don't have to explain how disruptive/annoying this is. Truly unbelievable.
✅ 1
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>
z
There were no "prompts" of which child branch to select. I kind of don't believe how bad this is. I hope I'm misreading those docs and it's just user error.
To be clear, I have probably ~50 branches whose parent is
main
, and now there is a new branch that is between ALL of them and
main
.
p
hey Zach, what
gt --version
are you using? This would be unexpected behavior. In my first try at repro'ing it worked as expected though
z
Copy code
gt --version
1.6.8
p
ah that's quite old at this point, could you update to the most recent version
z
Can you confirm whether that version of the CLI has that bug?
p
am not seeing it specifically mentioned in the changelog, but there have been changes to
create
in the inteirm
z
It doesn't sound like you're as curious as I am in whether this bug did indeed exist in the version of Graphite I'm using. I suppose you have nothing to gain by confirming it wasn't just user error, but I do encourage you to ping your eng team because it's among the most disruptive things I can imagine this CLI doing to a user and I hope it's taken seriously.
j
It sounds like a bug, definitely not user error
Although I'm looking at 1.6.8 and seeing that the prompt is always triggered in that version, as far as I can tell it has been triggered since 1.0.0 (I was the one who added it)
Can you check to see whether there might be something causing this on your machine by testing whether it works as expected on the latest version? The fact that you ran into it on 1.6.8 is unexpected to me
j
This has happened to me in the past and thought I did something wrong as well!
🎉 1
z
@Jacob Gold I tested it on
1.7.20
and again got unexpected behavior. I did:
Copy code
git checkout main
gt create test-A
# now have main > test-A
git checkout main
gt create --insert test-inserted
and again I did NOT get a prompt but it seems like graphite "remembered" that my most recently-created child branch was
test-A
and I ended up with `main > test-inserted > test-A`:
Copy code
$ gt ls -s
◯  test-A
◉  test-inserted
◯  main
AND it gave this error message:
Copy code
ERROR: Command failed with error exit code 128:
git update-ref refs/branch-metadata/main 8aa97b94614df7759ae1c20a108c535d182b4084

fatal: update_ref failed for ref 'refs/branch-metadata/main': cannot lock ref 'refs/branch-metadata/main': Unable to create '/Users/zsiegel/code/current-ai/.git/refs/branch-metadata/main.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
This command is so ridiculously buggy and far from documented behavior. Plus, on that prior graphite version, it caused me extremely annoying data corruption (inserting a branch between main and every other graphite branch). You should escalate this IMO.
Also in terms of API design this is an absolutely deranged concept. A given branch has arbitrarily many children but at most one parent.
gt create --insert
should obviously, intuitively, have the following definition:
insert a branch between the current branch and its PARENT. By default, the branch will be identical to the PARENT branch; run
gt create --insert-from-this
to insert a branch that is identical to THIS branch
But actually I think you should remove
gt create --insert
and just add a new command
gt insert
- the difference between this and
gt create
is comparable to the difference between
gt fold
and
gt create
, which are indeed separate commands.
YOU'RE WELCOME for running testing/debugging
gt create --insert
.
j
gt create --insert
opening interactive prompt when on main (actually does this in any case when there are multiple children of the current branch). have you ever seen this prompt? wondering if there is something going on with the way the prompting library we use interacts with your system
In terms of the API design, the changes you are making are to the currently checked out branch, which maps to the standard flow of
gt create
- the only difference is that you are moving (some of the) existing children of the current branch on top of the new branch.
insert a branch between the current branch and its PARENT
this would run into conflicts quite often if you made changes to the same code that was added in the current branch. i think we could support that as well with a separate command/flag combination though, it's a good idea
z
@Jacob Gold I have not seen that prompt as far as I recall. Happy to run some test if you have a way to trigger and debug the prompting UI.
j
try it once more and submitting
gt feedback
after to send us a debug context. Also, what OS/shell is this on?
z
sorry try what? I don't particularly want to try
gt insert
(since that caused some damage last time I ran it) Is there another command that opens up that prompt UI?
j
gt checkout
?
but wasn't sure if it's related to this specific prompt trigger
if it's command specific you can always try it in a test repo