Skip to content
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

cli: git push: exclude new bookmarks tracking other remotes if no --remote set #4730

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Oct 30, 2024

  1. cli: git push: borrow repo from transaction

    This forces us to think about which repo should be used. It doesn't matter in
    find_bookmarks_to_push() because moved "push-{change_id}" bookmarks are
    prioritized. It doesn't matter in print_commits_ready_to_push() either, which
    uses the repo only for ancestry lookup, but I think tx.repo() is better here.
    yuja committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    fa625d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    377c3b5 View commit details
    Browse the repository at this point in the history
  3. cli: git push: exclude new bookmarks tracking other remotes if no --r…

    …emote set
    
    If you have multiple remotes to push to, you might want to keep some changes
    in your private fork. Git CLI has one upstream remote per branch, but jj
    supports multiple tracking remotes, and therefore "jj git push" can start
    tracking new remotes automatically.
    
    This patch makes new bookmarks not eligible for push if tracked bookmarks
    already exists on other remotes. I considered adding a warning, but it's not
    always possible to interrupt the push shortly after a warning is emitted. This
    check can be turned off by specifying --remote=NAME explicitly. Another stricter
    (and simpler in terms of implementation) idea is to force user to pass
    --new-bookmark or something to push any local bookmark to new remote.
    
    martinvonz#1278
    yuja committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    fd934f9 View commit details
    Browse the repository at this point in the history