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

Avoid using same command for querying and mutating (e.g. branches) #330

Closed
martinvonz opened this issue May 19, 2022 · 0 comments · Fixed by #353
Closed

Avoid using same command for querying and mutating (e.g. branches) #330

martinvonz opened this issue May 19, 2022 · 0 comments · Fixed by #353

Comments

@martinvonz
Copy link
Member

Description

@arxanas shared this confusing snippet:

$ jj branch help
Nothing changed.
$ jj branch delete foo 
warning: Updating multiple branches (2).
$ jj log
@ 617f177b78c7 ef64c980ded3 (no email configured) 2022-05-18 17:32:58.000 -07:00 delete foo forget help  
| (no description set)

I agree that that behavior is confusing. Git and Mercurial behave the same way. However, in their defense, they don't have subcommands at all, so the user is much less likely to think that using branch delete for deleting a branch would work. Since we do have subcommands, we may want to use them more consistently and never (?) have the same command either query or mutate the repo (except for the automatic working copy snapshots) depending on arguments.

@arxanas suggested having branch create, branch delete, and branch list (replacing the current branches). That sounds good to me, but I'm happy to hear what others think.

Specifications

  • Version: 0.4.0
arxanas added a commit to arxanas/jj that referenced this issue May 28, 2022
arxanas added a commit to arxanas/jj that referenced this issue Jun 3, 2022
arxanas added a commit to arxanas/jj that referenced this issue Jun 6, 2022
arxanas added a commit to arxanas/jj that referenced this issue Jun 6, 2022
arxanas added a commit to arxanas/jj that referenced this issue Jun 6, 2022
arxanas added a commit to arxanas/jj that referenced this issue Jun 6, 2022
martinvonz pushed a commit that referenced this issue Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant