Skip to content

gh pr create - is it possible? #6279

Answered by TeofilC
pweiskircher asked this question in Q&A
Discussion options

You must be logged in to vote

I have the following alias in my .config/gh/config.yml file:

aliases:
    pc: "!jj git push -c \"all:$1\"; for c in $(jj log --no-graph -r \"$1 & mutable()\" -T \"change_id ++ '\n'\"); do echo creating PR for $c; gh pr create --head $(jj bookmark list -r $c -T name) --base $(jj bookmark list -r \"heads(::$c- & bookmarks())\" -T name) --fill; done"

You run gh pc <revset> and it will use git push -c to auto push branches for all of your changes in that revset, and for each it will create a PR whose base is the previous bookmark. You might want to drop the base logic if you're not interested in that

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@pweiskircher
Comment options

Comment options

You must be logged in to vote
4 replies
@pweiskircher
Comment options

@PhilipMetzger
Comment options

@pweiskircher
Comment options

@PhilipMetzger
Comment options

Comment options

You must be logged in to vote
2 replies
@pweiskircher
Comment options

@david-crespo
Comment options

Comment options

You must be logged in to vote
1 reply
@pweiskircher
Comment options

Answer selected by pweiskircher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants