X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-applypatch.sh;h=8df2aee4c2d031ac10c66af0a079bd022c281c0d;hb=6fe5b7ff6cafcc94415deba2f3d611770d8e6b1e;hp=4c577eb835b877dd0766edbc5a603ee4e3db049a;hpb=bf3e274873e56d7df25d60800c8d59a309e0d8c6;p=git.git diff --git a/git-applypatch.sh b/git-applypatch.sh index 4c577eb83..8df2aee4c 100755 --- a/git-applypatch.sh +++ b/git-applypatch.sh @@ -10,8 +10,12 @@ ## $3 - "info" file with Author, email and subject ## $4 - optional file containing signoff to add ## + +USAGE=' []' . git-sh-setup +case "$#" in 3|4) ;; *) usage ;; esac + final=.dotest/final-commit ## ## If this file exists, we ask before applying @@ -83,7 +87,7 @@ while [ "$interactive" = yes ]; do echo "--------------------------" cat "$final" echo "--------------------------" - echo -n "Apply? [y]es/[n]o/[e]dit/[a]ccept all " + printf "Apply? [y]es/[n]o/[e]dit/[a]ccept all " read reply case "$reply" in y|Y) interactive=no;; @@ -178,7 +182,7 @@ git-apply --index "$PATCHFILE" || { # This is not so wrong. Depending on which base we picked, # orig_tree may be wildly different from ours, but his_tree # has the same set of wildly different changes in parts the - # patch did not touch, so resolve ends up cancelling them, + # patch did not touch, so resolve ends up canceling them, # saying that we reverted all those changes. if git-merge-resolve $orig_tree -- HEAD $his_tree @@ -200,7 +204,7 @@ echo Wrote tree $tree parent=$(git-rev-parse --verify HEAD) && commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1 echo Committed: $commit -git-update-ref HEAD $commit $parent || exit +git-update-ref -m "applypatch: $SUBJECT" HEAD $commit $parent || exit if test -x "$GIT_DIR"/hooks/post-applypatch then