Could #-ignoring in commit message be smarter?
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 4, 2010, 22:24 UTC
- Message-ID
- <AANLkTimgt6kjTkc+gxyOmTz03bdnfiRzgt4p8vymQ=VY@mail.gmail.com>
On Sat, Sep 4, 2010 at 21:55, Sverre Rabbelier <srabbelier@gmail.com> wrote:
Show 8 quoted lines
> Heya, > > On Sat, Sep 4, 2010 at 16:37, Ramana Kumar <ramana.kumar@gmail.com> wrote: >> The commit message message says "Lines starting with '#' will be >> ignored", but fails to say "Lines below this message will be ignored, >> even if they don't start with '#'". > > Because they're not. Only those starting with # are ignored.
Which also sucks a bit. I've been bit by writing commits messages like this numerous times:
parser: fix non-\W issues
This change is here to fix screwups of special characters like %, !,
#, ^ and other non-\W chars.These characters screw up our parser.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: parser.cWhere I'm referencing the #-character in the commit message itself for some reason, and due to word wrapping it just *happens* to end up at the start of a line. So the commit message silently becomes:
parser: fix non-\W issues
This change is here to fix screwups of special characters like %, !,
These characters screw up our parser.
The main reason for why this probably can't be fixed is that we've painted ourselves into a corner with git rebase -i squash and fixup messages, which will insert comments themselves.
Still *maybe* we could handle this better for the common case. E.g. if we're *not* inside a rebase only ignore the continuous and unbroken lines starting with # at the bottom. But that'd probably break something I'm not thinking of.