-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jj git push --stack
to push all working branches
#1415
Comments
I'd like a form of This is also related to the idea of defining a configurable main branch like git-branchless does. Then we might have a default revset alias #485 is related. |
Re @rslabbert's points:
|
Plan going forward then so far I think would be (names are placeholders, see questions below for naming):
Questions:
|
That all sounds good to me. Thank you! For 3 vs 4, I'm leaning towards 4, so we don't force users to have a configured main branch for small repos like for tracking dotfiles. I don't have much opinion about
Having the configured main branch also enables a |
git-branchless calls this
|
# DISCLAIMER: sync and push work for me but be careful using it if you're not 100%
[aliases]
sync = ["rebase", "-s", "roots((trunk..@) ~ empty())", "-d", "trunk@origin"]
sl = ["log", "-r", "(trunk..@): | (trunk..@)-"]
push = ["git", "push", "-r", "((trunk..@): & remote_branches()) & ~author(me)"]
[revset-aliases]
trunk = "latest((present(main) | present(master)) & remote_branches())" A few notes:
|
There's
A few things:
|
Note: Covered some of these thoughts in #2088 (comment) as well.
|
The remote branch will still point to the old commit then (the one you pushed last time), so it should work. I.e. your local branch will have forked from the remote branch and will thus not be a descendant of the remote branch. Does that make sense? |
Description
A typical workflow for me is to create some commits in a stack, and
jj git push --change @
them to make a couple of PRs on Github. When making changes, every commit that has changed will need ajj edit <ref> && jj git push
to get it up to date, which can become quite cumbersome when editing commit 1 of x. Alternatively I can build up ajj git push --branch ... --branch ... --branch ...
command as I go but that feels suboptimal.Barring a more comprehensive approach for handling local/remote interaction (see #1039 and #1136), a good short/medium term solution in my opinion would be a
--stack
option forjj git push
which can would push every branch of the formpush-*
up and down from the starting ref@
until it hits a branch that doesn't follow that form.Open questions
push-*
branch names for deciding what to do would be a convenient way to avoid having to know what the "main" branch is for any given repository, but is it worth just pulling in the branch detection and configuration logic from git-branchless and building a solid foundation for sync first? It should be easy to migrate to it later.-r
flag tojj git push --stack
to specify which ref to start at? I don't think that would make sense since technically the-r
would be onjj git push
which doesn't make sense currently. Maybe--stack
should always have a ref passed like--stack @
?--all
or--stack
due to their potential for unexpected consequences should require a prompt first or--no-prompt
?jj git push --stack
? git-branchless usesgit submit
, Sapling usessl pr submit
, and graphite usesgt stack submit
.The text was updated successfully, but these errors were encountered: