Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Christian's git-attic script.
There are times I would have killed to have something like this.
  • Loading branch information
unixorn committed Jun 11, 2017
commit 038ddb47edbf97e8516a7f0ccd2fc0352b78a0df
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ If you aren't using any zsh frameworks, or if you're a bash user, do the followi

| Script | Original Source | Description |
| ------ | --------------- | ----------- |
| `git-attic` | Christian Neukirchen's [blog](http://chneukirchen.org/blog/archive/2013/01/a-grab-bag-of-git-tricks.html) | Displays a list of deleted files in your repo. The output is designed to be copy’n’pasted: Pass the second field to git show to display the file contents, or just select the hash without ^ to see the commit where removal happened. |
| `git-big-file` | Mislav Marohnić's [dotfiles](https://github.com/mislav/dotfiles) | Show files in the repo larger than a threshold size |
| `git-change-author` | Michael Demmer in [jut-io/git-scripts](https://github.com/jut-io/git-scripts/blob/master/bin/git-change-author) | Change one author/email in the history to another |
| `git-change-log` | John Wiegley's [git-scripts](https://github.com/jwiegley/git-scripts) | turn `git log` output into a complete Changelog for projects that haven't been maintaining one |
Expand Down
18 changes: 18 additions & 0 deletions bin/git-attic
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# git-attic [-M] [PATH] - list deleted files of Git repositories
#
# Use -M to not show renamed files, and other git-log options as you like.
#
# The output is designed to be copy’n’pasted: Pass the second field to
# git show to display the file contents, or just select the hash without ^ to
# see the commit where removal happened
#
# Source: http://chneukirchen.org/blog/archive/2013/01/a-grab-bag-of-git-tricks.html


git log --raw --no-renames --date=short --format="%h %cd" "$@" |
awk '/^[0-9a-f]/ { commit=$1; date=$2 }
/^:/ && $5 == "D" { print date, commit "^:" $6 }' |
git -p column

set -o pipefail