git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Avery Pennarun" <apenwarr@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Reformat "your branch has diverged..." lines to reduce line length.
Date: Wed, 16 Jul 2008 16:27:15 -0400	[thread overview]
Message-ID: <32541b130807161327k17f3a58ay5ab2da75963a2d50@mail.gmail.com> (raw)
In-Reply-To: <7v4p6pr4ob.fsf@gitster.siamese.dyndns.org>

On 7/16/08, Junio C Hamano <gitster@pobox.com> wrote:
> Avery Pennarun <apenwarr@gmail.com> writes:
>  >       if (!num_theirs)
>  > -             strbuf_addf(sb, "Your branch is ahead of the tracked%s branch '%s' "
>  > +             strbuf_addf(sb, "Your branch is ahead of the tracked%s branch '%s'\n"
>  >                           "by %d commit%s.\n",
>
>  I wonder if a simple "s/of the tracked%s branch //" is better for this
>  kind of thing.  If the message says 'origin/master', you know it is a
>  tracked remote branch anyway, don't you?

Personally, I would be fine with shorter messages; this doesn't seem
the best time to
report the name of the tracked branch anyhow.  I use 80x24 terminals
too most of the time.

However, I didn't write the original patch either, and I recall that
this feature was so popular that it actually resulted in a list thread
complimenting it, so I was hesitant to change it too much :)

>         Your branch is ahead of 'origin/add-chickens2' by 21 commits.
>
>         Your branch is behind 'origin/add-chickens2' by 1 commit.
>
>         Your branch and 'origin/add-chickens2' have diverged, and have
>         21 and 1 different commit(s) each, respectively.
>
>  I moved "respectively" so that the variable parts will come close to the
>  beginning of physical line.

Well, the fact that the number of commits is "variable" isn't so
important, unless you start diverging by 1e9 commits or something :)
It might be nice to minimize the amount of static text on the line
containing the branch name, though.  Your rephrasing would allow us to
go as far as:

    Your branch and 'origin/add-chickens2'
    have diverged, and have 21 and 1 different commit(s) each, respectively.

Which looks a little imbalanced, but works with long branch names.

Alternatively, your rephrasing above made me think of the idea of just
printing *both* of the first two messages in the "diverging" case.
Depending how you think of it, that would be either more clear or less
clear.  It's actually easier to parse the two short sentences than the
long one.

Please let me know if you want me to resubmit the patch with your
suggestions or whether you'll handle it.  I'm still a little vague on
the exact patch approval process.

Have fun,

Avery

  reply	other threads:[~2008-07-16 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16 19:19 [PATCH] Reformat "your branch has diverged..." lines to reduce line length Avery Pennarun
2008-07-16 19:48 ` Junio C Hamano
2008-07-16 20:27   ` Avery Pennarun [this message]
2008-07-16 22:03     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32541b130807161327k17f3a58ay5ab2da75963a2d50@mail.gmail.com \
    --to=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).