From: Junio C Hamano Date: Wed, 15 Feb 2006 01:51:02 +0000 (-0800) Subject: Merge branch 'jc/commit' X-Git-Tag: v1.3.0-rc1~212 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/756e3ee0?hp=-c Merge branch 'jc/commit' * jc/commit: commit: detect misspelled pathspec while making a partial commit. combine-diff: diff-files fix (#2) combine-diff: diff-files fix. --- 756e3ee0c62b44bd700ffb2d58c371b45ea4598e diff --combined git-commit.sh index ab5e6bc1c8,fe9b6e7528..f7ee1aadee --- a/git-commit.sh +++ b/git-commit.sh @@@ -3,7 -3,7 +3,7 @@@ # Copyright (c) 2005 Linus Torvalds # Copyright (c) 2006 Junio C Hamano -USAGE='[-a] [-i] [-s] [-v] [--no-verify] [-m | -F | (-C|-c) ] [-e] [--author ] [...]' +USAGE='[-a] [-s] [-v] [--no-verify] [-m | -F | (-C|-c) ] [-e] [--author ] [[-i | -o] ...]' SUBDIRECTORY_OK=Yes . git-sh-setup @@@ -180,6 -180,7 +180,7 @@@ verify= verbose= signoff= force_author= + only_include_assumed= while case "$#" in 0) break;; esac do case "$1" in @@@ -340,12 -341,8 +341,8 @@@ case "$#,$also$only" i 0,) ;; *,) - echo >&2 "assuming --only paths..." - only_include_assumed="# Explicit paths specified without -i nor -o; assuming --include paths..." - also=t ++ only_include_assumed="# Explicit paths specified without -i nor -o; assuming --only paths..." + also= - - # If we are going to launch an editor, the message won't be - # shown without this... - test -z "$log_given$status_only" && sleep 1 ;; esac unset only @@@ -380,6 -377,8 +377,8 @@@ t, ;; ,t) save_index && + git-ls-files --error-unmatch -- "$@" >/dev/null || exit + git-diff-files --name-only -z -- "$@" | ( cd "$TOP" @@@ -408,7 -407,7 +407,7 @@@ refuse_partial "Different in index and the last commit: $dirty_in_index" fi - commit_only=`git-ls-files -- "$@"` + commit_only=`git-ls-files --error-unmatch -- "$@"` || exit # Build the temporary index and update the real index # the same way. @@@ -569,7 -568,10 +568,10 @@@ els PARENTS="" fi - run_status >>"$GIT_DIR"/COMMIT_EDITMSG + { + test -z "$only_include_assumed" || echo "$only_include_assumed" + run_status + } >>"$GIT_DIR"/COMMIT_EDITMSG if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ] then rm -f "$GIT_DIR/COMMIT_EDITMSG"