git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Daniel Barkalow <barkalow@iabervon.org>
Subject: [RFC PATCH] format-patch: thread as reply to cover letter even with in-reply-to
Date: Mon, 16 Feb 2009 20:00:12 +0100	[thread overview]
Message-ID: <1234810812-30499-1-git-send-email-trast@student.ethz.ch> (raw)
In-Reply-To: <cover.1234801852.git.trast@student.ethz.ch>

Currently, format-patch --thread --cover-letter --in-reply-to $parent
makes all mails, including the cover letter, a reply to $parent.
However, we would want the reader to consider the cover letter above
all the patches.

This changes the semantics so that only the cover letter is a reply to
$parent, while all the patches are formatted as replies to the cover
letter.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---

Thomas Rast wrote:
> Unrelated note regarding --thread usage:
> 
> Wouldn't it be better if format-patch made it so that the cover
> letter, if any, is the (only) reply to the --in-reply-to, and all
> actual patches are replies to the cover letter?

Maybe like this?


 builtin-log.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 2ae39af..ec11f95 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -1031,12 +1031,22 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 			/* Have we already had a message ID? */
 			if (rev.message_id) {
 				/*
-				 * If we've got the ID to be a reply
-				 * to, discard the current ID;
-				 * otherwise, make everything a reply
-				 * to that.
+				 * Without --cover-letter and
+				 * --in-reply-to, make every mail a
+				 * reply to the one before.
+				 *
+				 * With --in-reply-to but no
+				 * --cover-letter, make every mail a
+				 * reply to the <reply-to>.
+				 *
+				 * With --cover-letter, make every
+				 * mail but the cover letter a reply
+				 * to the cover letter.  The cover
+				 * letter is a reply to the
+				 * --in-reply-to, if specified.
 				 */
-				if (rev.ref_message_id)
+				if (rev.ref_message_id
+				    && (!cover_letter || rev.nr > 1))
 					free(rev.message_id);
 				else
 					rev.ref_message_id = rev.message_id;
-- 
1.6.2.rc0.328.g2c702

  parent reply	other threads:[~2009-02-16 19:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-14 19:54 [PATCH] bash completion: offer more options for gitk Thomas Rast
2009-02-15  9:33 ` Junio C Hamano
2009-02-15  9:56   ` Santi Béjar
2009-02-16 16:34     ` [PATCH v2 0/2] bash completion: more options for gitk/log/shortlog Thomas Rast
2009-02-16 16:38       ` Thomas Rast
2009-02-16 19:00       ` Thomas Rast [this message]
2009-02-16 20:22         ` [RFC PATCH] format-patch: thread as reply to cover letter even with in-reply-to Jay Soffian
2009-02-16 20:34           ` Thomas Rast
2009-02-16 20:52             ` Jakub Narebski
2009-02-16 23:27               ` Thomas Rast
2009-02-19 21:26                 ` [PATCH 0/4] format-patch --cover-letter --in-reply-to Thomas Rast
2009-02-19 21:26                   ` [PATCH 1/4] format-patch: threading test reactivation Thomas Rast
2009-02-19 21:26                   ` [PATCH 2/4] format-patch: track several references Thomas Rast
2009-02-19 22:41                     ` Daniel Barkalow
2009-02-20 19:55                       ` [PATCH v2 next 0/4] format-patch --cover-letter --in-reply-to Thomas Rast
2009-02-20 19:55                         ` [PATCH v2 next 1/4] format-patch: threading test reactivation Thomas Rast
2009-02-20 19:55                         ` [PATCH v2 next 2/4] format-patch: track several references Thomas Rast
2009-02-20 19:55                         ` [PATCH v2 next 3/4] format-patch: thread as reply to cover letter even with in-reply-to Thomas Rast
2009-02-20 19:55                         ` [PATCH v2 next 4/4] format-patch: support deep threading Thomas Rast
2009-02-22 16:49                         ` [PATCH v2 next 0/4] format-patch --cover-letter --in-reply-to Junio C Hamano
2009-02-19 21:26                   ` [PATCH 3/4] format-patch: thread as reply to cover letter even with in-reply-to Thomas Rast
2009-02-19 21:26                   ` [PATCH 4/4] format-patch: support deep threading Thomas Rast
2009-02-16 16:34     ` [PATCH v2 1/2] bash completion: refactor common log, shortlog and gitk options Thomas Rast
2009-02-16 16:34     ` [PATCH v2 2/2] bash completion: only show 'log --merge' if merging Thomas Rast
2009-02-18 17:05       ` Shawn O. Pearce
2009-02-18 19:02         ` 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=1234810812-30499-1-git-send-email-trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=barkalow@iabervon.org \
    --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).