git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Overlong lines with git-merge --log
@ 2012-11-02  1:30 Tim Janik
  2012-11-02 10:05 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Janik @ 2012-11-02  1:30 UTC (permalink / raw)
  To: git

Hey all.

Using git-merge --log to merge commit messages that spawn multiple lines
will produce overlong summary lines.
That's because each summary line for a commit includes the entire commit
message (all lines concatenated).

According to git-fmt-merge-msg(1), --log should 'populate the log
message with one-line descriptions' instead of using the entire commit
messages.
Which would make a lot of sense, it's just not working as advertised.

Encountered with git version 1.7.9.5.

-- 
Yours sincerely,
Tim Janik

---
http://timj.testbit.eu/ - Free software Author

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Overlong lines with git-merge --log
  2012-11-02  1:30 Overlong lines with git-merge --log Tim Janik
@ 2012-11-02 10:05 ` Jeff King
  2012-11-02 13:24   ` Tim Janik
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2012-11-02 10:05 UTC (permalink / raw)
  To: Tim Janik; +Cc: git

On Fri, Nov 02, 2012 at 02:30:15AM +0100, Tim Janik wrote:

> Using git-merge --log to merge commit messages that spawn multiple lines
> will produce overlong summary lines.
> That's because each summary line for a commit includes the entire commit
> message (all lines concatenated).
> 
> According to git-fmt-merge-msg(1), --log should 'populate the log
> message with one-line descriptions' instead of using the entire commit
> messages.
> Which would make a lot of sense, it's just not working as advertised.

The "subject" or "first line" is not actually the first line; these days
it is typically the "first paragraph". The reason is that git always
expected commit messages to look like:

  one line describing the change

  more detailed explanation
  that might go on for several lines

  or even several paragraphs

However, as people imported commits from previous systems, they ended up
with a lot of commit messages where the closest thing to a subject was
split across several lines like:

  here's a description of the commit that is probably overly long,
  but that's how we did it back in CVS days

Taking just the first line of those often cuts off the useful part. It
was deemed less bad to show the whole message as a subject rather than
cut it off arbitrarily.

If you are developing with git and not splitting the subject out with a
blank line, there are a lot of tools that are going to look ugly (e.g.,
format-patch will generate overly long subjects, "log --oneline" will be
ugly, and browsers like "tig" and "gitk" may be overwhelmed).

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Overlong lines with git-merge --log
  2012-11-02 10:05 ` Jeff King
@ 2012-11-02 13:24   ` Tim Janik
  2012-11-02 13:49     ` Stephen Bash
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Janik @ 2012-11-02 13:24 UTC (permalink / raw)
  To: Jeff King; +Cc: git

On 02.11.2012 11:05, Jeff King wrote:

> Taking just the first line of those often cuts off the useful part. It
> was deemed less bad to show the whole message as a subject rather than
> cut it off arbitrarily.

Thanks a lot for the explanation, I'm using git directly here, but the
two cases I had indeed lacked this newline.

-- 
Yours sincerely,
Tim Janik

---
http://timj.testbit.eu/ - Free software Author

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Overlong lines with git-merge --log
  2012-11-02 13:24   ` Tim Janik
@ 2012-11-02 13:49     ` Stephen Bash
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Bash @ 2012-11-02 13:49 UTC (permalink / raw)
  To: Tim Janik; +Cc: git, Jeff King

----- Original Message -----
> From: "Tim Janik" <timj@gnu.org>
> Sent: Friday, November 2, 2012 9:24:29 AM
> Subject: Re: Overlong lines with git-merge --log
> 
> On 02.11.2012 11:05, Jeff King wrote:
> 
> > Taking just the first line of those often cuts off the useful part.
> > It was deemed less bad to show the whole message as a subject rather
> > than cut it off arbitrarily.
> 
> Thanks a lot for the explanation, I'm using git directly here, but the
> two cases I had indeed lacked this newline.

FWIW we use merge --log quite extensively here at the office, and I've developed a habit to skim the extremely long lines and attempt to cut them intelligently (something I don't trust the computer to do for me).  Sometimes that means taking the second or third sentence if it's a better summary, sometimes it's just abbreviating the first.  Now that merge automatically spawns an editor, this is quite convenient (though it does take a bit longer).

Thanks,
Stephen

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-02 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-02  1:30 Overlong lines with git-merge --log Tim Janik
2012-11-02 10:05 ` Jeff King
2012-11-02 13:24   ` Tim Janik
2012-11-02 13:49     ` Stephen Bash

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).