-
Notifications
You must be signed in to change notification settings - Fork 398
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
Option to jj git push --allow-new
by default
#5094
Comments
Any of the first three bullets seems reasonable to me, especially the one to make the behavior depend on the number of remotes, since I haven't seen a rationale for imposing this restriction when there's only one remote, which I suspect is the common case. I don't understand the
|
I thought the original behavior made the most sense, and will end up typing |
Any new local bookmarks can be pushed to new remote by default, but if the bookmark is already associated with other remotes,
I think it works better than changing behavior based on the number of the configured remotes. The downside is that it's harder to understand/explain what |
@steveklabnik, do you mean the explicit |
My usage of bookmarks is basically only for interop with git remotes, so creating and then pushing them is the sort of default action. That being said, I also probably did not run afoul of the issue that motivated the change because I rarely work on projects with multiple remotes at the moment, and the ones I do, I do want them pushed everywhere. This change, for example, breaks my tutorial; we create a repository on github that's empty, and then push our local project up to it; this now requires That being said, I like @yuja 's suggestion above a lot. I think it retains the simplicity of the simple cases while still catching the original problem. |
Concur strongly with @steveklabnik here. While I think the multiple-remotes approach I suggested was a reasonable compromise, I like @yuja’s suggestion here better than what I proposed—it makes the easy case easy, and should prevent most of the weird/possibly-dangerous scenarios that the original was trying to prevent. I do also think some degree of configurability/tunability could be nice? But that seems separate. |
Sounds good to me too. |
@yuja are you planning to implement this? If not, I may have time to take a swing at it over my Christmas break. |
This partially reverts 296961c "cli: git push: do not push new bookmarks by default." Apparently, the restriction introduced by that patch was too strict for some use cases. The new rule is that any non-tracking (or local-only) bookmarks will be pushed to new remote by default, but --allow-new-tracking is required if a bookmark is already tracking other (real) remotes. Closes jj-vcs#5094
I do use bookmarks not only for pushing, and Also, bookmarks is not the git-only concept in jj So I think making it configurable from the start would be nice |
I would also like this default to at least be configurable. Alongside interacting with git, I also use bookmarks as named changes so that I don't need to remember change ids, having these be automatically pushed when they're not already tied to a remote feels very surprising to me. This would also mean other people's PRs that I've checked out with |
I'm not sure I understand this statement; are you saying that you've had cases where the default
My understanding is that the proposal to make the behavior depend on the number of remotes would resolve this issue. |
I'm saying I've had bookmarks which I don't want to push and which would be pushed automatically if
I have two remotes but only one is configured for pushing, so that could solve my issue if it only counts |
Perhaps, #5173 would work in that situation assuming that other people's bookmarks are tracking their remote bookmarks. That said, it would be a bit scary to do |
Prior to the most recent
This sounds backwards to me; the idea is that if you have multiple remotes, the default would not be |
Just for reference, #5053 suggests that the user wants to exclude some bookmarks from the default push revset. I'm leaning towards adding config knob because |
A config knob seems needful, yeah: it’s fairly apparent from reading this issue and other discussion that there are several very different workflows folks are using with bookmarks, and in some of them the user basically always wants to push a new bookmark when they |
Yes I did, often, and I was glad to see the change in 0.24.
Yes sorry, I misunderstood the proposal. No it would not solve my issue because the checked out PRs are not tied to any remote. |
…y default This goes against our rule that we shouldn't add config knob that changes the command behavior, but I don't have any other idea to work around the problem. Apparently, there are two parties, one who always wants to push new bookmarks, and the other who mildly prefers to push&track new bookmarks explicitly. Perhaps, for the former, creation of bookmarks means that the target branches are marked to be pushed. The added flag is a simple boolean. "non-tracking-only" behavior jj-vcs#5173 could be implemented, but I don't want to complicate things. It's a failed attempt to address the issue without introducing config knob. Closes jj-vcs#5094 Closes jj-vcs#5173
…y default This goes against our rule that we shouldn't add config knob that changes the command behavior, but I don't have any other idea to work around the problem. Apparently, there are two parties, one who always wants to push new bookmarks, and the other who mildly prefers to push&track new bookmarks explicitly. Perhaps, for the former, creation of bookmarks means that the target branches are marked to be pushed. The added flag is a simple boolean. "non-tracking-only" behavior #5173 could be implemented, but I don't want to complicate things. It's a failed attempt to address the issue without introducing config knob. Closes #5094 Closes #5173
Fixed by f9906dc |
jj git push --allow-new
by default or notjj git push --allow-new
by default
TODO: Add this to |
Update: Current status
This is now implemented and released in jj 0.26; you can have
jj
push new branches by default by settinggit.push-new-bookmark=true
. Note that this is not recommended unless--allow-new
really inconveniences you. (Ultimately, we'd prefer a UI where such an option would not be needed)See also the documentation for
--allow-new
injj help git push
.(Extracted from #4871 so the issue won't be buried)
29a2247 changed
jj git push
to not create and track new remote bookmarks by default, for the reason described in the commit message. Apparently, the new behavior is too strict for certain use cases.Should we
git.auto-local-bookmark
for the remote)--allow-new
based on the number of the configured remotes?cli: git push: do not push new bookmarks by default #4871 (comment)
--allow-track-new
instead? (non-tracking local bookmark can be pushed to new remote, but tracking one won't by default)cli: git push: exclude new bookmarks tracking other remotes if no --remote set #4730 (comment)
jj bookmark track <name>@<new-remote>
to flag new bookmarks to be pushed?cli: git push: do not push new bookmarks by default #4871 (comment)
Previous discussions:
Related:
The text was updated successfully, but these errors were encountered: