Staging
v0.5.2
https://github.com/git/git
Revision ee34518d629331dadd58b1a75294369d679eda8b authored by Johannes Schindelin on 16 December 2005, 01:40:25 UTC, committed by Junio C Hamano on 16 December 2005, 01:56:32 UTC
This makes git-check-ref-format fail for "HEAD". Since the check is only
executed when creating refs, the existing symbolic ref is safe.

Otherwise these commands, most likely are pilot errors, would do
pretty funky stuff:

	git checkout -b HEAD
	git pull . other:HEAD

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 06d900c
Raw File
Tip revision: ee34518d629331dadd58b1a75294369d679eda8b authored by Johannes Schindelin on 16 December 2005, 01:40:25 UTC
We do not like "HEAD" as a new branch name
Tip revision: ee34518
git-grep.sh
#!/bin/sh
#
# Copyright (c) Linus Torvalds, 2005
#

USAGE='<option>... <pattern> <path>...'
SUBDIRECTORY_OK='Yes'
. git-sh-setup

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
[ "$pattern" ] || {
	usage
}
git-ls-files -z "${git_flags[@]}" "$@" |
	xargs -0 grep "${flags[@]}" -e "$pattern"
back to top