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

Add rename-alias alias at alias management #26

Merged
merged 3 commits into from
May 20, 2017
Merged

Add rename-alias alias at alias management #26

merged 3 commits into from
May 20, 2017

Conversation

pachoyan
Copy link
Contributor

@pachoyan pachoyan commented May 19, 2017

Add rename alias:

Usage:

git rename-(local|global)-alias <alias existing name> <new alias name>

git rename-alias

  • Choose Local or global to use --global or --local options
  • First parameter <alias existing name> must be an existing alias.
  • Second parameter <new alias name> must be an alias that does not exist.
  • First parameter and second parameter must be different.
  • There must be two parameters

Examples:

Success:

git rename-local-alias ci comm
git rename-global-alias ci comm

git rename-alias ci comm
Alias comm renamed to ci

Error:

git rename-local-alias any ci
Usage: git rename-alias <alias existing name> <new alias name>
The alias you are going to rename must exist and new name must not exist.

git rename-global-alias any ci
Usage: git rename-alias <alias existing name> <new alias name>
The alias you are going to rename must exist and new name must not exist.

git rename-alias any ci

@phdru
Copy link
Contributor

phdru commented May 19, 2017

I don't like that 'Alias … renamed'. Unix command-line commands are usually silent in case of success; you can add option -v to allow verbosity.

Other than that — interesting idea and good implementation!

@pachoyan
Copy link
Contributor Author

pachoyan commented May 19, 2017

I agree. I'm going to remove the success message.
Regard the verbosity option IMO is not need. What do you think?

Thanks!

@phdru
Copy link
Contributor

phdru commented May 19, 2017

Not needed IMO. Go on!

@pachoyan
Copy link
Contributor Author

Success message removed.

@joelparkerhenderson
Copy link
Member

Good work, thank you! Good code, good commit message, and good discussion.

@pachoyan How does the code distinguish a local alias and a global alias? (The git default is for the "alias" command to work on a local alias, not global. See the --local option and --global option.)

@pachoyan
Copy link
Contributor Author

@joelparkerhenderson Actually it doesn't distinguish a local alias and a global, it is using always the --global option. In my next commit, I'm going to update that using the same as is doing in add-(local-global)-alias aliases.

So, in the next commit the usage would be:

  • Local

    git rename-local-alias ci comm
    
  • Global

    git rename-global-alias ci comm
    

@joelparkerhenderson joelparkerhenderson merged commit 84b1fa0 into GitAlias:master May 20, 2017
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 this pull request may close these issues.

None yet

3 participants