Browse Source

[git] Add `glr` alias for git reflog

and change the commit format to bold yellow, since that's the default
git log format for the commit when colored.

Closes #334

Copied from zimfw/git@013c9d9bf3dc21f3c5841565a8ee300a4e6bfaa7
Eric Nielsen 5 years ago
parent
commit
38b3b9517e
2 changed files with 6 additions and 4 deletions
  1. 1 0
      modules/git/README.md
  2. 5 4
      modules/git/init.zsh

+ 1 - 0
modules/git/README.md

@@ -107,6 +107,7 @@ Aliases
   * `glG` displays the graph log with authors and dates.
   * `glv` displays the log verifying the GPG signature of commits.
   * `glc` displays the commit count for each contributor in descending order.
+  * `glr` manages reflog information.
 
 ### Merge
 

+ 5 - 4
modules/git/init.zsh

@@ -6,11 +6,11 @@
 # Settings
 #
 
-# Log colour scheme has yellow commit hash, bold blue author, cyan date, auto ref names
+# Log colour scheme has bold yellow commit hash, bold blue author, cyan date, auto ref names
 # See https://git-scm.com/docs/pretty-formats
-_git_log_medium_format='%C(bold)Commit:%C(reset) %C(yellow)%H%C(auto)%d%n%C(bold)Author:%C(reset) %C(bold blue)%an <%ae>%n%C(bold)Date:%C(reset)   %C(cyan)%ai (%ar)%C(reset)%n%+B'
-_git_log_oneline_format='%C(yellow)%h%C(reset) %s%C(auto)%d%C(reset)'
-_git_log_oneline_medium_format='%C(yellow)%h%C(reset) %<|(60,trunc)%s %C(bold blue)<%an> %C(reset)%C(cyan)(%ar)%C(auto)%d%C(reset)'
+_git_log_medium_format='%C(bold)Commit: %C(yellow)%H%C(reset)%C(auto)%d%n%C(bold)Author:%C(reset) %C(bold blue)%an <%ae>%n%C(bold)Date:%C(reset)   %C(cyan)%ai (%ar)%C(reset)%n%+B'
+_git_log_oneline_format='%C(bold)%C(yellow)%h%C(reset) %s%C(auto)%d%C(reset)'
+_git_log_oneline_medium_format='%C(bold)%C(yellow)%h%C(reset) %<|(60,trunc)%s %C(bold blue)<%an> %C(reset)%C(cyan)(%ar)%C(auto)%d%C(reset)'
 
 #
 # Aliases
@@ -101,6 +101,7 @@ alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_onelin
 alias glG='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_medium_format}"'
 alias glv='git log --topo-order --show-signature --pretty=format:"${_git_log_medium_format}"'
 alias glc='git shortlog --summary --numbered'
+alias glr='git reflog'
 
 # Merge (m)
 alias gm='git merge'