Git fork

git-jump: add an optional argument '--stdout'

It can be used with M-x grep on Emacs.

Signed-off-by: Yoichi Nakayama <yoichi.nakayama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Yoichi Nakayama and committed by
Junio C Hamano
cfb7b3b3 a0789512

+33 -2
+9 -1
contrib/git-jump/README
··· 79 git config jump.grepCmd "ag --column" 80 -------------------------------------------------- 81 82 83 Related Programs 84 ---------------- ··· 100 ----------- 101 102 This script was written and tested with vim. Given that the quickfix 103 - format is the same as what gcc produces, I expect emacs users have a 104 similar feature for iterating through the list, but I know nothing about 105 how to activate it. 106
··· 79 git config jump.grepCmd "ag --column" 80 -------------------------------------------------- 81 82 + You can use the optional argument '--stdout' to print the listing to 83 + standard output instead of feeding it to the editor. You can use the 84 + argument with M-x grep on Emacs: 85 + 86 + -------------------------------------------------- 87 + # In Emacs, M-x grep and invoke "git jump --stdout <mode>" 88 + M-x grep<RET>git jump --stdout diff<RET> 89 + -------------------------------------------------- 90 91 Related Programs 92 ---------------- ··· 108 ----------- 109 110 This script was written and tested with vim. Given that the quickfix 111 + format is the same as what gcc produces, I expect other tools have a 112 similar feature for iterating through the list, but I know nothing about 113 how to activate it. 114
+24 -1
contrib/git-jump/git-jump
··· 2 3 usage() { 4 cat <<\EOF 5 - usage: git jump <mode> [<args>] 6 7 Jump to interesting elements in an editor. 8 The <mode> parameter is one of: ··· 15 configured, to the command in `jump.grepCmd`. 16 17 ws: elements are whitespace errors. Arguments are given to diff --check. 18 EOF 19 } 20 ··· 64 git diff --check "$@" 65 } 66 67 if test $# -lt 1; then 68 usage >&2 69 exit 1 70 fi 71 mode=$1; shift 72 73 trap 'rm -f "$tmp"' 0 1 2 3 15 74 tmp=`mktemp -t git-jump.XXXXXX` || exit 1
··· 2 3 usage() { 4 cat <<\EOF 5 + usage: git jump [--stdout] <mode> [<args>] 6 7 Jump to interesting elements in an editor. 8 The <mode> parameter is one of: ··· 15 configured, to the command in `jump.grepCmd`. 16 17 ws: elements are whitespace errors. Arguments are given to diff --check. 18 + 19 + If the optional argument `--stdout` is given, print the quickfix 20 + lines to standard output instead of feeding it to the editor. 21 EOF 22 } 23 ··· 67 git diff --check "$@" 68 } 69 70 + use_stdout= 71 + while test $# -gt 0; do 72 + case "$1" in 73 + --stdout) 74 + use_stdout=t 75 + ;; 76 + --*) 77 + usage >&2 78 + exit 1 79 + ;; 80 + *) 81 + break 82 + ;; 83 + esac 84 + shift 85 + done 86 if test $# -lt 1; then 87 usage >&2 88 exit 1 89 fi 90 mode=$1; shift 91 + if test "$use_stdout" = "t"; then 92 + "mode_$mode" "$@" 93 + exit 0 94 + fi 95 96 trap 'rm -f "$tmp"' 0 1 2 3 15 97 tmp=`mktemp -t git-jump.XXXXXX` || exit 1