git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Braun <rbraun@sceen.net>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Maildir ordering in git-mailsplit (was: Using mutt as a git maintainer)
Date: Sat, 7 Aug 2010 13:21:59 +0200	[thread overview]
Message-ID: <20100807112159.GA12015@sceen.net> (raw)
In-Reply-To: <20100807024337.GA15410@kytes>

On Sat, Aug 07, 2010 at 08:13:39AM +0530, Ramkumar Ramachandra wrote:
> Hi Richard,
> 
> Ah, it looks like this problem went unnoticed probably because
> everyone uses mboxes. One possible solution would be to teach
> `git-mailsplit` to order the emails correctly. You can reply with an
> RFC patch; I've CC'ed the Git list on this email.

Well, if everybody else has survived for five years with mbox patch
series, I guess I can do that too. With some not-so-difficult work, I
managed to have Mutt do what I wanted (that is, saving patch series in
mbox files in one macro and keep everything else with Maildir folders
untouched).

After some digging in the code, it doesn't look like a git issue. When
a Maildir folder is processed, its entries are actually sorted, unlike
what I first thought. populate_maildir_list() calls string_list_insert()
(in string-list.c) which does insertion sort through its static
add_entry() and get_entry_index() functions which use a bare strcmp() to
compare file names (it was path-list.c back in Git 1.5, same code).
When copying a threaded patch series in a Maildir folder with Mutt, here
are the names created:
1281177008.8677_101.myhostname:2,
1281177008.8677_103.myhostname:2,
1281177008.8677_105.myhostname:2,
1281177008.8677_107.myhostname:2,
1281177008.8677_109.myhostname:2,
1281177008.8677_111.myhostname:2,
1281177008.8677_113.myhostname:2,
1281177008.8677_11.myhostname:2,
1281177008.8677_13.myhostname:2,
1281177008.8677_15.myhostname:2,
1281177008.8677_17.myhostname:2,
1281177008.8677_19.myhostname:2,
1281177008.8677_1.myhostname:2,
1281177008.8677_21.myhostname:2,
1281177008.8677_23.myhostname:2,

And for such names, git am determines that e.g.
"1281177008.8677_107.myhostname:2", should be applied before
"1281177008.8677_17.myhostname:2,", which is obviously wrong.

I'm not sure about what depends on string-list.c, but based on the
output of a raw grep, it doesn't seem like a good idea to change the
way strings are sorted, especially if almost noone uses Maildir for
patch series. The best solution IMO would be a Mutt hook to alter the
file names or something like that. A good workaround is configuring it
to use mbox as the default format and keep existing folders as Maildirs
(that's what I'm doing now). I guess the only file to patch in any case
is Documentation/SubmittingPatches, adding an entry for Mutt in the MUA
hints part (if possible with the renaming hook if someone knows how to
do that - I'll search a bit on my side - or with an explanation of the
issue and the simple mbox workaround).

-- 
Richard Braun

  reply	other threads:[~2010-08-07 12:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100806222847.GA4240@sceen.net>
2010-08-07  2:43 ` Maildir ordering in git-mailsplit (was: Using mutt as a git maintainer) Ramkumar Ramachandra
2010-08-07 11:21   ` Richard Braun [this message]
2010-08-07 13:23     ` Jakub Narebski
2010-08-10 17:54       ` Nicolas Sebrecht

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=20100807112159.GA12015@sceen.net \
    --to=rbraun@sceen.net \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.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.
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).