Staging
v0.5.2
https://github.com/git/git
Revision 0d214b6619bf14a6409a2a1ba079f3530d40ee41 authored by Fredrik Kuivinen on 13 September 2005, 21:40:23 UTC, committed by Junio C Hamano on 13 September 2005, 22:45:24 UTC
git-merge.sh does this for us.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent d9a23fa
Raw File
Tip revision: 0d214b6619bf14a6409a2a1ba079f3530d40ee41 authored by Fredrik Kuivinen on 13 September 2005, 21:40:23 UTC
[PATCH] Don't output 'Automatic merge failed, ...'
Tip revision: 0d214b6
git-grep.sh
#!/bin/sh
#
# Copyright (c) Linus Torvalds, 2005
#

pattern=
flags=()
git_flags=()
while : ; do
	case "$1" in
	--cached|--deleted|--others|--killed|\
	--ignored|--exclude=*|\
	--exclude-from=*|\--exclude-per-directory=*)
		git_flags=("${git_flags[@]}" "$1")
		;;
	-e)
		pattern="$2"
		shift
		;;
	-A|-B|-C|-D|-d|-f|-m)
		flags=("${flags[@]}" "$1" "$2")
		shift
		;;
	--)
		# The rest are git-ls-files paths (or flags)
		shift
		break
		;;
	-*)
		flags=("${flags[@]}" "$1")
		;;
	*)
		if [ -z "$pattern" ]; then
			pattern="$1"
			shift
		fi
		break
		;;
	esac
	shift
done
git-ls-files -z "${git_flags[@]}" "$@" |
	xargs -0 grep "${flags[@]}" "$pattern"
back to top