This message was deleted.
# how-do-i
s
This message was deleted.
➕ 4
j
not something we currently support, but something we could build in the future!
👍 4
b
Maybe it won’t be possible. You cannot set your base revision to a fork so stacking probably isn’t possible
r
I would like graphite to support forks also. Contributing to open source projects with stacked diffs would be really nice.
➕ 3
c
This would be extremely helpful. For now I can get away with something like the following, but I have to cycle through each PR manually. Of course this defeats the value prop to an extent.
Copy code
# complete work on a branch and interactively rebase to desired commit order
# assume gh cli is set to relevant upstream

gt bsp # interactively set branch/pr breakpoints
gt ss # interactively configure draft PRs on your fork to be closed without merge

gh pr create -t "title" -b "body" -a "@me" -l "label" -d -r reviewername -m "milestone"
gh pr ready
# ...
gh pr merge -s # or maybe someone else does

# prepare and submit next pr up the stack

git fetch upstream main:main && gt rs -r && gt ss # agree to remove merged branch
gt bb # or otherwise checkout the next branch in the stack from which to submit a PR

gh pr create -t "title" -b "body" -a "@me" -l "label" -d -r reviewername -m "milestone"
gh pr ready
# ...
gh pr merge -s

# ...

# check that PRs and branches on your fork were successfully closed/removed
😮 1
v
I created an additional parameter for the
submit
commands,
--pr-mode
. It has three possible values.
gt
to behave like now,
push-only
to just push the branches and do nothing else, and
gh
to output the
gh pr create
calls necessary to open PRs against the upstream repository. I didn't use it excessively yet, but I already sent https://github.com/withgraphite/graphite-cli/pull/1409 using that new parameter and it feels not too bad until Graphite hopefully has proper support for the fork-workflow. If anyone is interested, my code is pushed at https://github.com/Vampire/graphite-cli/tree/pr-mode, feel free to get it and build your own version. You might want to adjust the default value, because for me it is
push-only
as that is most probably the one I will need most. 🙂
👍 1