You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rename command does not indicate it won't change the organization #8147
You can use this template to give us structured feedback or just wipe it and leave us a note. Thank you!
What have you loved?
The tool is amazing overall folks, this is just some feedback I'm giving :).
What was confusing or gave you pause?
I tried to rename a repository in an organization that isn't my main one.
What I wanted :
In the adyen-examples org, rename the medium-stats repo into medium-stats-action.
What happened instead : the medium-stats repo was renamed into adyen-examples-medium-stats-action.
This is because 👍
You write the name of the repo INCLUDING org, I thought I had to retype it.
You do not warn that the organization will not change
You are also modifying unallowed characters ("/") into - apparently (which is cool).
Are there features you'd like to see added?
Proposal (one of):
Omit the org name in the command, to avoid confusion
changed the title [-]Rename command does not indicate it won't change the organizatio[/-][+]Rename command does not indicate it won't change the organization[/+]on Oct 6, 2023
repo rename seems like a cool command! (love how I have something new to discover every day with the GitHub CLI)
I noticed a difference in behavior when there's a prompt (interactive renaming) to rename, and when the new repository name is supplied as a command line argument.
@jlengrand : Thank you for the kind words and opening up this issue for improving the repo naming command!
Let me take a few of your points one-by-one:
You write the name of the repo INCLUDING org, I thought I had to retype it.
I understand why you might think the user or organization owner needed to also be provided.
The GitHub CLI prints the name with owner in order for you to verify this is the intended repository as the command can be invoked with and without that information.
Perhaps this single prompt can be first print the repository name with owner and ask specifically what the new repository name should be.
You do not warn that the organization will not change
How might we reinforce this is specifically for renaming repositories rather than transferring repositories? Is there something more that could be added to the help usage documentation?
$ gh repo rename --help
Rename a GitHub repository.
By default, this renames the current repository; otherwise renames the specified repository.
You are also modifying unallowed characters ("/") into - apparently (which is cool).
This makes me think we should do some validation for / rather than translating all of them into hyphens. I'm not sure offhand how the GitHub UI behaves when you try to rename a repository with a / 🤔
The GitHub CLI prints the name with owner in order for you to verify this is the intended repository as the command can be invoked with and without that information.
Understood, that makes sense to me. It's actually good DX.
How might we reinforce this is specifically for renaming repositories rather than transferring repositories? Is there something more that could be added to the help usage documentation?
That would definitely be a good idea, though in my case it wouldn't have helped. You fall victim of your own success here ^^, your naming is so good that I randomly typed the command first time and it just was there where I expected it to be so I never actually used the help command.
Perhaps this single prompt can be first print the repository name with owner and ask specifically what the new repository name should be.
Maybe one line about which repo you're on, and a second with only the renaming part would help reducing confusion?
$ gh repo rename
? Current repository is Adyen/adyen-java-api-library.
? Rename adyen-java-api-library to:
Another idea would be to add the context by providing the organization as part of the input already:
$ gh repo rename
? Rename adyen-examples/adyen-java-api-library to: adyen-examples/
This makes me think we should do some validation for / rather than translating all of them into hyphens. I'm not sure offhand how the GitHub UI behaves when you try to rename a repository with a / 🤔
I don't think / is a valid character for repositories? Or is it?
Hi @andyfeller, I'd like to work on @jlengrand's second suggestion in this comment. Is that the direction the CLI team would like to take? I'd like a confirmation before starting to work on this! 🙏🏼
@arunsathiya@jlengrand I would like to make another suggestion on approach here, instead of changing the prompt as it currently is what about having a confirmation step after the new name has been input?
Interestingly enough this command already has a confirmation prompt which, I think by mistake, is not active in interactive mode. We could easily change it so that in interactive mode the confirmation step is necessary unless the user specifies the --yes flag.
Interestingly enough this command already has a confirmation prompt which, I think by mistake, is not active in interactive mode.
That matches what I found originally as well. 👍🏼 I still feel that including the organization name in the prompt would be an excellent UX improvement, but I am happy to start working on the confirmation prompt.
I also thought of including the organization name in the confirmation prompt for the repo delete command, but that is a bit different in that, confirmation being a destructive action warrants a full address input (owner + repo). That also matches the pattern on GitHub UI itself. On the other hand, renaming a repo is something that happens within the same organization and including the organization name in the prompt feels like a better UX.
I don't feel too strongly about it, but just wanted to document my thoughts.
Activity
[-]Rename command does not indicate it won't change the organizatio[/-][+]Rename command does not indicate it won't change the organization[/+]arunsathiya commentedon Oct 6, 2023
repo renameseems like a cool command! (love how I have something new to discover every day with the GitHub CLI)I noticed a difference in behavior when there's a prompt (interactive renaming) to rename, and when the new repository name is supplied as a command line argument.
Interactive renaming
New repository name passed as an argument
I agree with the overall feedback that this needs to be improved @jlengrand. 👍🏼
Specific actions that I propose we can take:
Happy to explore and submit a PR once a member of the CLI team gets to review this issue.
Balmasexy commentedon Oct 8, 2023
andyfeller commentedon Oct 9, 2023
@jlengrand : Thank you for the kind words and opening up this issue for improving the repo naming command!
Let me take a few of your points one-by-one:
I understand why you might think the user or organization owner needed to also be provided.
The GitHub CLI prints the name with owner in order for you to verify this is the intended repository as the command can be invoked with and without that information.
Perhaps this single prompt can be first print the repository name with owner and ask specifically what the new repository name should be.
How might we reinforce this is specifically for renaming repositories rather than transferring repositories? Is there something more that could be added to the help usage documentation?
This makes me think we should do some validation for
/rather than translating all of them into hyphens. I'm not sure offhand how the GitHub UI behaves when you try to rename a repository with a/🤔jlengrand commentedon Oct 9, 2023
Understood, that makes sense to me. It's actually good DX.
That would definitely be a good idea, though in my case it wouldn't have helped. You fall victim of your own success here ^^, your naming is so good that I randomly typed the command first time and it just was there where I expected it to be so I never actually used the help command.
Maybe one line about which repo you're on, and a second with only the renaming part would help reducing confusion?
Another idea would be to add the context by providing the organization as part of the input already:
I don't think
/is a valid character for repositories? Or is it?arunsathiya commentedon Oct 9, 2023
❤️ I like this idea, vs my previous proposal of stripping out the organization name behind the scenes.
arunsathiya commentedon Oct 17, 2023
Hi @andyfeller, I'd like to work on @jlengrand's second suggestion in this comment. Is that the direction the CLI team would like to take? I'd like a confirmation before starting to work on this! 🙏🏼
samcoe commentedon Oct 18, 2023
@arunsathiya @jlengrand I would like to make another suggestion on approach here, instead of changing the prompt as it currently is what about having a confirmation step after the new name has been input?
Interestingly enough this command already has a confirmation prompt which, I think by mistake, is not active in interactive mode. We could easily change it so that in interactive mode the confirmation step is necessary unless the user specifies the
--yesflag.arunsathiya commentedon Oct 18, 2023
That matches what I found originally as well. 👍🏼 I still feel that including the organization name in the prompt would be an excellent UX improvement, but I am happy to start working on the confirmation prompt.
I also thought of including the organization name in the confirmation prompt for the
repo deletecommand, but that is a bit different in that, confirmation being a destructive action warrants a full address input (owner + repo). That also matches the pattern on GitHub UI itself. On the other hand, renaming a repo is something that happens within the same organization and including the organization name in the prompt feels like a better UX.I don't feel too strongly about it, but just wanted to document my thoughts.