How do I allow `gt submit` to ignore if the `main`...
# how-do-i
b
How do I allow
gt submit
to ignore if the
main
branch is behind
origin/main
? It's not usually relevant to me creating a PR. Steps to repro: 1. let
origin/main
get ahead of your local
main
by a commit or two. 2. click the "submit cloud" button in VSCode extension. 3. See
Aborting submit due to out of date trunk branch
p
(If applicable) To help us more clearly understand what you're trying to do, please provide additional details about: - Screenshots / debug logs / list of commands you've tried to run so far - Your workflow - Current state
āœ… 1
b
(yes, there's a workaround of clicking Sync and waiting, but I'd love to just be able to create PRs and deal with merge-conflicts later if they are needed.)
p
hey Bryan, this is interesting, i couldnt reproduce with your steps though a much simpler test. Does the same error arise if you ran
gt submit
from the CLI?
šŸ‘€ 1
b
yep!
Copy code
bryan@bc-ft-laptop app % gt submit
šŸ„ž Validating that this Graphite stack is ready to submit...
Trunk branch (main) is behind its upstream branch. Please run gt sync to update.
Failure to update could result in incorrect metadata being used to submit PRs.
? Continue with this submit operation? › (y/N)
p
Okay, so in that method though, it still lets you bypass by submitting
y
? or after
y
you hit error? im wondering if this is just a gap in interactive the handling via the extension or something else
b
oh! Yeah I can bypass it in the terminal with
y
like you mention - but in the interactive tool, it just throws the error you see in the first screeenshot. Been using Graphite for a long time and hadn't seen this error until getting Graphite set up at my new job this week - so I figure it's either a regression in Graphite's tooling or a configuration setting I need to tweak in our repo?
p
the prompt in the CLI is a newer addition and i suspect its not playing well with the interactive tool. Will file this for the team to look at~
🫶 1
t
I would love a way to disable this check for all
gt submit
actions
b
I wonder if that'd effect the VSCode extension too! Will give it a shot.
p
Hey Team, wanted to close the loop here that we've improved the functionality on submitting with out of date trunc in CLI ver 1.7.5! See updating the CLI for ref-
šŸ‘€ 1
t
So others don't have to go looking, here's a link to the changelog: https://graphite.com/docs/cli-changelog. I pointed to what I think the fix here is.
I appreciate you pointing that out Brett! I don't think this bugfix is what this thread is discussing. It sounds like the bugfix makes it so the warning doesn't show incorrectly (saying the trunk is out of date when it's actually not). The thread is talking about never showing the warning, even if the trunk is out of date. Because we get it, we understand, and we don't care -- we don't need the warning every time.
No AI required from you -- adding
--ignore-out-of-sync-trunk
to my alias solves the issue šŸ™Œ
b
Thank you @Topher Brown! I added
submit submit --ignore-out-of-sync-trunk
to my
gt aliases
and now the VSCode extension doesn't require that the
main
branch be up-to-date in my repo when I click. So much nicer!