Could #-ignoring in commit message be smarter?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 4, 2010 at 21:55, Sverre Rabbelier <srabbelier@xxxxxxxxx> wrote:
> Heya,
>
> On Sat, Sep 4, 2010 at 16:37, Ramana Kumar <ramana.kumar@xxxxxxxxx> 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.c

Where 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]