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.8 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 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 4297B211B3 for ; Thu, 29 Nov 2018 21:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbeK3JG3 (ORCPT ); Fri, 30 Nov 2018 04:06:29 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36370 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbeK3JGS (ORCPT ); Fri, 30 Nov 2018 04:06:18 -0500 Received: by mail-lj1-f196.google.com with SMTP id g11-v6so3161711ljk.3 for ; Thu, 29 Nov 2018 13:59:21 -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=sdBHp/nTbWrYRZ0prozY7gej5mMZwainL1ZP3Gm3Tlg=; b=ECVaRG/egZr8vkbpWlTQqgP+P4htxttlB4Z0+Kfnxlc9orzvqYi7GJBCc4dfXwgVLk Wy7F1w2DiMDtk6XpOj5MasZI3lOboD78pvnNWrckWQBU9fhpxq+sEDlOsyCkQ+7+BmS4 959KAf0zp48yvE8Bz4+X/xPvtAMBqgt7NeakYO/4Kd/CA5LgJJ9TdPYipsaRiKOc5DAU ifwrmHVSazvQbU0CymiJnXBiux9p/cleKMSUGAFVmyV0+OJUBXq2FNxlerH4KxnwHD6o POf5O59hWTcHUGiP2vOBvlwzn1Ll9nTDS+4oaXD4UBw3ILT/feGK3Hy8YLmOOOUD9qm7 7XOA== 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=sdBHp/nTbWrYRZ0prozY7gej5mMZwainL1ZP3Gm3Tlg=; b=HnKQOXSqHGI7eLP7prdvYTY1WxtvTkOYo+/emao7R6SNzK3A05nF+lWi3+/sngzdIX JaGEX5UqSAXRJ8Do+QtFSsCXZigvY9wi6Gs6Q5QNpZuK5kcP5dJAyk2/Jt5uPtVdi3/x FWHUvsQ+4LS/na7BBYeAV7hsGXsSvxYc7k8hXBDxvxXzwM3YoQEVhflt/7tupYL+HTMg AQCslTrskevd+iyP1mTVM7nBv+kzBqfB0L1g3vQYajz+5wwtN5Rblhfc+0BH9quANeyg hnm1i7PQMJawypp45O2X3GaeFDMWINpW0/qTkfIR3dp7xGIF8GphTAkWCqDG4Vw3zUiH ahDw== X-Gm-Message-State: AA+aEWbLJftEyjt8P0RbdRfxkRZzUbTMC1JhU6UuZU6RTTdHSnxl2yLx rnIjEcnfgd8hYxm71axpIYM= X-Google-Smtp-Source: AFSGD/XWSU3AQUA4gUUEEJSir1xtVIvXbfjxkT5XSIwICZD98HNP5sEA2QMFWsh6TELSa6tZjQGFdQ== X-Received: by 2002:a2e:7d15:: with SMTP id y21-v6mr1952231ljc.77.1543528760433; Thu, 29 Nov 2018 13:59:20 -0800 (PST) Received: from localhost.localdomain (c80-216-2-165.bredband.comhem.se. [80.216.2.165]) by smtp.gmail.com with ESMTPSA id o17sm489703lff.77.2018.11.29.13.59.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 13:59:19 -0800 (PST) From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= To: pclouds@gmail.com Cc: avarab@gmail.com, git@vger.kernel.org, gitster@pobox.com, sbeller@google.com, t.gummerer@gmail.com, sxenos@google.com Subject: [PATCH v3 07/14] checkout: split into switch-branch and restore-files Date: Thu, 29 Nov 2018 22:58:42 +0100 Message-Id: <20181129215850.7278-8-pclouds@gmail.com> X-Mailer: git-send-email 2.20.0.rc1.380.g3eb999425c.dirty In-Reply-To: <20181129215850.7278-1-pclouds@gmail.com> References: <20181127165211.24763-1-pclouds@gmail.com> <20181129215850.7278-1-pclouds@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "git checkout" doing too many things is a source of confusion for many users (and it even bites old timers sometimes). To rememdy that, the command is now split in two: switch-branch and checkout-files. The good old "git checkout" command is still here and will be until all (or most of users) are sick of it. See the new man pages for the final design of these commands. The actual implementation though is still pretty much the same as "git checkout". Following patches will adjust their behavior to match the man pages. Signed-off-by: Nguyễn Thái Ngọc Duy --- .gitignore | 2 + Documentation/git-checkout.txt | 5 + Documentation/git-restore-files.txt | 167 ++++++++++++++++ Documentation/git-switch-branch.txt | 289 ++++++++++++++++++++++++++++ Makefile | 2 + builtin.h | 2 + builtin/checkout.c | 84 ++++++-- command-list.txt | 2 + git.c | 2 + 9 files changed, 543 insertions(+), 12 deletions(-) create mode 100644 Documentation/git-restore-files.txt create mode 100644 Documentation/git-switch-branch.txt diff --git a/.gitignore b/.gitignore index 0d77ea5894..c63dcb1427 100644 --- a/.gitignore +++ b/.gitignore @@ -143,6 +143,7 @@ /git-request-pull /git-rerere /git-reset +/git-restore-files /git-rev-list /git-rev-parse /git-revert @@ -167,6 +168,7 @@ /git-submodule /git-submodule--helper /git-svn +/git-switch-branch /git-symbolic-ref /git-tag /git-unpack-file diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 25887a6087..25ec7f508f 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -406,6 +406,11 @@ $ edit frotz $ git add frotz ------------ +SEE ALSO +-------- +linkgit:git-switch-branch[1] +linkgit:git-restore-files[1] + GIT --- Part of the linkgit:git[1] suite diff --git a/Documentation/git-restore-files.txt b/Documentation/git-restore-files.txt new file mode 100644 index 0000000000..03c1250ad0 --- /dev/null +++ b/Documentation/git-restore-files.txt @@ -0,0 +1,167 @@ +git-restore-files(1) +==================== + +NAME +---- +git-restore-files - Restore working tree files + +SYNOPSIS +-------- +[verse] +'git restore-files' [-f|--ours|--theirs|-m|--conflict=