user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: meta@public-inbox.org,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	 Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Eric Wong <e@80x24.org>
Subject: Re: Working with public-inbox.org [Was: [PATCH] rev-parse: respect core.hooksPath in --git-path]
Date: Tue, 16 Aug 2016 10:22:57 -0700	[thread overview]
Message-ID: <CAGZ79kby02NuRvQkcuTNjxxc4oDvjAH4wE=3dCXmqyRRrCU0tQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqa8gcej1p.fsf@gitster.mtv.corp.google.com>

On Tue, Aug 16, 2016 at 10:10 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> So as a discussion starter:
>> * Should git am skip a patch 00/XX automatically ?
>
> No.  My preference is to add "--initial-skip=<N>", though.
>
> When I receive a patch series to reroll another series, I somehow
> know and verify that earlier N patches have not changed, I detach
> the HEAD at the last unchanged commit from the previous round and
> apply the remainder of the new series, so that I can preserve the
> author timestamps of earlier steps from the previous series.  By
> the time I "know and verify" where the first step that was updated,
> I have a full series in a single mbox; having "--initial-skip=<N>"
> would help with that use case, too, and "skipping the first" is a
> narrow special case of giving N=1.

In your work flow, how do you respect the cover letter?
e.g. in 3787e3c16ced:

    Merge branch 'ew/http-backend-batch-headers'

    The http-backend (the server-side component of smart-http
    transport) used to trickle the HTTP header one at a time.  Now
    these write(2)s are batched.

    * ew/http-backend-batch-headers:
      http-backend: buffer headers before sending

Is the text from the original author (and if so from which version
of the cover letter) or is it your work?

