diff --git a/README.md b/README.md index bd08f2a..ef30ac5 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ _338 TILs and counting..._ - [Reference A Commit Via Commit Message Pattern Matching](git/reference-a-commit-via-commit-message-pattern-matching.md) - [Renaming A Branch](git/renaming-a-branch.md) - [Resetting A Reset](git/resetting-a-reset.md) +- [Show The diffstat Summary Of A Commit](git/show-the-diffstat-summary-of-a-commit.md) - [Single Key Presses in Interactive Mode](git/single-key-presses-in-interactive-mode.md) - [Staging Changes Within Vim](git/staging-changes-within-vim.md) - [Staging Stashes Interactively](git/staging-stashes-interactively.md) diff --git a/git/show-the-diffstat-summary-of-a-commit.md b/git/show-the-diffstat-summary-of-a-commit.md new file mode 100644 index 0000000..910231f --- /dev/null +++ b/git/show-the-diffstat-summary-of-a-commit.md @@ -0,0 +1,25 @@ +# Show The diffstat Summary Of A Commit + +Use the `--stat` flag when running `git show` on a commit to see the +`diffstat` summary of that commit. For instance, this is what I get for a +recent commit to [delve](https://github.com/derekparker/delve): + +```bash +$ git show 8a1f36a1ce --stat +commit 8a1f36a1ce71d708d1d82afbc2191de9aefba021 +Author: Derek Parker +Date: Wed Jan 27 23:47:04 2016 -0800 + + dlv: Flag to print stacktrace on trace subcommand + + cmd/dlv/main.go | 45 ++++++++++----------------------------------- + terminal/command.go | 7 +++++-- + 2 files changed, 15 insertions(+), 37 deletions(-) +``` + +The following is a description of the `diffstat` program + +> This program reads the output of diff and displays a histogram of the +> insertions, deletions, and modifications per-file. + +See `man git-show` and `man diffstat` for more details.