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 668331F953 for ; Tue, 30 Nov 2021 09:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236183AbhK3J6i (ORCPT ); Tue, 30 Nov 2021 04:58:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbhK3J6h (ORCPT ); Tue, 30 Nov 2021 04:58:37 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734E8C061574 for ; Tue, 30 Nov 2021 01:55:18 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id a18so43125028wrn.6 for ; Tue, 30 Nov 2021 01:55:18 -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:mime-version :content-transfer-encoding:fcc:to:cc; bh=bmsliC5ESBWii1OQo62NEhUYVVUvYzGUUGoKxXEY+u8=; b=n3QoqE/zq8oN9cSAXkMTOawEWVjhB31QYueWNiVDFuA6aZos+rouwsXbOMbW7yE7O6 mvyR/1n4v3k6Cwyt8ZI4EvBfmT3MXG0MsrAI+KU1Nx8WLpHb0ew8wjD7qcf0P3Y9WBBa wt4usYb/wwxvtwIKXWGb8FOiiQTLWJXPk9hJM29EZPL+8Yd9Exj1kpLSI9A+MdJRwENI O2EsCCKfwns8ed/xB9c8Ga4iph6MvYiFtyEPlMCvW8EvDSj1UsIUnL9AngTdkeoflnfx 5y8sBj/pjmCb6HTy6lDAO6Octd2+0VGUFSayl1IuLS0GdYIGX+qYEez9zpuUIdic2LsL lNfA== 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:mime-version:content-transfer-encoding:fcc:to:cc; bh=bmsliC5ESBWii1OQo62NEhUYVVUvYzGUUGoKxXEY+u8=; b=Uf4j+DtCrH3QzYs7JIAabZThHWptekdXYzdwzPS1Z6659U18wjWFD/MulGSnPRi9lA 50bWjQV4Yxzu47QEIiMMM551hvxvuhcZ3kmVwmlRdMlxPL/hTfo/ZYf7+bBXTwWMhVte /siTED7ugdHRlJ30atXMmfL608HVPXyy8ek/RKDAEtMRBskfRlxEMZNgnnYXuDZ2Z04/ hFH5dFGxxd/BCafa3YXdM4cNy36OxQOLPZN7sPl4XxGfQPsp6Ri8CyS0FiL43YPjQW7P 5ZODwpXHu0mQraqCUTyNyc92gyqo9jKQ1aCqEc5KLV48Z5ubuv5YIZiThYUqctA2463L UqYg== X-Gm-Message-State: AOAM5325WAoDFkaOZ7kwkTwrFTsJxO6NrkTyb4U/4I6vLUiZBLI8yMJd ARGjQjkltXyVUvnue6JiGRJtxQgEiXA= X-Google-Smtp-Source: ABdhPJxpXQD/RxD+9k0AMswnPyyeUV2ktXgzt6E/hmxhsUVAnm6d+C3JFO3UsoRpMUTOD9+ujndfGw== X-Received: by 2002:adf:f98c:: with SMTP id f12mr39802428wrr.184.1638266116588; Tue, 30 Nov 2021 01:55:16 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f8sm2023096wmf.2.2021.11.30.01.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 01:55:16 -0800 (PST) Message-Id: In-Reply-To: References: From: "Aleen via GitGitGadget" Date: Tue, 30 Nov 2021 09:55:12 +0000 Subject: [PATCH v13 0/3] am: support --empty=(die|drop|keep) option and --allow-empty option to handle empty patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fcc: Sent To: git@vger.kernel.org Cc: =?UTF-8?Q?Ren=C3=A9?= Scharfe , Phillip Wood , Johannes Schindelin , Elijah Newren , 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. ---------------------------------------------------------------------------- Changes since v6: 1. add i18n resources. ---------------------------------------------------------------------------- Changes since v7: 1. update code according to the seen branch. 2. fix the wrong document of git-am. 3. sign off commits by a real name. ---------------------------------------------------------------------------- Changes since v8: 1. update the committer's name with my real name to fix DCO of GGG. ---------------------------------------------------------------------------- Changes since v9: 1. imitate the signed name format of https://lore.kernel.org/git/pull.1143.git.git.1637347813367.gitgitgadget@gmail.com . ---------------------------------------------------------------------------- Changes since v11: 1. introduce an interactive option --allow-empty for git-am to record empty patches in the middle of an am session. ---------------------------------------------------------------------------- Changes since v12: 1. record the empty patch as an empty commit only when there are no changes. 2. fix indentation problems. 3. simplify "to keep recording" to "to record". 4. add a test case for skipping empty patches via the --skip option. 徐沛文 (Aleen) (3): doc: git-format-patch: describe the option --always am: support --empty=