From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 662E7C761AF for ; Mon, 3 Apr 2023 22:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233482AbjDCWwZ (ORCPT ); Mon, 3 Apr 2023 18:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233744AbjDCWwW (ORCPT ); Mon, 3 Apr 2023 18:52:22 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAA4849D4 for ; Mon, 3 Apr 2023 15:52:05 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id le6so29519883plb.12 for ; Mon, 03 Apr 2023 15:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680562325; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=p/tRAtoLIS26WMfBgLZ9YdhOGMsl9rm4QTbrB2TyvsE=; b=kyLwyGCwAW41ihhx4mYJCNuH6aZhw1S+jpSatDSgX8jx1QjUvPJCzu7pUSofLWAJdV Jx3ZIGsdtKLuH37wn6pl9PU47i50BKd34hm/RyZYqPcLXbH72c186mCn1BcR+/pkvDgY My+YPiKUirGzPzMpaGheIcD9mhXbNDQMaZBJufKFyJkguaNCOHxHuZ4mgYp69yjuu/CV 5xwt22hAtCFjSqwuXniegrzHbjqVo4EB54TF077gF5Gajo/HbQCJNZThetQsltsUkk6+ Jy9SG898xWUbzfSRTX0pxOMS46e6rTWQ4Vl3j2e+LsUg2Mu5CzEruCEgA/40mpmpCPBA N3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680562325; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:sender:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=p/tRAtoLIS26WMfBgLZ9YdhOGMsl9rm4QTbrB2TyvsE=; b=bAbOHY3zIhSYayBcXwYfbrbpInuBIju4m7sdx/WjKR9kQtb0gpD1SYCkTAIukLl1WM 8biGdQpoJk97qdnYL56AE+wQVN7zPf+LYxFFo2EH5WDX+orpYZqAsw4q04wMDAAIdIuY +B2ZXNwLX5mFEDZBZIEhx1+b8NTvq/LEmSaFkAtUyAC3Oxn+XvI9lrxvyMShN9JHRKcn 0u1bHnirzcqtFzwFJ5miQiusMWXXar6K1VwV9CVBDAqfdGUjk8AHcrJEc+TfmRsGtxWP 2NRPCv8W39Q30kVD6qrOJkFKJShVo3caaPTwHsieIpOOWQSPRIc7CRBpD6eglAc3TcRu fzEA== X-Gm-Message-State: AAQBX9d4Jn8bJTt1LVelpj1cYgvM2JT+LsSoXkeNYx515WVaiBMwf/hn nQXpkhpqtdbWlm3OZLiS0wI= X-Google-Smtp-Source: AKy350ZWTM2oWv3Ap35Z/uDydC+RXLcoz6bSRjn8FE806Ka7BfHRO0yET8DXYlelhmQYVqUJDk9WnA== X-Received: by 2002:a17:90b:4f41:b0:237:29b1:1893 with SMTP id pj1-20020a17090b4f4100b0023729b11893mr384334pjb.46.1680562325048; Mon, 03 Apr 2023 15:52:05 -0700 (PDT) Received: from localhost (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id s17-20020a17090a881100b002372106a5casm6630474pjn.44.2023.04.03.15.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 15:52:04 -0700 (PDT) Sender: Junio C Hamano From: Junio C Hamano To: "Robin Jarry" Cc: , , "Tim Culverhouse" , "Nicolas Dichtel" , "Bagas Sanjaya" , "Eric Sunshine" Subject: Re: [PATCH RESEND] hooks: add sendemail-validate-series References: <20230402185635.302653-1-robin@jarry.cc> <66099367-4ea0-7d2a-a089-7a88e27f695e@dunelm.org.uk> Date: Mon, 03 Apr 2023 15:52:04 -0700 In-Reply-To: (Robin Jarry's message of "Tue, 04 Apr 2023 00:29:47 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "Robin Jarry" writes: > Thinking again about that. The probability that a file path name > generated by git-format-patch would contain LF is close to zero. Close to zero is very different from absolutely zero, and in the case of format-patch generated patches, I think it is absolutely zero. At least, that was the case back when I designed and implemented it, and I do not think I accepted a patch to break it over the years. But "git send-email" can be fed a list of files and even a directory (and enumerate files in it). The filenames are under end-users' control in this case, so "close to zero" has absolutely no relevance. If the end user means to feed you such a file, they can do so 100% of the time. If we support such a file is a different issue. A good rule of thumb to decide if it is reasonable is to see if the main command already works with such filenames, e.g. $ git format-patch -2 0001-foo.txt 0002-bar.txt $ mv 0001-foo.txt '0001-fo > o.txt' $ mkdir dir $ mv 000[12]*.txt dir/. may prepare two patch files that can be sent via send-email. One file (the first one) is deliberately given a filename with LF in it. Does send-email work on it correctly if you did e.g. $ git send-email dir/000[12]*.txt or something silly like $ git send-email dir or does it already choke on the first file because of the filename?