Thread (50 messages) flat view 50 messages, 13 authors, 2016-06-15

Re: [PATCH] Builtin-commit: show on which branch a commit was added

From: Andreas Ericsson <hidden>
Date: 2016-06-15 22:45:25

Possibly related (same subject, not in this thread)

Jeff King wrote:
On Tue, Sep 30, 2008 at 08:37:00AM +0200, Wincent Colaiuta wrote:
quoted
As far as long-line-wrapping goes, I don't really think this is a problem 
for Git to solve (by truncation or any other means); it's more of a user 
behaviour thing where one would hope that users would get into the habit 
of using concise subject lines and branch names.
How concise must we be? I wrap my commit messages at 60 characters,
which I consider quite conservative. But

  Created commit abcd1234 on jk/my-topic-branch:

takes up over half of an 80-column terminal. Is that a long branch name?
Browsing "git log --grep=Merge.branch --pretty=format:%s origin/next"
suggests it's not terribly out of line (at least by Junio's standards).

Dropping "commit " will help some. But given how much width is still
used, and the fact that this message is really just to say "yes, I
confirm that we just created the commit you asked for", I think
truncating (with dots) to keep it within 80 characters is reasonable.
I agree. Obvious solution is to do

subj_len = term_width - (strlen(cruft) + strlen(branch_name))

where strlen(cruft) is just 8 less if we drop 'commit ' from the
cases. See the patch I just sent though. I sort of like that one.

Another way would be to write
<branch>: Created <hash>: "subject line..."

As <hash> will very, very rarely match anything the user would put
in his/her commit message themselves. Quoting the subject is probably
a nice touch, and it can make sense to put it last as it's the least
interesting of the things we print. Ah well. I'll just await commentary
on the patch I've already sent before I go ahead and do something like
that.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help