From 4bc610969f689fd2da50d5b8bc7504fb6af45da3 Mon Sep 17 00:00:00 2001 From: Igor Zibarev Date: Thu, 5 May 2016 16:56:08 +0600 Subject: [PATCH] [git] Add aliases: stash unapply and full graph Added git aliases: - "gsu": Stash unapply to revert applied changes - "glG": Full graph (like glg but with author and date) --- modules/git/README.md | 2 ++ modules/git/init.zsh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/modules/git/README.md b/modules/git/README.md index 23049ee..eaac944 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -103,6 +103,7 @@ Aliases - `gld` displays the diff log. - `glo` displays the one line log. - `glg` displays the graph log. + - `glG` displays the graph log with authors and dates. - `glb` displays the brief commit log. - `glc` displays the commit count for each contributor in descending order. @@ -160,6 +161,7 @@ Aliases - `gss` stashes the changes of the dirty working directory, including untracked. - `gsS` stashes the changes of the dirty working directory interactively. - `gsw` stashes the changes of the dirty working directory retaining the index. + - `gsu` unapplies (reverts) applied changes. ### Submodule diff --git a/modules/git/init.zsh b/modules/git/init.zsh index 16b2f30..e65d176 100644 --- a/modules/git/init.zsh +++ b/modules/git/init.zsh @@ -9,6 +9,7 @@ # Log _git_log_medium_format='%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B' _git_log_oneline_format='%C(green)%h%C(reset) %s%C(red)%d%C(reset)%n' +_git_log_fullgraph_format='%C(green)%h%C(reset) %<|(50,trunc)%s %C(bold blue)<%an>%C(reset) %C(yellow)(%cd)%C(reset)%C(auto)%d%C(reset)%n' _git_log_brief_format='%C(green)%h%C(reset) %s%n%C(blue)(%ar by %an)%C(red)%d%C(reset)%n' # @@ -97,6 +98,7 @@ alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"' alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"' alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"' +alias glG='git log --topo-order --all --graph --pretty=format:"${_git_log_fullgraph_format}" --date=relative' alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"' alias glc='git shortlog --summary --numbered' alias glS='git log --show-signature' @@ -148,6 +150,7 @@ alias gsr='git-stash-recover' alias gss='git stash save --include-untracked' alias gsS='git stash save --patch --no-keep-index' alias gsw='git stash save --include-untracked --keep-index' +alias gsu='git stash show -p | git apply -R' # Submodule (S) alias gS='git submodule'