2012-05-22 05:22:49 +08:00
|
|
|
#
|
|
|
|
# Lists dropped Git stashed states.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
|
2017-07-07 07:01:26 +08:00
|
|
|
# function git-stash-dropped {
|
|
|
|
|
2018-03-05 16:56:25 +08:00
|
|
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
2012-10-01 03:30:18 +08:00
|
|
|
print "$0: not a repository work tree: $PWD" >&2
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2018-03-05 16:56:25 +08:00
|
|
|
command git fsck --unreachable 2> /dev/null \
|
2012-05-22 05:22:49 +08:00
|
|
|
| grep 'commit' \
|
|
|
|
| awk '{print $3}' \
|
2018-03-05 16:56:25 +08:00
|
|
|
| command git log \
|
2021-05-11 13:35:47 +08:00
|
|
|
--pretty=format:$_git_log_oneline_format \
|
2012-05-22 05:22:49 +08:00
|
|
|
--extended-regexp \
|
|
|
|
--grep="${1:-(WIP )?[Oo]n [^:]+:}" \
|
|
|
|
--merges \
|
|
|
|
--no-walk \
|
|
|
|
--stdin
|
2017-07-07 07:01:26 +08:00
|
|
|
|
|
|
|
# }
|