# Could #-ignoring in commit message be smarter?

3 messages from 2010-09-04 to 2010-09-04. Participants: Ævar Arnfjörð Bjarmason, Sverre Rabbelier.
Thread: https://gitlist.dev/t/24978

## Ævar Arnfjörð Bjarmason, 2010-09-04 22:24

Subject: Could #-ignoring in commit message be smarter?
Message-ID: <AANLkTimgt6kjTkc+gxyOmTz03bdnfiRzgt4p8vymQ=VY@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimgt6kjTkc%2BgxyOmTz03bdnfiRzgt4p8vymQ%3DVY%40mail.gmail.com

```
On Sat, Sep 4, 2010 at 21:55, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> 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.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.

```

## Sverre Rabbelier, 2010-09-04 22:30

Subject: Re: Could #-ignoring in commit message be smarter?
Message-ID: <AANLkTinTxFveiuJvCUyB5Hghj-Jy+=LfhPJhtW1UYkSH@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinTxFveiuJvCUyB5Hghj-Jy%2B%3DLfhPJhtW1UYkSH%40mail.gmail.com
In-Reply-To: <AANLkTimgt6kjTkc+gxyOmTz03bdnfiRzgt4p8vymQ=VY@mail.gmail.com>

```
Heya,

On Sat, Sep 4, 2010 at 17:24, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> 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:

Isn't this rare enough that it's not really a problem? I mean, sure,
when it happens it's a PITA, but it's about as painful as doing `git
commit -m "Yay, it works!"` and having bash history magic blow it
away. After a while you get used to it and either remember to escape
the bang, or not use it?

-- 
Cheers,

Sverre Rabbelier

```

## Ævar Arnfjörð Bjarmason, 2010-09-04 22:44

Subject: Re: Could #-ignoring in commit message be smarter?
Message-ID: <AANLkTinRE9tLBxCXApvJ9dM9cAUVAAcAWn-N1AkW-bVz@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinRE9tLBxCXApvJ9dM9cAUVAAcAWn-N1AkW-bVz%40mail.gmail.com
In-Reply-To: <AANLkTinTxFveiuJvCUyB5Hghj-Jy+=LfhPJhtW1UYkSH@mail.gmail.com>

```
On Sat, Sep 4, 2010 at 22:30, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> Heya,
>
> On Sat, Sep 4, 2010 at 17:24, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
>> 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:
>
> Isn't this rare enough that it's not really a problem? I mean, sure,
> when it happens it's a PITA, but it's about as painful as doing `git
> commit -m "Yay, it works!"` and having bash history magic blow it
> away. After a while you get used to it and either remember to escape
> the bang, or not use it?

With the bash thing you *notice* it, but in most cases like these what
you actually do is *not* notice it, then scratch your head a month
later at a commit message that makes no sense.

Anyway, it's obviously not a huge issue since we don't have people
complaining about it more often. But it's really annoying when it
happens.

```
