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

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?

Too wide is bad, but too tall is worse.  Some of us still work in 80x24
;-) and I prefer to make the message succinct when possible, rather than
keeping it long and spread over multiple lines.

>  	else
> -		strbuf_addf(sb, "Your branch and the tracked%s branch '%s' "
> -			    "have diverged,\nand respectively "
> +		strbuf_addf(sb, "Your branch and the tracked%s branch '%s'\n"
> +			    "have diverged, and respectively "
>  			    "have %d and %d different commit(s) each.\n",

This does not make the message taller, but if we were to make the "only
one side advanced" cases shorter, we would need to reword this to be
consistent.  Perhaps something like this would be just as easy to read and
more compact?

	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.

  reply	other threads:[~2008-07-16 19:49 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 [this message]
2008-07-16 20:27   ` Avery Pennarun
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=7v4p6pr4ob.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    /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).