Skip to content

Commit

Permalink
git: update pretty log format
Browse files Browse the repository at this point in the history
Move the pretty log format into a `[pretty]` entry so that it can more
easily be used by other aliases. The new pretty log format places the
author name and date at the end of the line since the sha, commit
message, and branch tend to be the more important information. The
branch is now displayed as cyan, to match the color used for the branch
display in my bash prompt.

Since the `git graph` alias is identical to `git logp` apart from the
`--graph` flag, use the `logp` alias in the `graph` alias.
  • Loading branch information
necolas committed Mar 2, 2012
1 parent 6928bfb commit 1820f3e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
# Diff overview
diffst = diff --stat

# tut: http://gitimmersion.com/lab_10.html
# ref: http://linux.die.net/man/1/git-log
# Result: abc1234 5 hours ago | Commit message (HEAD, origin/master, master) [Nicolas Gallagher]
# Custom graph log
graph = log --pretty=format:'%C(yellow)%h%C(reset) %ar | %s%C(green)%d%C(reset) [%an]' --all --date-order --graph
# Custom graph log (note, uses `logp` alias)
graph = !git logp --graph
# Custom pretty log
logp = log --pretty=format:'%C(yellow)%h%C(reset) %ar | %s%C(green)%d%C(reset) [%an]' --all --date-order
logp = log --pretty=nice --all --date-order

# Diffstat log
logst = log --stat
Expand All @@ -44,3 +41,9 @@

[difftool]
prompt = false

[pretty]
# tut: http://gitimmersion.com/lab_10.html
# ref: http://linux.die.net/man/1/git-log
# Result: abc1234 Commit message (HEAD, origin/master, master) -- Nicolas Gallagher; 5 hours ago
nice = "%C(yellow)%h%C(reset) %C(white)%s%C(cyan)%d%C(reset) -- %an; %ar"

0 comments on commit 1820f3e

Please sign in to comment.