File: git-log

package info (click to toggle)
yash 2.50-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,036 kB
  • sloc: ansic: 33,211; makefile: 839; sh: 477; sed: 16
file content (75 lines) | stat: -rw-r--r-- 2,058 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# (C) 2011-2016 magicant

# Completion script for the "git-log" command.
# Supports Git 2.11.0.

function completion/git-log {
	WORDS=(git log "${WORDS[2,-1]}")
	command -f completion//reexecute
}

function completion/git::log:arg {

	OPTIONS=()
	command -f completion/git::log:getopt

	command -f completion//parseoptions -n
	case $ARGOPT in
		(-)
			command -f completion//completeoptions
			;;
		('')
			command -f completion/git::completerefpath range=true
			;;
		(*)
			command -f completion/git::log:compopt
			;;
	esac

}

function completion/git::log:getopt {
	OPTIONS=("$OPTIONS" #>#
	"--bisect; show commits between good and bad only"
	"--decorate::; show ref names of commits"
	"--follow; show history beyond filename renaming"
	"--full-diff; show diffs for all files affected in each commit"
	"L:; specify a range in a file to trace history"
	"--log-size; print its size before printing log messages"
	"--no-decorate; like --decorate=no"
	"--source; show from which ref each commit was reached"
	"--use-mailmap; canonicalize authors, committers and emails"
	) #<#
	if command -vf completion/git::rev-list:getopt >/dev/null 2>&1 ||
			. -AL completion/git-rev-list; then
		command -f completion/git::rev-list:getopt
	fi
	if command -vf completion/git::diff-tree:getopt >/dev/null 2>&1 ||
			. -AL completion/git-diff-tree; then
		command -f completion/git::diff-tree:getopt
	fi
}

function completion/git::log:compopt
	case $ARGOPT in
		(--decorate) #>>#
			complete -P "$PREFIX" -D "like short, only if outputting to a terminal" auto
			complete -P "$PREFIX" -D "show full ref names" full
			complete -P "$PREFIX" -D "show ref names without prefixes" short
			complete -P "$PREFIX" -D "don't show ref names" no
			;; #<<#
		(L)
			case $TARGETWORD in (?*:*)
				typeset w="${TARGETWORD#?*:}"
				typeset PREFIX="${TARGETWORD%"$w"}"
				command -f completion/git::completepath -r
			esac
			;;
		(*)
			command -f completion/git::rev-list:compopt ||
			command -f completion/git::diff:compopt
			;;
	esac


# vim: set ft=sh ts=8 sts=8 sw=8 noet: