Revision 78d9d414123ad6f4f522ffecbcd9e4a7562948fd authored by Linus Torvalds on 15 July 2005, 23:08:01 UTC, committed by Linus Torvalds on 15 July 2005, 23:08:01 UTC
Now, not all projects can be as refined as Linux.  Before the final 1.0
release, we went through fifteen 0.99 patchfiles, and pl14 alone went
through subreleases 'a' through 'z'. Now _that_ is a release process.

Not to mention the odd-ball releases, like 0.96c+

Sadly, in this day and age of RPM's etc, we have silly limitations, and
I cannot call this release '0.99pl5a or some such awe-inspiring name
just because "rpmbuild" is such a party pooper.  So it's just 0.99.1.

Oh well.  Aspiring to such greatness as the Linux release numbering is
hubris anyway.  You can attain such perfection only once in your life.
1 parent 71931c1
Raw File
git-commit-script
#!/bin/sh
#
# Copyright (c) 2005 Linus Torvalds
#

. git-sh-setup-script || die "Not a git archive"

usage () {
	die 'git commit [-m existing-commit] [<path>...]'
}

while case "$#" in 0) break ;; esac
do
    case "$1" in
    -m) shift
        case "$#" in
	0) usage ;;
	*) use_commit=`git-rev-parse "$1"` ||
	   exit ;;
	esac
	;;
    *)  break
        ;;
    esac
    shift
done

git-update-cache -q --refresh -- "$@" || exit 1
PARENTS="-p HEAD"
if [ ! -r "$GIT_DIR/HEAD" ]; then
	if [ -z "$(git-ls-files)" ]; then
		echo Nothing to commit 1>&2
		exit 1
	fi
	(
		echo "#"
		echo "# Initial commit"
		echo "#"
		git-ls-files | sed 's/^/# New file: /'
		echo "#"
	) > .editmsg
	PARENTS=""
else
	if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
		echo "#"
		echo "# It looks like your may be committing a MERGE."
		echo "# If this is not correct, please remove the file"
		echo "#	$GIT_DIR/MERGE_HEAD"
		echo "# and try again"
		echo "#"
		PARENTS="-p HEAD -p MERGE_HEAD"
	elif test "$use_commit" != ""
	then
		pick_author_script='
		/^author /{
			h
			s/^author \([^<]*\) <[^>]*> .*$/\1/
			s/'\''/'\''\'\'\''/g
			s/.*/GIT_AUTHOR_NAME='\''&'\''/p

			g
			s/^author [^<]* <\([^>]*\)> .*$/\1/
			s/'\''/'\''\'\'\''/g
			s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p

			g
			s/^author [^<]* <[^>]*> \(.*\)$/\1/
			s/'\''/'\''\'\'\''/g
			s/.*/GIT_AUTHOR_DATE='\''&'\''/p

			q
		}
		'
		set_author_env=`git-cat-file commit "$use_commit" |
		sed -ne "$pick_author_script"`
		eval "$set_author_env"
		export GIT_AUTHOR_NAME
		export GIT_AUTHOR_EMAIL
		export GIT_AUTHOR_DATE
		git-cat-file commit "$use_commit" |
		sed -e '1,/^$/d'
	fi >.editmsg
	git-status-script >>.editmsg
fi
if [ "$?" != "0" ]
then
	cat .editmsg
	rm .editmsg
	exit 1
fi
case "$use_commit" in
'')
	${VISUAL:-${EDITOR:-vi}} .editmsg
	;;
esac
grep -v '^#' < .editmsg | git-stripspace > .cmitmsg
[ -s .cmitmsg ] && 
	tree=$(git-write-tree) &&
	commit=$(cat .cmitmsg | git-commit-tree $tree $PARENTS) &&
	echo $commit > "$GIT_DIR/HEAD" &&
	rm -f -- "$GIT_DIR/MERGE_HEAD"
ret="$?"
rm -f .cmitmsg .editmsg
exit "$ret"
back to top