>
>> * Should the public-inbox offer another link to patches 1-n, without
>>   the cover letter? Or should it add instructions:
>>
>>         If this is a patch series you can apply it locally as:
>>         curl <link> >tmpXXX
>>         git am tmpXXX && git am --skip && git am --continue
>
> I do not think it is sensible for "cover-letter" specific
> instructions.  However, I do not think it is unreasonable to either
> add another mbox.gz link or replace the behaviour of mbox.gz link so
> that you can grab a mbox that contains "this message and everything
> after it in the thread".  That way, I could open the first message,
> see something like this I found in your message:
>
>>> Thread overview: 4+ messages in thread (expand / mbox.gz / Atom feed / [top])
>>> 2016-08-15 23:06 Jacob Keller [this message]
>>> 2016-08-15 23:07 ` [PATCH v6 1/3] diff.c: remove output_prefix_length field Jacob Keller
>>> 2016-08-15 23:07 ` [PATCH v6 2/3] graph: add support for --line-prefix on all graph-aware output Jacob Keller
>>> 2016-08-15 23:07 ` [PATCH v6 3/3] diff: add SUBMODULE_DIFF format to display submodule diff Jacob Keller
>
> and then go to 1/3 and click that "this and everything that
> follows".

Both thoughts are sensible; However the --initial-skip=<n>
doesn't address the special case of storing the cover letter
(which we eventually want to do?)

I thought of it as the following with room for improvement:

diff --git a/builtin/am.c b/builtin/am.c (shite space broken):
index 739b34d..5f08b61 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1246,6 +1246,7 @@ static int parse_mail(struct am_state *state,
const char *mail)
        FILE *fp;
        struct strbuf sb = STRBUF_INIT;
        struct strbuf msg = STRBUF_INIT;
+       struct strbuf subject = STRBUF_INIT;
        struct strbuf author_name = STRBUF_INIT;
        struct strbuf author_date = STRBUF_INIT;
        struct strbuf author_email = STRBUF_INIT;
@@ -1309,6 +1310,7 @@ static int parse_mail(struct am_state *state,
const char *mail)
                        if (msg.len)
                                strbuf_addch(&msg, '\n');
                        strbuf_addstr(&msg, x);
+                       strbuf_addstr(&subject, x);
                } else if (skip_prefix(sb.buf, "Author: ", &x))
                        strbuf_addstr(&author_name, x);
                else if (skip_prefix(sb.buf, "Email: ", &x))
@@ -1325,8 +1327,17 @@ static int parse_mail(struct am_state *state,
const char *mail)
        }

        if (is_empty_file(am_path(state, "patch"))) {
-               printf_ln(_("Patch is empty. Was it split wrong?"));
-               die_user_resolve(state);
+               if (indicates_coverletter(&subject))
+                       /*
+                        * TODO: store the cover letter as the first or last
+                        * commit or as branch.<name>.description
+                        */
+                       ret = 1;
+                       goto finish;
+               else {
+                       printf_ln(_("Patch is empty. Was it split wrong?"));
+                       die_user_resolve(state);
+               }
        }

        strbuf_addstr(&msg, "\n\n");

  parent reply	other threads:[~2016-08-16 17:22 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 16:55 Working with public-inbox.org [Was: [PATCH] rev-parse: respect core.hooksPath in --git-path] Stefan Beller
2016-08-16 17:10 ` Junio C Hamano
2016-08-16 17:20   ` Jeff King
2016-08-16 17:54     ` Junio C Hamano
2016-08-16 17:22   ` Stefan Beller [this message]
2016-08-16 17:47     ` Junio C Hamano
2016-08-16 20:44   ` Eric Wong
2016-08-16 20:56     ` Eric Wong
2016-08-18 12:42 ` Johannes Schindelin
2016-08-18 20:49   ` Eric Wong
2016-08-18 21:41     ` Junio C Hamano
2016-08-19 15:18       ` Johannes Schindelin
2016-08-19 15:30     ` Johannes Schindelin
2016-08-19 16:55       ` Stefan Beller
2016-08-19 22:35         ` Eric Wong
2016-08-22 13:38         ` Johannes Schindelin
2016-08-22 19:21         ` Jeff King
2016-08-19 22:35       ` Eric Wong
2016-08-22 13:18         ` Johannes Schindelin
2016-08-22 18:05           ` Jakub Narębski
2016-08-25 13:21             ` Johannes Schindelin
2016-08-28 18:23               ` Jakub Narębski
2016-08-29 10:46                 ` Johannes Schindelin
2016-08-22 22:55           ` Eric Wong
2016-08-25 12:58             ` Johannes Schindelin
2016-08-27 22:38               ` Jakub Narębski
2016-08-28  8:36                 ` Working with public-inbox.org Johannes Schindelin
2016-08-28 11:41                   ` Jakub Narębski
2016-08-29  5:35                     ` Johannes Schindelin
2016-08-19 15:03   ` Working with public-inbox.org [Was: [PATCH] rev-parse: respect core.hooksPath in --git-path] Jeff King
2016-08-20 19:57     ` Jakub Narębski
2016-08-23  4:47       ` Arif Khokar
2016-08-24 15:34         ` Johannes Schindelin
2016-08-24 18:49           ` Eric Wong
2016-08-24 19:12             ` Jeff King
2016-08-24 19:27               ` Eric Wong
2016-08-25  3:40             ` Arif Khokar
2016-08-25  2:41           ` Arif Khokar
2017-02-10 16:10           ` Johannes Schindelin
2017-02-13  5:52             ` Arif Khokar
2017-02-13 14:37               ` Johannes Schindelin
2017-02-14  3:56                 ` Arif Khokar
2017-02-14  3:59                   ` Arif Khokar
2017-02-14  7:13                   ` Eric Wong
2017-02-13 19:21               ` Junio C Hamano
2017-02-14  3:55                 ` Arif Khokar
2017-02-14  4:41                   ` Junio C Hamano
2017-02-14  5:09                     ` Arif Khokar
2017-02-14  5:14                     ` Jeff King
2016-08-22 13:06     ` Johannes Schindelin
2016-08-22 13:15       ` Duy Nguyen
2016-08-22 20:38         ` Philip Oakley
2016-08-24 13:04           ` Johannes Schindelin
2016-08-24 19:16             ` Eric Wong
2016-08-25 13:08               ` Johannes Schindelin
2016-08-25  3:57             ` Arif Khokar
2016-08-25 13:01               ` Johannes Schindelin
2016-08-25 23:14                 ` Arif Khokar
2016-08-26  8:08                   ` Johannes Schindelin
2016-08-27 22:26         ` Jakub Narębski
2016-08-28  8:38           ` Johannes Schindelin
2016-08-28 13:45             ` Announcing Git User's Survey 2016 [was: Working with public-inbox.org] Jakub Narębski
2016-09-09 13:06               ` Johannes Schindelin
2016-09-09 18:51                 ` Jakub Narębski

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

  List information: http://public-inbox.org/README

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

  git send-email \
    --in-reply-to='CAGZ79kby02NuRvQkcuTNjxxc4oDvjAH4wE=3dCXmqyRRrCU0tQ@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=meta@public-inbox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).