aboutsummaryrefslogtreecommitdiff
path: root/git-grep.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-28 22:34:34 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-28 22:34:34 -0700
commit7d55561986ffe94ca7ca22dc0a6846f698893226 (patch)
tree220ecd5d179f5b12f0f5aa0bb511faac0699aa0d /git-grep.sh
parentac58c7b18ecf1c2ef41c848879e8b1838162db54 (diff)
parent3fb3cc69af397ee68774485042d6b48a49417c1a (diff)
downloadgit-7d55561986ffe94ca7ca22dc0a6846f698893226.tar.gz
git-7d55561986ffe94ca7ca22dc0a6846f698893226.tar.xz
Merge branch 'jc/dirwalk-n-cache-tree' into jc/cache-tree
* jc/dirwalk-n-cache-tree: (212 commits) builtin-rm: squelch compiler warnings. Add builtin "git rm" command Move pathspec matching from builtin-add.c into dir.c Prevent bogus paths from being added to the index. builtin-add: fix unmatched pathspec warnings. Remove old "git-add.sh" remnants builtin-add: warn on unmatched pathspecs Do "git add" as a builtin Clean up git-ls-file directory walking library interface libify git-ls-files directory traversal Add a conversion tool to migrate remote information into the config fetch, pull: ask config for remote information Fix build procedure for builtin-init-db read-tree -m -u: do not overwrite or remove untracked working tree files. apply --cached: do not check newly added file in the working tree Implement a --dry-run option to git-quiltimport Implement git-quiltimport Revert "builtin-grep: workaround for non GNU grep." builtin-grep: workaround for non GNU grep. builtin-grep: workaround for non GNU grep. ...
Diffstat (limited to 'git-grep.sh')
-rwxr-xr-xgit-grep.sh62
1 files changed, 0 insertions, 62 deletions
diff --git a/git-grep.sh b/git-grep.sh
deleted file mode 100755
index ad4f2fe81..000000000
--- a/git-grep.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) Linus Torvalds, 2005
-#
-
-USAGE='[<option>...] [-e] <pattern> [<path>...]'
-SUBDIRECTORY_OK='Yes'
-. git-sh-setup
-
-got_pattern () {
- if [ -z "$no_more_patterns" ]
- then
- pattern="$1" no_more_patterns=yes
- else
- die "git-grep: do not specify more than one pattern"
- fi
-}
-
-no_more_patterns=
-pattern=
-flags=()
-git_flags=()
-while : ; do
- case "$1" in
- -o|--cached|--deleted|--others|--killed|\
- --ignored|--modified|--exclude=*|\
- --exclude-from=*|\--exclude-per-directory=*)
- git_flags=("${git_flags[@]}" "$1")
- ;;
- -e)
- got_pattern "$2"
- shift
- ;;
- -A|-B|-C|-D|-d|-f|-m)
- flags=("${flags[@]}" "$1" "$2")
- shift
- ;;
- --)
- # The rest are git-ls-files paths
- shift
- break
- ;;
- -*)
- flags=("${flags[@]}" "$1")
- ;;
- *)
- if [ -z "$no_more_patterns" ]
- then
- got_pattern "$1"
- shift
- fi
- [ "$1" = -- ] && shift
- break
- ;;
- esac
- shift
-done
-[ "$pattern" ] || {
- usage
-}
-git-ls-files -z "${git_flags[@]}" -- "$@" |
- xargs -0 grep "${flags[@]}" -e "$pattern" --