From 668dc14b28b0fa25eab0470eb72b7a051cbacee1 Mon Sep 17 00:00:00 2001 From: KhasMek Date: Sun, 7 Jun 2015 11:20:38 -0600 Subject: [PATCH] Plugins: git - be less verbose with commits Remove the -v flag by default with the standard aliases gc, gc!, gca, and gca!, while adding new aliases for those that choose to put the entire diffs in their commit message. In some cases git -v ignores it's rules of cutting everything below the line: # ------------------------ >8 ------------------------ causing the full diff of the commit to be shown in the commit message. This is usually caused by commits that are heavy in shell style comments or mardown files with lots of headers defined (tldr: #'s, bangs). IMHO, and from my understanding of the creators of git and many others - showing a full diff in the commit message not only completely breaks the acceptable/expected format of "good" commit messages, but is also completely redundant and unnecessary. (If you have access to the commit message, more than likely you can access the diff of the commit via a multitude of other methods (CLI tools, GUI tools, web interfaces in a much nicer looking format.) --- plugins/git/git.plugin.zsh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index e42e09688..4c301fbbf 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -62,11 +62,16 @@ alias gbsg='git bisect good' alias gbsr='git bisect reset' alias gbss='git bisect start' -alias gc='git commit -v' -alias gc!='git commit -v --amend' -alias gca='git commit -v -a' -alias gca!='git commit -v -a --amend' -alias gcan!='git commit -v -a -s --no-edit --amend' +alias gc='git commit' +alias gc!='git commit --amend' +alias gca='git commit -a' +alias gca!='git commit -a --amend' +alias gcan!='git commit -a -s --no-edit --amend' +alias gcv='git commit -v' +alias gcv!='git commit -v --amend' +alias gcav='git commit -v -a' +alias gcav!='git commit -v -a --amend' +alias gcanv!='git commit -v -a -s --no-edit --amend' alias gcb='git checkout -b' alias gcf='git config --list' alias gcl='git clone --recursive'