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

Update strategy of git aliases #3

Open
sQVe opened this issue Jan 25, 2020 · 5 comments
Open

Update strategy of git aliases #3

sQVe opened this issue Jan 25, 2020 · 5 comments

Comments

@sQVe
Copy link
Contributor

sQVe commented Jan 25, 2020

Hey 👋,

I think we need a strategy for how we keep the aliases here up to date with the git internals and best practices. An example it the new git switch and git restore which separates the two different common use cases of git checkout.

See:

The obvious alias for git switch would be Gs but that is already taken by git stash.

@ericbn
Copy link
Member

ericbn commented Jan 25, 2020

Hi @sQVe! We sure need to incorporate these into the aliases. Good point!

For git switch, Gs, Gbs, GS and GbS are already taken. For git restore, Gr, Gwr, GR and GwR are also taken. I think these would be the first choices that make more sense. So we'll need to be more creative here, by choosing different 2 or 3 letter aliases, and/or by rearranging the existing ones.

The documentation for both commands in Git version 2.25 still say:

THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

So not sure if we should wait until the commands are established.

Ideas?

@sQVe
Copy link
Contributor Author

sQVe commented Jan 25, 2020

I totally missed that they were listed as experimental. In that case I think we should wait until they are more established.

I still think this issue rings true in the sense that we need to start thinking about handling all the aliases we have. There're not that much room for "good" additions, especially if we do not want to rearrange or modify the existing ones.

I currently do not have any good suggestions which is most likely because I've been using these aliases for years and they are more ingrained in me than the normal commands.

@ericbn
Copy link
Member

ericbn commented Jul 13, 2022

More than 2 years have passed and the documentation still says it's experimental (in git 2.37.0). Might be enough time already! :- )

What if we add new two-letter aliases for git switch and git restore?

I was thinking of Gh for git switch, and Ge for git restore. The last letters... ¯\_(ツ)_/¯

Then we go on adding the three-letter variations, like Ges for git restore --source for example...

Thoughts?

EDIT: I like how vim-unimpaired uses y for switch:

The mnemonic for y is that if you tilt it a bit it looks like a switch.

But since we're preferring letters that are part of the actual word, and the spelling is not actually swytch, then maybe it's not the right approach for us... (even x for delete can be thought as exclude...) Not sure.

@sQVe
Copy link
Contributor Author

sQVe commented Jul 13, 2022

@ericbn I think your suggestions are fine and would work well. It will be nice to have these commands! 👌

@ericbn
Copy link
Member

ericbn commented Aug 16, 2022

I didn't forget about this. I just didn't get used to the new aliases, so still experimenting with them. Gco is so buried into my muscle memory that's being hard to replace it... :- )

I'm feeling Gy is better than Gh for git switch because Gh alludes to GitHub.

ericbn added a commit that referenced this issue Sep 7, 2022
Use the same mnemonic [vim-unimpaired] uses for switch:

> The mnemonic for y is that if you tilt it a bit it looks like a switch.

See #3
[vim-unimpaired]: https://github.com/tpope/vim-unimpaired/blob/v2.1/doc/unimpaired.txt#L95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants