git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Petr Baudis <pasky@suse.cz>
Cc: Junio C Hamano <gitster@pobox.com>,
	Anders Melchiorsen <mail@cup.kalibalik.dk>,
	git@vger.kernel.org
Subject: Re: [PATCH v3] Advertise the ability to abort a commit
Date: Thu, 31 Jul 2008 07:09:26 -0400	[thread overview]
Message-ID: <20080731110926.GA23234@sigill.intra.peff.net> (raw)
In-Reply-To: <20080731105539.GM32184@machine.or.cz>

On Thu, Jul 31, 2008 at 12:55:39PM +0200, Petr Baudis wrote:

> >  		if (cleanup_mode == CLEANUP_ALL)
> > -			fprintf(fp, "not be included)\n");
> > +			fprintf(fp,
> > +				" Lines starting\n"
> > +				"# with '#' will be ignored, and an empty"
> > +				" message aborts the commit.\n");
> >  		else /* CLEANUP_SPACE, that is. */
> > -			fprintf(fp, "be kept.\n"
> > -				"# You can remove them yourself if you want to)\n");
> > +			fprintf(fp,
> > +				" Lines starting\n"
> > +				"# with '#' will be kept; you may remove them"
> > +				" yourself if you want to.\n"
> > +				"# An empty message aborts the commit.\n");
> >  		if (only_include_assumed)
> >  			fprintf(fp, "# %s\n", only_include_assumed);
> >  
> 
> This is rather funny-looking; you print _one_ fragment of the common
> string by a common fprintf, but then repeat _second_ fragment of the
> still-common string in a per-case fprintf. Can't we at least split this
> on the line boundary, if not do something loosely like this?

I just broke it by sentence, thinking that followed the semantics more
clearly (i.e., the first fprintf says one thing, then the second says
another; however, we must say the second one differently depending on
the case). I almost just split the whole paragraph by cleanup case,
allowing each to be worded and wrapped as most appropriate.

> 		fprintf(fp,
> 			"\n"
> 			"# Please enter the commit message for your "
> 			"changes. Lines starting\n"
> 			"# with a '#' will be %s "
> 			"and an empty message aborts the commit\n",
> 			cleanup_mode == CLEANUP_ALL ? "ignored,"
> 			/* CLEANUP_SPACE */ : "kept (you may remove them "
> 				"yourself if you want to)\n#");

I did something like that before submitting, but decided against it
because:

  - I found mine more readable, since it is hard to see in yours exactly
    where there will be a linebreak.

  - I actually changed the phrasing for the second one. Since we
    introduce another clause into the sentence in the CLEANUP_SPACE
    case, it makes sense to start another sentence for the final point.

-Peff

  reply	other threads:[~2008-07-31 11:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-29 19:32 [PATCH] Advertise the ability to abort a commit Anders Melchiorsen
2008-07-29 20:12 ` [PATCH v2] " Anders Melchiorsen
2008-07-29 20:51   ` Junio C Hamano
2008-07-29 21:19     ` Anders Melchiorsen
2008-07-30  5:07   ` Jeff King
2008-07-30  5:11     ` Jeff King
2008-07-30 17:53       ` [PATCH v3] " Anders Melchiorsen
2008-07-30 19:01         ` Brian Gernhardt
2008-07-30 21:09           ` Avery Pennarun
2008-07-30 21:16             ` Brian Gernhardt
2008-07-30 21:53             ` Anders Melchiorsen
2008-07-31  5:50         ` Jeff King
2008-07-31  5:58           ` Junio C Hamano
2008-07-31  6:36             ` [PATCH] " Jeff King
2008-07-31  7:36             ` [PATCH v3] " Jeff King
2008-07-31 10:55               ` Petr Baudis
2008-07-31 11:09                 ` Jeff King [this message]
2008-07-31  7:28           ` Anders Melchiorsen
2008-07-31  7:32             ` Jeff King

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=20080731110926.GA23234@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mail@cup.kalibalik.dk \
    --cc=pasky@suse.cz \
    /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).