Hi,

git commit takes a --verbose option, defined as follows:

       -v, --verbose
           Show unified diff between the HEAD commit and what would be 
committed at the
           bottom of the commit message template. Note that this diff output 
doesn’t
           have its lines prefixed with #.

It's very useful for making sure you're committing the right thing. Unfortunately, it seems that the diff output isn't stripped before the commit message is fed to the commit-msg hook.

I was committing a change to a README file, and the diff context contained the line " * for the cppunittest needed:" (followed by a line beginning with a "+" marking an added line). So, commit-msg saw a line which starts with whitespace, followed by a star, with a colon in it and rejected my commit message:

Reason: Please don't use whitespace in front of '* file: Description.' entries.

I don't know whether it's possible to tweak something so that the hook receives the message without the unified diff; otherwise, perhaps the hook should stop reading lines past something which looks like a unified diff header.

Regards,
--
Will
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to