From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 577DE1F9F4 for ; Fri, 19 Nov 2021 05:05:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbhKSFIH (ORCPT ); Fri, 19 Nov 2021 00:08:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhKSFIG (ORCPT ); Fri, 19 Nov 2021 00:08:06 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A7AC061574 for ; Thu, 18 Nov 2021 21:05:05 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id u1so15873862wru.13 for ; Thu, 18 Nov 2021 21:05:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=PAaEEKCqQ8+zs1wbCxLCty3jmK6UUWPR6ezzA1MGoeI=; b=kUaq2HjfxqjJoIaRuoMAPpFGYowHMevVoS7QQibNxAavrugdxTLExBcpFoNr/zvsby 0764nJgjk4VX+UEeehDQNoOvabQExFNAHKaE5aA5rws/oFcVlcEnBYXrwS49NulznTuI jcz+GfuZr9iyyeFGrgvBCu+gklQXt7T8n/gDyOB6RmSZjLB2rxwzgCPF2swp5FKzbNv9 2OIT43UA+qFUzAJdiWS/GPuryvM0KCy/0qZPu118lGANlasLUm6twkPzUdgNxs2JHj+6 yEYE9EE7WyLOcVKMxPfrH9mvOvBh9PUyxI75o7XmFaO4NiqBNuDAjq5vWFd9TeqiIADB 7clw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=PAaEEKCqQ8+zs1wbCxLCty3jmK6UUWPR6ezzA1MGoeI=; b=19zmDG/ny021iT1n71oa4f1M5fCGKs4ocQcNSmoMzDKLbA1Z6lVQP1zYPyOdvobbBv oxOCQcuGaMd+4288Mxp2BfHAdRKZI0/30dR+anJwpR9/hm05b8nYLZNo1BbIt+ZRAptt wLbP5YY7j3HyJsxu/ItemIz0IlKhmLxJDggnT8NVYBy8tc2CzxArUJEiEKB1s4X0flN1 VBDJggWDtPse7bCnMpxmHdPIVmWGuQndtLqhy5FJVOPopiMEkfotvSdS0HNRZ4M8yMyW Qf6+si1jp9VCo0Mr6bNAsMKL030Dga1wNp4yqeERZbl4tER0bcLdGlCXLj8zXZ0rMEMT Os1Q== X-Gm-Message-State: AOAM532WEBEFQcV1j/MdOpx5EBQ4pbBlqkAnVOEQxKb/UGBy6s5S1zAk 8chxZz0CaZUy0SxjPZ7R5kICPXN7VrE= X-Google-Smtp-Source: ABdhPJz9fVzn4xWPO/ZbB7pHcQc/ws0jvMqGAztY51lzOSF7lp9KIKtjg32lZmFH8oIp8+O4Cg1R5w== X-Received: by 2002:adf:d22a:: with SMTP id k10mr3894832wrh.80.1637298303128; Thu, 18 Nov 2021 21:05:03 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l26sm1920334wms.15.2021.11.18.21.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 21:05:02 -0800 (PST) Message-Id: In-Reply-To: References: From: "Aleen via GitGitGadget" Date: Fri, 19 Nov 2021 05:04:56 +0000 Subject: [PATCH v7 0/2] am: support --empty=(die|drop|keep) option to handle empty patches Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: Aleen =?UTF-8?Q?=E5=BE=90=E6=B2=9B=E6=96=87?= , Aleen Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since that git has supported the --always option for the git-format-patch command to create a patch with an empty commit message, git-am should support applying and committing with empty patches. ---------------------------------------------------------------------------- Changes since v1: 1. add a case when not passing the --always option. 2. rename the --always option to --allow-empty. ---------------------------------------------------------------------------- Changes since v2: 1. rename the --allow-empty option to --empty-commit. 2. introduce three different strategies (die|skip|asis) when trying to record empty patches as empty commits. ---------------------------------------------------------------------------- Changes since v3: 1. generate the missed file for test cases. 2. grep -f cannot be used under Mac OS. ---------------------------------------------------------------------------- Changes since v4: 1. rename the --empty-commit option to --empty. 2. rename three different strategies (die|skip|asis) to die, drop and keep correspondingly. ---------------------------------------------------------------------------- Changes since v5: 1. throw an error when passing --empty option without value. ---------------------------------------------------------------------------- cc: René Scharfe l.s.r@web.de cc: Phillip Wood phillip.wood123@gmail.com cc: Aleen 徐沛文 pwxu@coremail.cn Aleen (2): doc: git-format-patch: describe the option --always am: support --empty=