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

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 1 Oct 2008 08:36:37 -0700

Jeff King <[email-masked]> wrote:
> On Wed, Oct 01, 2008 at 08:10:11AM -0700, Shawn O. Pearce wrote:
> 
> > Actually I rather like the patch you submitted yesterday:
> > 
> >         normal case
> >         Created abc9056 (i386: Snib the sprock) on i386
> > 
> >         detached head
> >         Created DETACHED commit abc9056 (i386: Snib the sprock)
> > 
> >         initial commit
> >         Created root-commit abc9056 (i386: Snib the sprock) on i386
> > 
> > The detached HEAD and root-commit cases are clearly denoted at the
> > very start of the line, where your eyes are likely to start scanning
> 
> I agree with your assumption that people scan the line from left to
> right, and that the most important stuff should come first. So that
> format covers _those_ cases, but not the case of "oops, I committed on
> a different branch than I intended." So I think it really makes sense
> to keep the branch name on the left side, and the commit subject last.

I briefly considered a format like this while replying above, but
at prior day-job I used rather long branch names (sometimes with
common prefixes) so it would truncate alot:

  normal case
  On i386           abc9056 (i386: Snib the sprock)

  detached head
  On DETACHED HEAD  abc9056 (i386: Snib the sprock)

  initial commit
  On i386
  Root commit       abc9056 (i386: Snib the sprock)

With the branch name field set at about 15 characters and truncated.
The initial commit case is very infrequent so burning two lines
for it to help make it stand out *and* make the branch name clear
isn't really a problem.
 
> > Right now I'm happy with your patch in next.  I don't like taking
> > the paint brush away from folks, but I also don't want to be applying
> > a ton of commit message reformatting patches over the next week.  ;-)
> 
> Welcome to maintainership. ;P

*sigh*  And I just took up the #@*#@!&!*!@ paintbrush myself.
Dammit.  I'm putting it down now.  Really.  :-)

-- 
Shawn.