2012-05-21 21:25:07 +00:00
|
|
|
#
|
|
|
|
# Lists lost Git commits.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
|
2017-07-06 23:01:26 +00:00
|
|
|
# function git-commit-lost {
|
|
|
|
|
2012-09-30 19:30:18 +00:00
|
|
|
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
|
|
|
print "$0: not a repository work tree: $PWD" >&2
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2012-05-21 21:25:07 +00:00
|
|
|
git fsck 2> /dev/null \
|
|
|
|
| grep "^dangling commit" \
|
|
|
|
| awk '{print $3}' \
|
|
|
|
| git log \
|
|
|
|
--date-order \
|
|
|
|
--no-walk \
|
|
|
|
--stdin \
|
2012-10-02 02:26:24 +00:00
|
|
|
--pretty=format:${_git_log_oneline_format}
|
2017-07-06 23:01:26 +00:00
|
|
|
|
|
|
|
# }
|