From patchwork Fri Mar 8 10:16:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10844503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27946139A for ; Fri, 8 Mar 2019 10:17:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 148582E983 for ; Fri, 8 Mar 2019 10:17:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0915D2E9AF; Fri, 8 Mar 2019 10:17:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC7592E983 for ; Fri, 8 Mar 2019 10:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbfCHKRw (ORCPT ); Fri, 8 Mar 2019 05:17:52 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36406 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbfCHKRw (ORCPT ); Fri, 8 Mar 2019 05:17:52 -0500 Received: by mail-pg1-f195.google.com with SMTP id r124so13807248pgr.3 for ; Fri, 08 Mar 2019 02:17:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wBIj5mKfXxHwKmcmljghJVzH2ZCtQfxyK9TDIuka+/k=; b=gBMWei7LmXvWnWyYEO0ktCAGUrynS9JtbD9SlWl9O7m88chbKZV5SSCrWaBO6MaGf6 XRjZUsHG5D6iLoKXHBejwa/fsPuy3usg7FcQR1PxtSVSuzrDvrO2/G24lE6DlfKDYcom +2rzkB+Yb2NsQQ9k4eVjxrrY8t+kUicdWi2MKHuLohHAUHuiiXn0VBeRXruUunpGZL1U s3hrMpu3fV8dJnbiZ8+69dpbrpOrU1MiLYHgO5+GudglwIi82MhXvBdYIioi9fzp6WEk PmBLWKPTFB7Iy6xc3b1cJOn8IiCzHbzogTtvQThvNfChBASwaygK0ZyrjWL15XXiK678 5J7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wBIj5mKfXxHwKmcmljghJVzH2ZCtQfxyK9TDIuka+/k=; b=n++3NEgMjc3sRVtJwv7r0MKs+PnaFbUyBcrJwbP1r5HyC7per5PTdDRhHyPsvuONtu R/odqoDeTUyp0nBMVhTw2I9dwitEN2x96qs6Lak1Ibg2s1V2GURAjYwOnpDdLUNFwRVc VngdK2p/6qlk13prT5vG4zifHqtlKWSnikEOxLJvOZfwnVxeQHcG3V+ubwAQwpTHFB8+ VrUPTG4I4WrXEvek6hE5hWp/8hLq04v2Tz+a2YLLjZkEut6tfFkItb9F4ePjWvKpRxZx 8qhESau/MqbjNSWOM93iLwmWVcqdl8xI9hPGONPYIEkgltakDwnkvdIQ7qf1lwu86i/b 0ugg== X-Gm-Message-State: APjAAAV1ESIDw9R94v5qr5DL8zs9wgWXBy39UiDFrbnc7nPtZNJs0Y/e oAlea0eQZH8KgQhklL3Wzw09hNlX X-Google-Smtp-Source: APXvYqxqX71YIDSwXsnKHTKyKfVmACCR1b9hEiMT9rN4AUpvC4X0QsesqwoQZxa2r6GW2g1wxFIVtw== X-Received: by 2002:a17:902:d88c:: with SMTP id b12mr18190957plz.339.1552040271855; Fri, 08 Mar 2019 02:17:51 -0800 (PST) Received: from ash ([171.226.148.85]) by smtp.gmail.com with ESMTPSA id h64sm11330314pfj.40.2019.03.08.02.17.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 02:17:51 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Fri, 08 Mar 2019 17:17:47 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: Junio C Hamano , Elijah Newren , =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH v1 10/11] completion: support restore Date: Fri, 8 Mar 2019 17:16:54 +0700 Message-Id: <20190308101655.9767-11-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc1.337.gdf7f8d0522 In-Reply-To: <20190308101655.9767-1-pclouds@gmail.com> References: <20190308101655.9767-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Completion for restore is straightforward. We could still do better though by give the list of just tracked files instead of all present ones. But let's leave it for later. Signed-off-by: Nguyễn Thái Ngọc Duy --- contrib/completion/git-completion.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 7fcf28d437..0b22e68187 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2483,6 +2483,21 @@ _git_reset () __git_complete_refs } +_git_restore () +{ + case "$cur" in + --conflict=*) + __gitcomp "diff3 merge" "" "${cur##--conflict=}" + ;; + --source=*) + __git_complete_refs --cur="${cur##--source=}" + ;; + --*) + __gitcomp_builtin restore + ;; + esac +} + __git_revert_inprogress_options="--continue --quit --abort" _git_revert ()