Skip to content

Commit

Permalink
git-extra: fix notepad usage for commit messages
Browse files Browse the repository at this point in the history
Uh oh. It seems that the patch that got merged into `master` somehow
was not the patch that was tested, but instead a faulty one.

The problem was that `git config <key>` returns an error if the
key was not found and it made the code fail when no column wrapping
was configured (and besides, the test for the column wrapping was
inverted).

To prove that *this* commit is good, it was made using

	git -c core.editor=notepad -c format.commitmessagecolumns=72
	commit -s

This fixes git-for-windows/git#517

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Nov 9, 2015
1 parent 47b116e commit 715490a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions git-extra/scripts/notepad
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ notepad.exe "$1" &&
dos2unix.exe "$1" &&
case "$1" in
*/COMMIT_EDITMSG|*\\COMMIT_EDITMSG)
columns="$(git config format.commitmessagecolumns)" &&
if test -z "$columns"
then
! columns="$(git config format.commitmessagecolumns)" || {
msg="$(fmt.exe -s -w "$columns" "$1")" &&
printf "%s" "$msg" >"$1"
fi
}
;;
esac

0 comments on commit 715490a

Please sign in to comment.