git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Frank Terbeck <ft@bewatermyfriend.org>
Subject: [PATCH v2 0/4] more automation for cover letter generation
Date: Mon,  4 May 2009 11:58:58 +0200	[thread overview]
Message-ID: <1241431142-8444-1-git-send-email-ft@bewatermyfriend.org> (raw)
In-Reply-To: <7v8wlxx18c.fsf@gitster.siamese.dyndns.org>

Sorry for taking this long, I was covered in work.

Junio C Hamano <gitster@pobox.com> wrote:
> Frank Terbeck <ft@bewatermyfriend.org> writes:
> > [format]
> >     coverletter = true
> >     coveronepatch = false
> 
> Nobody wants a cover letter to a single patch, so a better way
> would probably be:
> 
> 	'yes' means default behaviour, that is add cover letter for
> 	multiple-patch series, non for a single patch;
> 
> 	'no' means no cover; and
> 
> 	'always' means a probably insane "cover even a single patch".
> 
> In any case, because this new feature is way too late to be in the
> upcoming 1.6.3 release anyway, I think it is a saner approach to add a
> command line option "--cover=yes" to "cover if multiple", "--cover=always"
> to "cover even a single patch", and "--cover=no" to countermand a
> configured "format.cover" the user may have in the configuration from the
> command line.

You're right. And so is Jeff.
I'll send a followup, that will address comments of the both of you.
See below.

> 
> >     overwritecoverletter = false
> 
> I do not think it is particularly a good idea, and it is a good idea to
> have it in the configuration.
> 
>  - Why not protect the earlier patch output?  People often tweak messages
>    (both above and below the three-dash lines) in them.
> 
>  - Isn't this pretty much per invocation?
> 
> I can understand (I may not be enthused about it) a new --clobber={yes,no}
> command line option to allow/forbid clobbering the existing files, and you
> may want to add --clobber=patches to allow clobbering only the patches but
> not cover (which I do not think makes much sense, though).

This was a followup idea, which I thought was a reasonable. In the
meantime, I feel this is not needed. I'd agree that a more generic
--clobber option would make sense but frankly, protecting overwrites at
this stage is not something worth putting much effort into, IMHO.

Jeff King <peff@peff.net> wrote:
> On Sat, Apr 18, 2009 at 06:16:15PM +0200, Frank Terbeck wrote:
[...]
> Something about "coveronepatch" seems a bit hack-ish to me. Perhaps it
> should be "generate cover letter if there are more than N patches". You
> could even just overload "format.coverletter" as:
> 
>   true - always generate cover letter
>   false - never generate cover letter
>   <number> - generate if there are at least <number> patches

Yeah, a lot better.
As Junio said, noone wants cover letters for single patches.
Therefore, I made format.coverletter default to 2. Setting it to one
makes --cover-letter produce for cover letter for single patches, too.
Setting it to 0 disables cover letters, even with --cover-letter. Any
other value sets the minimum size of patch series that will trigger
--cover-letter to create a cover letter.

That can be altered from the command-line via:
    --cover-letter=always
    --cover-letter=never
    --cover-letter=<length>

In addition to that I did add format.coverauto.
Setting it to true (it defaults to false) makes format-patch behave like
the user gave the --cover-letter option - with the following exception:
if --stdout is specified, cover letters are disabled. To force cover
letters in that case too, --cover-letter needs to be specified *after*
--stdout.

Now that I think of it again, two weeks after writing this mail
originally, I guess it would be possible to drop format.coverauto
altogether and tell users to use:

  % git config --global alias.fp format-patch --cover-letter

I don't know which solution would be preferred. If it's the user-should-
use-an-alias approach, I'll create a series that gets rid of
format.coverauto changes.

[...]
> > The series is based on master and doesn't seem to break anything
> > within the test suite. It could maybe use own tests, but I must admit
> > that I didn't look too closely at how git's test suite works and where
> > to put in tests for this.
> 
> The tests below were not actually run (and you can see they are based on
> what I proposed above, not your existing patches), but they should give
> hopefully give you a headstart.

Yes, it did. Thank you.

Frank Terbeck (4):
The new options and changes:
  Add format.coverletter option
  Add format.coverauto boolean

Tests, thanks to Jeff:
  Add tests for coverauto, coverletter and --cover-letter

And finally documentation.
  Documentation for format.coverletter and --cover-letter

 Documentation/config.txt           |    9 +++++
 Documentation/git-format-patch.txt |   17 ++++++++--
 builtin-log.c                      |   32 +++++++++++++++++--
 t/t3400-rebase.sh                  |    1 +
 t/t4014-format-patch.sh            |   58 ++++++++++++++++++++++++++++++++++-
 5 files changed, 108 insertions(+), 9 deletions(-)

  reply	other threads:[~2009-05-04  9:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-18 16:16 [PATCH 0/6] more automation for cover letter generation Frank Terbeck
2009-04-18 16:16 ` [PATCH 1/6] format-patch: add cover{letter,onepatch} options Frank Terbeck
2009-04-18 16:16 ` [PATCH 2/6] Add documentation for format-patch's --cover-one-patch Frank Terbeck
2009-04-18 16:16 ` [PATCH 3/6] Document format.coverletter and format.coveronepatch Frank Terbeck
2009-04-18 16:16 ` [PATCH 4/6] format-patch: introduce overwritecoverletter option Frank Terbeck
2009-04-18 16:16 ` [PATCH 5/6] Add documentation for --cover-overwrite Frank Terbeck
2009-04-18 16:16 ` [PATCH 6/6] Document format.overwritecoverletter Frank Terbeck
2009-04-18 18:31 ` [PATCH 0/6] more automation for cover letter generation Junio C Hamano
2009-05-04  9:58   ` Frank Terbeck [this message]
2009-05-04  9:58   ` [PATCH v2 1/4] Add format.coverletter option Frank Terbeck
2009-05-04  9:59   ` [PATCH v2 2/4] Add format.coverauto boolean Frank Terbeck
2009-05-04 18:39     ` Stephen Boyd
2009-05-04 21:41       ` Frank Terbeck
2009-05-04 23:20     ` Junio C Hamano
2009-05-05  8:49       ` Frank Terbeck
2009-05-05 10:41         ` Junio C Hamano
2009-05-05 13:29           ` Frank Terbeck
2009-05-05 15:23             ` Frank Terbeck
2009-05-04  9:59   ` [PATCH v2 3/4] Add tests for coverauto, coverletter and --cover-letter Frank Terbeck
2009-05-04  9:59   ` [PATCH v2 4/4] Documentation for format.coverletter " Frank Terbeck
2009-04-21  3:32 ` [PATCH 0/6] more automation for cover letter generation 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=1241431142-8444-1-git-send-email-ft@bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).