From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7B2311F44D for ; Sat, 13 Apr 2024 00:07:47 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Kx1MIScv; dkim-atps=neutral Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7F7C01F224AC for ; Sat, 13 Apr 2024 00:07:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 286E71848; Sat, 13 Apr 2024 00:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kx1MIScv" Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D78F641 for ; Sat, 13 Apr 2024 00:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712966856; cv=none; b=WeGzrkoORxDnyFQXr3bFiZynKpq7VBkazVDJAL9qfNsCu+OLV57HZYO5v21ZKf2kVn59F22u371pWErfbdb9+m6nHHmRYYDg5p2y259LiL8y5xD7uz7aOqQTPBMxHnzUOXJCEYfHeT6xjPPhbextpSBNDvVqPYgZsNIWEz9wWKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712966856; c=relaxed/simple; bh=rdU3zIIqoB8327ft3T8iF/+kZBxtWvbHIk47V3/kakI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fw0NySl5PqWnRJoKa6GEnAqkqpJ1/d8WwGK+B61DNPCSTbsld36Z/VW7i8mHjY3xLOM0sSzcSPqsfuMfmgp2kAChNL1JklxLIFl4F+voS7Dp86dqmWaWG5a3orwa1ptszY98jGPM5+a+f5RHCj/H1POo2/cGt0an87ZCrt98nLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Kx1MIScv; arc=none smtp.client-ip=209.85.161.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5a7d6bc81c6so1097473eaf.2 for ; Fri, 12 Apr 2024 17:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712966854; x=1713571654; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SDS2CYBBlCs1zujSYVmwHFcrITpYE+wNtfJC7VnL2MU=; b=Kx1MIScvduUn5QAqRndCeDK1SBajK1kvDDixmy9JMp3/ZzcLvPO++f6oVXnot2MvUE tY3wPgV2ePJfcx6iHR6LHqAkils8hbaS/cQkLZE+PT3MuNoqYhn258tdVhD0lHhVet+h uHWySmXYKXVMz87ZLDlg0MqkrbwBB9PnkKfKAp1aojxTzeHdWNxKxcfEICa6r7svmjJ9 tyLcUiD3pfPiip2RMw1akP8ph08Iqw3BCqORUIn++uovBOaQ8xzUAf+6vLwWXSva8RuC UVsSzRcSL4foX6VYMFj6GKiYLZ5ptJm5kPGYAOE6mcbYyVf/MD9Tay8iKkqO6XyeecP7 jiYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712966854; x=1713571654; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SDS2CYBBlCs1zujSYVmwHFcrITpYE+wNtfJC7VnL2MU=; b=uV9c29gvP6ca3ymLVe3Ljfk46unZ2612FQ5IhY6LAZntX+8QJuxoMw8HQjmM9zD9Zh h1TvDTV00Sn32IFvC/h5mOVSfn6wMsJcQG4LgQVHyGbAlWCtxkeEYwlv23LCj55AgAjb iJEXoELQvTBGOGAgIeALRzjfBLe3++UaLFLVO7jAXYPxiv/4xXYTVuygurNaT9hhzzve hi/KiAJ9Nd3W0gPJIzOhz6XMUH13pTB/769SBZd/9Ru3b2PMOaZr6Kjb8o60co2fBQzn rly3W1Rhh2Wv2xMFrPYPmmy1slNoKQBWn9XcwxFSWXHpT1KhNsbMJ3r0SmzMbEfba4ZR ESSw== X-Forwarded-Encrypted: i=1; AJvYcCVhI4AupLbsiSxSgT/j9vZ1YT4Qme59zLz+tu/q/YruZBYTWcrMXup9ZNHH47BLeNbnKmSp7lCKAV078O34aW8l1f3i X-Gm-Message-State: AOJu0YzTQYyxvgjt5++CoAjVD0c5GHc/A9T2Gp9EBRBZcdsPmFNM8gL2 XXQcVCpBklv/94RFMMTOQBQRRU018JXpHk2GO2aZlP8tzRjinEezLca04Iv2hf/9hke+4/A/XEF d3VsV7ewqW7ixr6Ksy2QcH254tGw= X-Google-Smtp-Source: AGHT+IEFZqto4o2wRcK8IKMwWHSLrMzTU2QF03zsdvIpCOOKuKp557I8aG6oDkItSqLv6447wB22R8vGdKPVBWDYHEo= X-Received: by 2002:a05:6820:986:b0:5aa:3c6a:c5f3 with SMTP id cg6-20020a056820098600b005aa3c6ac5f3mr4318117oob.9.1712966854512; Fri, 12 Apr 2024 17:07:34 -0700 (PDT) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240409000546.3628898-1-jacob.e.keller@intel.com> <5a25d75c-cc27-49d9-a49d-39f657fd17f4@intel.com> In-Reply-To: From: Jacob Keller Date: Fri, 12 Apr 2024 17:07:23 -0700 Message-ID: Subject: Re: [PATCH] mailsplit add option to include sanitized subject in filename To: Junio C Hamano Cc: Jacob Keller , git@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 11, 2024 at 2:25=E2=80=AFPM Junio C Hamano = wrote: > > Jacob Keller writes: > > >> 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 th= e > > new names. I can look at using opendir/readdir here instead. > > Not "here", but probably just after you called "mailsplit" and saw > it return. After that nobody should be adding more split mail > messages to the directory, so you do it once to grab all filenames. > > > 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 hav= e > > 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. > > Yeah, and that is why I said it would be a better use of the > engineering resource to fix it at the source. Such a fix will > benefit folks with existing versions of "git am", not needing to > wait for your improved version. > > Thanks. I went and talked to the public-inbox folks, and discovered that there is a known problem and solution, with a utility called b4 intended for downloading mbox files from the public-inbox https://b4.docs.kernel.org/ Thought I'd mention that here if anyone else reading this thread was curious about an ultimate solution. b4 will find patches in the series, sort them, remove the replies and can do some other common cleanup operations including things like applying tags from other messages on the list.