Git Product home page Git Product logo

Comments (5)

bnjmnt4n avatar bnjmnt4n commented on September 13, 2024

There's some prior discussion in #3932, but I believe the consensus is that jj branch set can set the branch (creating one if it doesn't already exist, and giving a warning to use jj branch move if the intent is not to create new branches). I guess it might be possible to add a -r flag to jj branch move, but that doesn't fully align with the --from and --to argument names as well (which is why I think --to was chosen).

Even so, I believe there's an error in your initial issue: you can't "move" a remote branch locally. The only way to do that is to move the local tracking branch to the desired commit (via jj branch set/move) and jj git push to push the branch and update the remote branch. (#3588 is a feature request for pushing a specific commit directly to the given branch, which might be what you're looking for.)

from jj.

yuja avatar yuja commented on September 13, 2024

as jj branch move uses the --to flag instead of the -r flag.

Do you want -r specifically? or is it okay if --to had a short flag? We have --from/--to combinations in various commands, and it'll probably make sense to add short names for them.

from jj.

jalil-salame avatar jalil-salame commented on September 13, 2024

as jj branch move uses the --to flag instead of the -r flag.

Do you want -r specifically? or is it okay if --to had a short flag? We have --from/--to combinations in various commands, and it'll probably make sense to add short names for them.

Short flags would be nice

from jj.

jalil-salame avatar jalil-salame commented on September 13, 2024

There's some prior discussion in #3932, but I believe the consensus is that jj branch set can set the branch (creating one if it doesn't already exist, and giving a warning to use jj branch move if the intent is not to create new branches). I guess it might be possible to add a -r flag to jj branch move, but that doesn't fully align with the --from and --to argument names as well (which is why I think --to was chosen).

I still believe this should be an error by default (creating a branch with an @ in the name).

Even so, I believe there's an error in your initial issue: you can't "move" a remote branch locally. The only way to do that is to move the local tracking branch to the desired commit (via jj branch set/move) and jj git push to push the branch and update the remote branch. (#3588 is a feature request for pushing a specific commit directly to the given branch, which might be what you're looking for.)

And it should probably be an error if I try to move a remote tracking branch c:

from jj.

yuja avatar yuja commented on September 13, 2024

I still believe this should be an error by default (creating a branch with an @ in the name).

I don't think it should be an error (because @ is a valid branch name), but I understand it's confusing. Perhaps, a warning can be emitted if a branch name contained a certain meta characters (such as :, @, *, ?.)

from jj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.