News for hackers. Stuff that matters.
Re:Git commit accepts several message flags (-m) to allow mu... by fphilipe on Wednesday July 08, 2020 @07:45AM (#23768938)
Sure, but how would you format your message so the lines aren't longer than 80 chars? I guess you can edit the command to read from STDIN, but that sounds much more cumbersome than passing -e:

    git commit -F- <<EOF
    Fix issue

    Hello world...
    EOF
Re:Git commit accepts several message flags (-m) to allow mu... by masklinn on Wednesday July 08, 2020 @08:06AM (#23769066)
> Sure, but how would you format your message so the lines aren't longer than 80 chars?

Put linebreaks and fill-paragraph for the later lines? You can put linebreaks in quoted shell strings, so once it's in an editor buffer there's no issue with that.

> I guess you can edit the command to read from STDIN

The use case here is "I've already started writing a commit message inline, I now realise I need more room, I don't want to bother copy/pasting stuff around".

If I know from the start that I will need more than just a shortdesc, I'll obviously be crafting the message in my editor in the first place.

Re:Git commit accepts several message flags (-m) to allow mu... by u801e on Wednesday July 08, 2020 @08:34PM (#23775815)
Maybe something like

  fold -c -s -w 80 | git commit -F - <<EOF
  Fix issue

  Hello world...
  EOF