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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 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_HI, SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 66DD91F463 for ; Tue, 3 Dec 2019 14:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726879AbfLCOCf (ORCPT ); Tue, 3 Dec 2019 09:02:35 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53905 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbfLCOCe (ORCPT ); Tue, 3 Dec 2019 09:02:34 -0500 Received: by mail-wm1-f65.google.com with SMTP id u18so3048311wmc.3 for ; Tue, 03 Dec 2019 06:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=uPnuCxytSlg2XUVw0Kr9yCWNSKZBf1W0pRuLK5VjlXY=; b=fWY79jB/Lx/n9wVQ7za11CwJoc21TjCrO0dgvNedSyFQbRqzhpWwCMchOFgg7K9cxI UI2ECGYvwgL5MYY7jnvMvdU3qOePmp4RELdCft9CZB/MQdiUvz7KTARPAPiaT6ydq5v0 u63qCR0kWM9PU/Em5RN5ZrOw+TADH506PWl6gWjFlo8xk1gXEliHyOGVXCgrwya8MIm0 uy7NeCDTAbfMjeuYw6In8U76kfdSF7nIMAQ4ilYKVZm2AIyyaI1A4tjVPgHzDxgHqc5q motFyLxPx7SwcXSPA2YWRpD5CKPZ1Q63mkHaGEZMwy0xSMlNgdZkZEicWhhuWEKaaszy y+2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=uPnuCxytSlg2XUVw0Kr9yCWNSKZBf1W0pRuLK5VjlXY=; b=NN8SYJnqBsy/i/O0w+40XNPoZx9fkUhbRIi6s5aKHEHPD//Zbn1jx1Bf/B3lWL3v0B Rfk7GF3CLD42ote24BRcnCgp0I4mtv4jzyIuofjMaOImpWRbfjVloYlfUYN1QMu4NSVi 1BqM66rIQnJ6YwCFVV60r0x9UlNn53yzRPWO/155YxxcTn7AYnvX83DsVRES2X5DhItC zW8u3wkB+RU+ZTCr0ISu15l9MMUdzse6fBofyZDtuQfN8VUPCSJYFZodOAeoIzxHicjv f2yuVEGliZRGzNe9N0PbUJU+vW/YQw+P+2f+7Qu8IpF68SWLMxt1ycwWvecp+qtrgMpt zDgw== X-Gm-Message-State: APjAAAVKVOqH0Wzgy5KffC/LRidx3sldf7B6jb6nyH9AUhfgQnLLPKuU Tbz6aBBo9BM4VkfH+O528j/oGUsA X-Google-Smtp-Source: APXvYqxlc90GdRElpcVbJZ9pU7rN74SF6GlMX3ZEl5n3gGryjgb5nehHJJsB0cjVPmZ/2wlTK+aVeQ== X-Received: by 2002:a1c:7910:: with SMTP id l16mr14870642wme.27.1575381750437; Tue, 03 Dec 2019 06:02:30 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a16sm3552039wrt.37.2019.12.03.06.02.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Dec 2019 06:02:30 -0800 (PST) Message-Id: In-Reply-To: References: From: "Alexandr Miloslavskiy via GitGitGadget" Date: Tue, 03 Dec 2019 14:02:18 +0000 Subject: [PATCH v4 13/13] checkout, restore: support the --pathspec-from-file option Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Alexandr Miloslavskiy , Junio C Hamano , Alexandr Miloslavskiy Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Alexandr Miloslavskiy Decisions taken for simplicity: 1) For now, `--pathspec-from-file` is declared incompatible with `--patch`, even when is not `stdin`. Such use case it not really expected. 2) It is not allowed to pass pathspec in both args and file. `you must specify path(s) to restore` block was moved down to be able to test for `pathspec.nr` instead, because testing for `argc` is no longer correct. `git switch` does not support the new options because it doesn't expect `` arguments. Signed-off-by: Alexandr Miloslavskiy --- Documentation/git-checkout.txt | 15 ++++ Documentation/git-restore.txt | 14 +++ builtin/checkout.c | 31 ++++++- t/t2026-checkout-pathspec-file.sh | 139 ++++++++++++++++++++++++++++++ t/t2072-restore-pathspec-file.sh | 139 ++++++++++++++++++++++++++++++ t/t9902-completion.sh | 2 + 6 files changed, 336 insertions(+), 4 deletions(-) create mode 100755 t/t2026-checkout-pathspec-file.sh create mode 100755 t/t2072-restore-pathspec-file.sh diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 93124f3ad9..ffe3c1bff2 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -13,6 +13,7 @@ SYNOPSIS 'git checkout' [-q] [-f] [-m] [--detach] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=