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

Re: [PATCH] Automatically line wrap long commit messages.

From
Shawn Pearce <spearce@spearce.org>
Date
Jun 1, 2006, 03:34 UTC
Message-ID
<20060601033430.GA13485@spearce.org>
In-Reply-To
<7v64jm2380.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 36 quoted lines
> Shawn Pearce <spearce@spearce.org> writes:
> 
> > Junio C Hamano <junkio@cox.net> wrote:
> >
> >> If we supported multiple -m (presumably each becomes a single line?)
> >> with internal fmt, I do not see how it would become less work.
> >> 
> >> 	$ git commit -w60 -m "This is my message." \
> >>         	-m '' \
> >>         	-m 'This is the body.  Etc....'
> >> 
> >> looks more typing to me, even without the second line to force
> >> the empty line between the summary and the body.
> >
> > Actually I was thinking each -m would be its own paragraph so blank
> > lines would split each -m and maybe the -w60 should be a config
> > option in .git/config or .gitrc so it doesn't always need to be
> > supplied on the command line.
> 
> Now that makes the distinction between the current:
> 
> 	$ git commit -m 'This is my message.
> 
> 	This is the body.  Etc....'
> 
> vs. the proposed multi-em:
> 
> 	$ git commit -m 'This is my message.' \
>         -m 'This is the body.  Etc....'
> 
> Presumably Etc.... will be an multiline argument to -m.  The
> distinction is even more blurry to me than before.
> 
> Emacs users would just do "ESC q" and vi users would know how to
> filter the file contents through fmt, so this seems to come from
> aversion against invoking your $EDITOR.  I just do not see why.

Because git-commit currently performs a status update and throws that data into the editor buffer. That takes longer than committing from the command line. Especially if I've just done a git-diff or git-status to see what is changed and about to be committed...

On a project the size of GIT on a Unix system this isn't a big deal; on a 9000 file project on Cygwin this difference is significant to me.

It is just the way I am used to working.
Show 6 quoted lines
> Having said that, I do realize that the current behaviour of
> accepting multiple -m without complaining and discarding all but
> the last one silently is far worse than what is being proposed,
> and I do not see downside to the multiple -m patch, so let's
> apply that.  You can have your "fmt -w60" provided if it is made
> into an option.

I'll rework the fmt -w60 patch to instead accept an optional filter command from .git/config; if the filter command is set then the command line commit message will get run through the filter before being piped into git-commit-tree.

-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “Automatically line wrap long commit messages.”
  1. Automatically line wrap long commit messages.Shawn Pearce, May 29, 2006
  2. Jan-Benedict GlawMay 29, 2006
  3. Shawn PearceMay 29, 2006
  4. Junio C HamanoMay 29, 2006
  5. Shawn PearceMay 29, 2006
  6. Junio C HamanoMay 30, 2006
  7. Shawn PearceMay 31, 2006
  8. Junio C HamanoMay 31, 2006
  9. Shawn PearceJun 1, 2006
  10. Junio C HamanoJun 1, 2006

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.