git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] mailsplit: support unescaping mboxrd messages

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 6, 2016, 18:24 UTC
Message-ID
<xmqq7fe2xjii.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160605044641.9221-3-e@80x24.org>
Eric Wong <e@80x24.org> writes:
Show 37 quoted lines
> This will allow us to parse the output of --pretty=mboxrd
> and the output of other mboxrd generators.
>
> Signed-off-by: Eric Wong <e@80x24.org>
> ---
>  Documentation/git-mailsplit.txt |  7 ++++++-
>  builtin/mailsplit.c             | 18 ++++++++++++++++++
>  t/t5100-mailinfo.sh             | 31 +++++++++++++++++++++++++++++++
>  t/t5100/0001mboxrd              |  4 ++++
>  t/t5100/0002mboxrd              |  5 +++++
>  t/t5100/sample.mboxrd           | 19 +++++++++++++++++++
>  6 files changed, 83 insertions(+), 1 deletion(-)
>  create mode 100644 t/t5100/0001mboxrd
>  create mode 100644 t/t5100/0002mboxrd
>  create mode 100644 t/t5100/sample.mboxrd
>
> diff --git a/Documentation/git-mailsplit.txt b/Documentation/git-mailsplit.txt
> index 4d1b871..e3b2a88 100644
> --- a/Documentation/git-mailsplit.txt
> +++ b/Documentation/git-mailsplit.txt
> @@ -8,7 +8,8 @@ git-mailsplit - Simple UNIX mbox splitter program
>  SYNOPSIS
>  --------
>  [verse]
> -'git mailsplit' [-b] [-f<nn>] [-d<prec>] [--keep-cr] -o<directory> [--] [(<mbox>|<Maildir>)...]
> +'git mailsplit' [-b] [-f<nn>] [-d<prec>] [--keep-cr] [--mboxrd]
> +		-o<directory> [--] [(<mbox>|<Maildir>)...]
>  
>  DESCRIPTION
>  -----------
> @@ -47,6 +48,10 @@ OPTIONS
>  --keep-cr::
>  	Do not remove `\r` from lines ending with `\r\n`.
>  
> +--mboxrd::
> +	Input is of the "mboxrd" format and "^>+From " line escaping is
> +	reversed.

This just makes me wonder if there is a practical reason why people would not want this always enabled. I just looked at output from

    $ git log --grep='>>*From '

in the kernel repository, and I saw no cases where the committer really wanted to preserve the leading one or more '>' on that line. No, I didn't go through all of 150+ such commits, but I did check the couple dozen of them from the recent history.

Our history also have 5 instances of them, none of which should have had the leading '>' if the committer were careful.

Show 12 quoted lines
> diff --git a/t/t5100/sample.mboxrd b/t/t5100/sample.mboxrd
> new file mode 100644
> index 0000000..79ad5ae
> --- /dev/null
> +++ b/t/t5100/sample.mboxrd
> @@ -0,0 +1,19 @@
> +From mboxrd Mon Sep 17 00:00:00 2001
> +From: mboxrd writer <mboxrd@example.com>
> +Date: Fri, 9 Jun 2006 00:44:16 -0700
> +Subject: [PATCH] a commit with escaped From lines
> +
> +>From the beginning, mbox should have been mboxrd
Indeed ;-)
Previous: Eric WongNext: Eric Wong
Message 4 of 6 in “support mboxrd format”
  1. 0/3 support mboxrd formatEric Wong, Jun 5, 2016
  2. 1/3 pretty: support "mboxrd" output formatEric Wong, Jun 5, 2016
  3. 2/3 mailsplit: support unescaping mboxrd messagesEric Wong, Jun 5, 2016
  4. Junio C HamanoJun 6, 2016
  5. Eric WongJun 6, 2016
  6. 3/3 am: support --patch-format=mboxrdEric Wong, Jun 5, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.