git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Junio C Hamano <gitster@pobox.com>,
	Jacob Keller <jacob.keller@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH] mailsplit add option to include sanitized subject in filename
Date: Thu, 11 Apr 2024 11:52:23 -0700	[thread overview]
Message-ID: <5a25d75c-cc27-49d9-a49d-39f657fd17f4@intel.com> (raw)
In-Reply-To: <xmqqedbcqw84.fsf@gitster.g>



On 4/10/2024 10:55 PM, Junio C Hamano wrote:
> Jacob Keller <jacob.keller@gmail.com> writes:
> 
>>>> I originally wanted to avoid the need for an option, but git-am
>>>> currently depends on the strict sequence number filenames.  It is
>>>> unclear how difficult it would be to refactor git-am to work with
>>>> names that include the extra subject data.
> 
> The change may be a bit involved but depending on where you decide
> to stop, it may not be too bad.
> 
> What is your design goal of this topic?  IOW, what is the maximum
> corrupted ordering of patches in a single mailbox do you want to
> recover from?
> 
> The easiest and cleanest would be if you assume that the messages
> are in scrambled order, but are all from the same series, correctly
> numbered, without anything missing.  A mbox may have 8 patches from
> a 8-patch series, with their subject lines having [1/8] to [8/8]
> without duplicates or droppages, without any other message that does
> not belong to the series.  If that is where you are willing to stop,
> then you can still name the individual messages with just numbers
> (but taken out of the subject line, not the order the input was
> splitted into).  "am" does not have to even know or care what you
> are doing in mailsplit in this case.

This is the main problem I'd like to solve. My original proposal was to
try and do just this, but the logic for extracting the number was bad.
Maybe just directly using the subject-based name and sorting by that
using standard alpha-numeric sort would be sufficient?

> 
> THe next level would be to still assume that you stop at the same
> place (i.e. you do not support patches from multiple series in the
> same mailbox), but use the number-santized-subject format.  This
> would be a bit more involved, but I think all you need to update on
> the "am" side is where the am_run() assigns the message file to the
> local variable "mail".  You know the temporary directory where you
> told "mailsplit" to create these individual messages, so you should
> be able to "opendir/readdir/closedir" and create a list of numbered
> files in the directory very early in "git am".  Knowing msgnum(state)
> at that point in the loop, it should be trivial to change the code
> that currently assumes the 4-th file is named "0004" to check for
> the file whose name begins with "0004-".

Yea, we pretty much just have to get the git-am process to work with the
new names. I can look at using opendir/readdir here instead.
> 
> I personally am not at all interested in doing that myself, because
> I do not see a reasonable way to lift the limitation of allowing a
> mailbox holding patches from only one series, and if we assume that
> a tool (i.e. "am" driving "mailsplit" in the new mode) with such a
> limitation is still useful, the source of such a scrambled mailbox
> must be quite a narrow and common one.  At that point, I suspect
> that fixing the scrambling at that narrow and common source (e.g.
> your "t.mbox.gz from public inbox server that cannot be told to sort
> the messages in any order other than the arrival timestamp") would
> be a much better use of our engineering resource.
> 

Ya I don't care much about multiple series. I care more about making it
handle scrambled series better than it does now. I download series off
of lore.kernel.org (public-inbox based) and those seem to routinely have
series out-of-order. I suspect this is because it bases them on arrival
date and sometimes certain mailers get it out of order when sending.


  reply	other threads:[~2024-04-11 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09  0:05 [PATCH] mailsplit add option to include sanitized subject in filename Jacob Keller
2024-04-09  1:55 ` Junio C Hamano
2024-04-11  3:22   ` Jacob Keller
2024-04-11  5:29     ` Junio C Hamano
2024-04-11  5:55     ` Junio C Hamano
2024-04-11 18:52       ` Jacob Keller [this message]
2024-04-11 21:25         ` Junio C Hamano
2024-04-13  0:07           ` Jacob Keller

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://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=5a25d75c-cc27-49d9-a49d-39f657fd17f4@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.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).