git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Wrap commit messages on `git commit -m`

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Nov 4, 2012, 07:27 UTC
Message-ID
<CALUzUxrdCw6nPLzeLHij+CjHsPO3w=e0nUdjBL=P7rqJtZ+t3A@mail.gmail.com>
In-Reply-To
<m3a9v170ca.fsf@black.gullik.net>
On Thu, Nov 1, 2012 at 11:29 AM, Lars Gullik Bjønnes <larsbj@gullik.org> wrote:
Show 20 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
> | Hi,
>>
> | Some of my colleagues are lazy to fire up an editor and write proper
> | commit messages- they often write one-liners using `git commit -m`.
> | However, that line turns out to be longer than 72 characters, and the
> | resulting `git log` output is ugly.  So, I was wondering if it would
> | be a good idea to wrap these one-liners to 72 characters
> | automatically.
>
> git commit -m 'foo: fix this problem
>
> This problem is fixed by doing foo,
> bar and baz.
>
> Signed-off-by: me
> '
>
> works.

Perhaps a deeper issue is that the implicit email format (subject-body) for commit messages, is, well, implicit. New users of git who type git-commit -m '...' isn't going to know that those few characters will all be lumped on a "subject" line, forever screwing themselves when they review the output of git-log, git-rebase --interactive, etc. (can't remember off the top of my head if git-format-patch would chop off long subjects and move it to the body), which may be a significant period of time (and thus commits) later.

While I don't have any ideas on how to improve on this, hopefully this gets recognized as an issue in the first place.

-- 
Cheers,
Ray Chuan
Previous: Phil HordNext: Thomas Adam
Message 9 of 11 in “Wrap commit messages on `git commit -m`”
  1. Ramkumar RamachandraNov 1, 2012
  2. Lars Gullik BjønnesNov 1, 2012
  3. KevinNov 1, 2012
  4. Jonathan NiederNov 1, 2012
  5. Ramkumar RamachandraNov 2, 2012
  6. Jonathan NiederNov 3, 2012
  7. David AguilarNov 3, 2012
  8. Phil HordNov 3, 2012
  9. Tay Ray ChuanNov 4, 2012
  10. Thomas AdamNov 1, 2012
  11. James NylenNov 1, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.