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

New git plugin: git2 #2494

Closed
wants to merge 2 commits into from
Closed

Conversation

gsemet
Copy link
Contributor

@gsemet gsemet commented Feb 3, 2014

Compared to the first git plugin, this one adds several organised
git aliases and increase the completion function provided by zsh.

Please note that is is a complete rework of the git plugin, with
many new aliases to relearn. People can still use "git" plugin
with the good old workflow, while new person can starts directly
with this new one, and learn this new workflow.

This creates a new git plugin with different aliases. I've merged
the good ideas from other zsh projects out there, and created
this consolidated, logically organized and easy to remember
aliases and other git commands.

Aliases are choosen to:

  • be easily remembered
  • easily found, they are organised in a hierarchical way
  • learning an alias does not hide the underlying command, so you can easily type it when you are on a system with this magic plugin. gga is the alias for git-gui --all. You just have to hurt more the keyboard.

What do you think about this? This gives the following workflows:

Classic Git Project
$ cd myproject
$ gfa # dear git, fetch me all remotes
$ # hack hack hack
$ gg # show me a nice gui so I can select the lines I want to commit and enter the commit message
$ # rehack
$ gga # dear git, I changed my mind, let me amend my last commit
$ # new hack
$ gg
$ gP # dear git, push these changes to my remote (gp is for git pull aliases)

Git-Repo Project (Android)
$ rsrra # dear repo, repo sync all project and rebase everything with auto stash.
$ #hack
$ gg # dear git, commit my change
$ ru # dear repo, please upload everything change to the remote

Branch Merging
$ git merge # dear git, please merge this branch to mine
(conflict araises)
$ gmt # dear git, show me what’s wrong!
(kdiff3 - or you favorite merge tool - show me what’s wrong, Ctrl+2/Ctrl+3 to choose the solution, modify the code, Ctrl+Up/Down to jump to next conflict, and then save)
$ gg # dear git, commit my changes
(edit the commit message)
$ gP # dear git, push that to my remote

Branch merging upstream changes
$ gmum # git merge upstream master
$ gmt # git mergetool
$ gg # git gui
$ gP # git push

Rebase / fixup / squash / reorder / split commit history
$ gr2 # dear git, let me edit you history up to 2 commits behind (git rebase -i HEAD2)
$ gr4 # dear git, let me edit you history up to 4 commits behind (git rebase -i HEAD
4)
$ gr10 # dear git, let me edit you history up to 10 commits behind (git rebase -i HEAD~10)

Compared to the first git plugin, this one adds several organised
git aliases and increase the completion function provided by zsh.

Please note that is is a complete rework, with many new aliases
to relearn.
@gsemet gsemet mentioned this pull request Feb 10, 2014
@bric3
Copy link
Contributor

bric3 commented Feb 23, 2014

You should squash the typo commit. The plugin completion seems to be ok. I don't know about the aliases.

**Maintainer:** [Stibbons](https://github.com/Stibbons)

Compared to the first git plugin, this one adds several organised git aliases and increase the completion
function provided by zsh. Please note that is is a complete rework, with many new aliases to relearn.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you be more specific ?

As for myself I'm not using aliases, but completion is definitely interesting. It seem the completion function cannot find options on some git commands like git-blame / git-annotate etc.

@gsemet
Copy link
Contributor Author

gsemet commented May 20, 2014

Description updated

@mcornella
Copy link
Member

The following comments are talking about this PR (in chronological order):
#2568 (comment)
#2568 (comment)
#2568 (comment)

ncanceill added a commit to ncanceill/oh-my-zsh that referenced this pull request May 24, 2014
# Remove all .orig, .BASE.*, .REMOTE.*, .LOCAL.*, *.BACKUP files
alias gclean=" find . -name '*.orig' -or -name '*.REMOTE.*' -or -name '*.LOCAL.*' -or -name '*.BACKUP.*' -or -name '*.BASE.*' | xargs -r rm -v"

# Edit global Git configuration files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really necessary?

@ncanceill ncanceill mentioned this pull request May 24, 2014
5 tasks
@ncanceill
Copy link
Contributor

Hey, I merged you aliases into the bulk update for the git plugin: #2790. Tell me if I missed any. Some of them were renamed for consistency, but this is open to discussion over there.

I will now look into your completion files. Can you explain how you "increased" them?

ncanceill added a commit to ncanceill/oh-my-zsh that referenced this pull request Jun 2, 2014
@gsemet gsemet mentioned this pull request Mar 11, 2015
alias gl='git log'
compdef _git gl=git-log
# Git log graph
alias glg='git log --stat --max-count=10'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need --max-count=10? I want to get rid of this from all git log aliases.

@mcornella mcornella added Area: plugin Issue or PR related to a plugin new labels Mar 30, 2016
@mcornella
Copy link
Member

I'm closing this since it became less useful after #2790. Reopen if you want to work on it a bit more.

@mcornella mcornella closed this Sep 12, 2018
@mcornella mcornella added New: plugin Request for a plugin or Pull Request that adds one and removed new labels Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin New: plugin Request for a plugin or Pull Request that adds one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants