datarockets / dotfiles

Configuration files for zsh, vim, and tmux
MIT License
11 stars 1 forks source link

Simplify `gpull` and `gpush` functions #28

Closed ezhlobo closed 3 years ago

ezhlobo commented 5 years ago

We can simplify these functions:

https://github.com/datarockets/dotfiles/blob/8122aeb65d4b4cea78beb0300817dc7899e65aec/zsh/functions/git.zsh#L1-L5

https://github.com/datarockets/dotfiles/blob/8122aeb65d4b4cea78beb0300817dc7899e65aec/zsh/functions/git.zsh#L7-L11

By replacing $current_branch with HEAD.

Recently I've been told by @atatarenko that there is an alias for current branch — HEAD.

Proof on https://git-scm.com

With this we can simplify it.

Other resources to consider before making such decisions: