1
0
mirror of https://github.com/git/git.git synced 2024-11-18 02:23:52 +01:00

[PATCH] Buglets fix in the new two scripts

Should be obvious...

 - Use $VISUAL, $EDITOR, in this order if set, and fall back on
   vi.

 - Status R, C, D, N usually are followed by number, so adjust
   case arms to that pattern.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Junio C Hamano 2005-05-30 13:53:45 -07:00 committed by Linus Torvalds
parent 866b973b5d
commit 2036d84102
2 changed files with 8 additions and 10 deletions

@ -5,9 +5,7 @@ then
cat .editmsg
exit 1
fi
ED=${VISUAL:$EDITOR}
ED=${ED:vi}
$ED .editmsg
${VISUAL:-${EDITOR:-vi}} .editmsg
grep -v '^#' < .editmsg | git-stripspace > .cmitmsg
[ -s .cmitmsg ] || exit 1
tree=$(git-write-tree) || exit 1

@ -13,13 +13,13 @@ report () {
trailer="#
"
case "$status" in
M) echo "# modified: $name";;
D) echo "# deleted: $name";;
T) echo "# typechange: $name";;
C) echo "# copied: $name -> $newname";;
R) echo "# renamed: $name -> $newname";;
N) echo "# new file: $name";;
U) echo "# unmerged: $name";;
M ) echo "# modified: $name";;
D*) echo "# deleted: $name";;
T ) echo "# typechange: $name";;
C*) echo "# copied: $name -> $newname";;
R*) echo "# renamed: $name -> $newname";;
N*) echo "# new file: $name";;
U ) echo "# unmerged: $name";;
esac
done
echo -n "$trailer"