summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5bea5cb)
raw | patch | inline | side by side (parent: 5bea5cb)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 10 Oct 2008 11:43:16 +0000 (13:43 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 10 Oct 2008 11:49:35 +0000 (13:49 +0200) |
NEWS | patch | blob | history | |
contrib/tig-completion.bash | patch | blob | history |
index 0b891f9aa8b73266b2e3aea23ab82dec880c9e7e..7b9c0feeef14d64ad23338275906afd0a6942b98 100644 (file)
--- a/NEWS
+++ b/NEWS
- Display repository references in the sorted order: tags, heads,
tracked remotes, remotes.
+ - Add bash completion for blame.
tig-0.12.1
----------
index 79b414bab42235a82d249e49ba24de6c52ed3b7f..40bfcfa53ad557c3303ec38db102524224910b32 100755 (executable)
__tig_complete_revlist
}
+_tig_blame ()
+{
+ local reply="" ref=HEAD cur="${COMP_WORDS[COMP_CWORD]}"
+
+ if test "$COMP_CWORD" -lt 3; then
+ reply="$(__tig_refs)"
+ else
+ ref="${COMP_WORDS[2]}"
+ fi
+
+ reply="$reply $(git --git-dir="$(__tigdir)" ls-tree "$ref" \
+ | sed '/^100... blob /s,^.* ,,
+ /^040000 tree /{
+ s,^.* ,,
+ s,$,/,
+ }
+ s/^.* //')"
+ _tigcomp "$reply"
+}
+
_tig_show ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
-*) _tig_options ;;
- *) _tigcomp "status show $(__tig_refs)" ;;
+ *) _tigcomp "blame status show $(__tig_refs)" ;;
esac
return
fi
case "$command" in
+ blame) _tig_blame ;;
show) _tig_show ;;
status) ;;
*) _tigcomp "