git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: pclouds@gmail.com
Cc: Johannes.Schindelin@gmx.de, git@vger.kernel.org,
	gitster@pobox.com, jacob.keller@gmail.com, newren@gmail.com,
	rybak.a.v@gmail.com, sunshine@sunshineco.com
Subject: [PATCH v3 00/16] Add new command 'restore'
Date: Thu, 25 Apr 2019 16:45:44 +0700	[thread overview]
Message-ID: <20190425094600.15673-1-pclouds@gmail.com> (raw)
In-Reply-To: <20190411131218.19195-1-pclouds@gmail.com>

v3 changes are really small

- gitcli.txt is updated to mention the --staged/--worktree pair, in
  comparison to --cached/--index which is also mention there.

- The patch 'rm --staged' is dropped. It could come back. But if it
  does, it should be in a series where commands that take
  --cached/--index will now take both --staged/--worktree. Those are
  'rm', 'apply', 'check-attr', 'grep', 'diff' and maybe 'ls-files'.
  
  In other words we support --staged/--worktree everywhere while
  --cached/--index still remains because of muscle memory. This is
  of course only a good move if --staged/--worktree is much better
  than --cached/--index.

- Since there's a chance this series may end up in 'master' and get
  released, and I'm still worried that I screwed up somewhere, the last
  patch declares the two commands experimental for maybe one or two
  release cycles.
  
  If the reception is good, we revert that patch. If something
  horrible is found, we can still change the default behavior without
  anybody yelling at us. Or worst case scenario, we remove both
  commands and declare a failed experiment.

PS. the intent-to-add support is still not in. But it should be in
before the experimental status is removed.

Nguyễn Thái Ngọc Duy (16):
  checkout: split part of it to new command 'restore'
  restore: take tree-ish from --source option instead
  restore: make pathspec mandatory
  restore: disable overlay mode by default
  checkout: factor out worktree checkout code
  restore: add --worktree and --staged
  restore: reject invalid combinations with --staged
  restore: default to --source=HEAD when only --staged is specified
  restore: replace --force with --ignore-unmerged
  restore: support --patch
  t: add tests for restore
  completion: support restore
  user-manual.txt: prefer 'merge --abort' over 'reset --hard'
  doc: promote "git restore"
  help: move git-diff and git-reset to different groups
  Declare both git-switch and git-restore experimental

 .gitignore                             |   1 +
 Documentation/config/interactive.txt   |   3 +-
 Documentation/git-checkout.txt         |   3 +-
 Documentation/git-clean.txt            |   2 +-
 Documentation/git-commit.txt           |   2 +-
 Documentation/git-format-patch.txt     |   2 +-
 Documentation/git-reset.txt            |  13 +-
 Documentation/git-restore.txt (new)    | 185 +++++++++++++++
 Documentation/git-revert.txt           |   7 +-
 Documentation/git-switch.txt           |   2 +
 Documentation/git.txt                  |  20 ++
 Documentation/gitcli.txt               |  16 +-
 Documentation/giteveryday.txt          |   5 +-
 Documentation/gittutorial-2.txt        |   4 +-
 Documentation/gittutorial.txt          |   2 +-
 Documentation/user-manual.txt          |  14 +-
 Makefile                               |   1 +
 builtin.h                              |   1 +
 builtin/checkout.c                     | 299 +++++++++++++++++++------
 builtin/clone.c                        |   2 +-
 builtin/commit.c                       |   2 +-
 command-list.txt                       |   7 +-
 contrib/completion/git-completion.bash |  15 ++
 git-add--interactive.perl              |  52 +++++
 git.c                                  |   1 +
 t/lib-patch-mode.sh                    |  12 +
 t/t2070-restore.sh (new +x)            |  99 ++++++++
 t/t2071-restore-patch.sh (new +x)      | 110 +++++++++
 t/t7508-status.sh                      |  82 +++----
 t/t7512-status-help.sh                 |  20 +-
 wt-status.c                            |  26 ++-
 31 files changed, 850 insertions(+), 160 deletions(-)
 create mode 100644 Documentation/git-restore.txt
 create mode 100755 t/t2070-restore.sh
 create mode 100755 t/t2071-restore-patch.sh

Range-diff dựa trên v2:
 1:  41788fc2d2 !  1:  0d5ea2b7fe checkout: split part of it to new command 'restore'
    @@ -342,6 +342,29 @@
      Low-level commands (plumbing)
      -----------------------------
     
    + diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
    + --- a/Documentation/gitcli.txt
    + +++ b/Documentation/gitcli.txt
    +@@
    + http://marc.info/?l=git&m=119150393620273 for further
    + information.
    + 
    ++Some other commands that also work on files in the working tree and/or
    ++in the index can take `--staged` and/or `--worktree`.
    ++
    ++* `--staged` is exactly like `--cached`, which is used to ask a
    ++  command to only work on the index, not the working tree.
    ++
    ++* `--worktree` is the opposite, to ask a command to work on the
    ++  working tree only, not the index.
    ++
    ++* The two options can be specified together to ask a command to work
    ++  on both the index and the working tree.
    ++
    + GIT
    + ---
    + Part of the linkgit:git[1] suite
    +
      diff --git a/Makefile b/Makefile
      --- a/Makefile
      +++ b/Makefile
 2:  253dfb42ae =  2:  c3c6e7762a restore: take tree-ish from --source option instead
 3:  0266c4d982 =  3:  0fbf963e7d restore: make pathspec mandatory
 4:  ae4dd4c24e =  4:  2509bebf32 restore: disable overlay mode by default
 5:  c51dd232c0 =  5:  206c507f7d checkout: factor out worktree checkout code
 6:  6b19ddb1b3 =  6:  656bfcd659 restore: add --worktree and --staged
 7:  3f1031cc23 =  7:  f2d3aa1027 restore: reject invalid combinations with --staged
 8:  d6d9bed95c =  8:  57efad405d restore: default to --source=HEAD when only --staged is specified
 9:  fca91f3cca =  9:  3c6b32c223 restore: replace --force with --ignore-unmerged
10:  079273e2df = 10:  6665d7523b restore: support --patch
11:  9d28d167fa = 11:  d7bda0c0cc t: add tests for restore
12:  acd490f8b0 = 12:  e4622aff3d completion: support restore
13:  336a7d8921 = 13:  787b0e485e user-manual.txt: prefer 'merge --abort' over 'reset --hard'
14:  3b81b27255 = 14:  0df020c2c8 doc: promote "git restore"
15:  ce7e890524 <  -:  ---------- rm: add --staged as alias for --cached
16:  763aa1d6f1 = 15:  3302b1b0e1 help: move git-diff and git-reset to different groups
 -:  ---------- > 16:  ffeea858a7 Declare both git-switch and git-restore experimental
-- 
2.21.0.854.ge34a79f761


  parent reply	other threads:[~2019-04-25  9:46 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 10:16 [PATCH v1 00/11] And new command "restore" Nguyễn Thái Ngọc Duy
2019-03-08 10:16 ` [PATCH v1 01/11] checkout: split part of it to new command 'restore' Nguyễn Thái Ngọc Duy
2019-03-08 18:01   ` Elijah Newren
2019-03-09 12:16     ` Duy Nguyen
2019-03-09 18:27       ` Elijah Newren
2019-04-09 12:18         ` Duy Nguyen
2019-03-25  9:53     ` Duy Nguyen
2019-03-25 15:51       ` Elijah Newren
2019-03-13  9:17   ` Johannes Schindelin
2019-03-08 10:16 ` [PATCH v1 02/11] restore: take tree-ish from --source option instead Nguyễn Thái Ngọc Duy
2019-03-09 18:13   ` Elijah Newren
2019-03-10  7:58   ` Eric Sunshine
2019-03-08 10:16 ` [PATCH v1 03/11] restore: make pathspec mandatory Nguyễn Thái Ngọc Duy
2019-03-09 18:35   ` Elijah Newren
2019-03-08 10:16 ` [PATCH v1 04/11] restore: disable overlay mode by default Nguyễn Thái Ngọc Duy
2019-03-09 18:37   ` Elijah Newren
2019-03-08 10:16 ` [PATCH v1 05/11] checkout: factor out worktree checkout code Nguyễn Thái Ngọc Duy
2019-03-08 10:16 ` [PATCH v1 06/11] restore: add --worktree and --index Nguyễn Thái Ngọc Duy
2019-03-09 18:52   ` Elijah Newren
2019-03-10 20:03     ` Eric Sunshine
2019-03-13 10:02     ` Duy Nguyen
2019-03-13 22:42     ` Junio C Hamano
2019-03-08 10:16 ` [PATCH v1 07/11] restore: default to --source=HEAD when only --index is specified Nguyễn Thái Ngọc Duy
2019-03-09 18:58   ` Elijah Newren
2019-03-08 10:16 ` [PATCH v1 08/11] restore: support --patch Nguyễn Thái Ngọc Duy
2019-03-09 19:02   ` Elijah Newren
2019-03-08 10:16 ` [PATCH v1 09/11] t: add tests for restore Nguyễn Thái Ngọc Duy
2019-03-09 16:53   ` Andrei Rybak
2019-03-13  9:13   ` Johannes Schindelin
2019-03-13  9:20     ` Duy Nguyen
2019-03-13 22:17       ` Johannes Schindelin
2019-03-14  4:57         ` Duy Nguyen
2019-03-14  5:45   ` Junio C Hamano
2019-03-14  5:55     ` Junio C Hamano
2019-03-08 10:16 ` [PATCH v1 10/11] completion: support restore Nguyễn Thái Ngọc Duy
2019-03-09 19:16   ` Elijah Newren
2019-03-11 15:22     ` Duy Nguyen
2019-03-11 15:39       ` Duy Nguyen
2019-03-11 18:28         ` Elijah Newren
2019-03-08 10:16 ` [PATCH v1 11/11] doc: promote "git restore" Nguyễn Thái Ngọc Duy
2019-03-09 19:37   ` Elijah Newren
2019-03-11 14:11     ` Randall S. Becker
2019-03-11 14:36       ` Duy Nguyen
2019-03-13  4:58         ` Junio C Hamano
2019-04-11 10:55           ` Duy Nguyen
2019-03-10 11:19 ` [PATCH v1 00/11] And new command "restore" Duy Nguyen
2019-03-10 22:45   ` Jacob Keller
2019-03-11 16:01   ` Elijah Newren
2019-03-13 22:58   ` Junio C Hamano
2019-03-14  3:49     ` Duy Nguyen
2019-04-11 13:12 ` [PATCH v2 00/16] Add new command 'restore' Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 01/16] checkout: split part of it to " Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 02/16] restore: take tree-ish from --source option instead Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 03/16] restore: make pathspec mandatory Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 04/16] restore: disable overlay mode by default Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 05/16] checkout: factor out worktree checkout code Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 06/16] restore: add --worktree and --staged Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 07/16] restore: reject invalid combinations with --staged Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 08/16] restore: default to --source=HEAD when only --staged is specified Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 09/16] restore: replace --force with --ignore-unmerged Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 10/16] restore: support --patch Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 11/16] t: add tests for restore Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 12/16] completion: support restore Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 13/16] user-manual.txt: prefer 'merge --abort' over 'reset --hard' Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 14/16] doc: promote "git restore" Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 15/16] rm: add --staged as alias for --cached Nguyễn Thái Ngọc Duy
2019-04-11 13:12   ` [PATCH v2 16/16] help: move git-diff and git-reset to different groups Nguyễn Thái Ngọc Duy
2019-04-12  5:14   ` [PATCH v2 00/16] Add new command 'restore' Junio C Hamano
2019-04-13 10:39     ` Duy Nguyen
2019-04-17 10:04   ` Duy Nguyen
2019-04-18  0:38     ` Junio C Hamano
2019-04-18  9:40       ` Duy Nguyen
2019-04-18 10:03       ` Johannes Schindelin
2019-04-18 10:20         ` Duy Nguyen
2019-04-25  9:45   ` Nguyễn Thái Ngọc Duy [this message]
2019-04-25  9:45     ` [PATCH v3 01/16] checkout: split part of it to " Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 02/16] restore: take tree-ish from --source option instead Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 03/16] restore: make pathspec mandatory Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 04/16] restore: disable overlay mode by default Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 05/16] checkout: factor out worktree checkout code Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 06/16] restore: add --worktree and --staged Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 07/16] restore: reject invalid combinations with --staged Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 08/16] restore: default to --source=HEAD when only --staged is specified Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 09/16] restore: replace --force with --ignore-unmerged Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 10/16] restore: support --patch Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 11/16] t: add tests for restore Nguyễn Thái Ngọc Duy
2019-06-13 15:19       ` SZEDER Gábor
2019-04-25  9:45     ` [PATCH v3 12/16] completion: support restore Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 13/16] user-manual.txt: prefer 'merge --abort' over 'reset --hard' Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 14/16] doc: promote "git restore" Nguyễn Thái Ngọc Duy
2019-04-25  9:45     ` [PATCH v3 15/16] help: move git-diff and git-reset to different groups Nguyễn Thái Ngọc Duy
2019-04-25  9:46     ` [PATCH v3 16/16] Declare both git-switch and git-restore experimental Nguyễn Thái Ngọc Duy
2019-05-07  2:21     ` [PATCH v3 00/16] Add new command 'restore' Emily Shaffer
2019-05-07  4:57       ` Junio C Hamano
2019-05-07 10:36       ` Duy Nguyen
2019-05-07 18:31         ` Emily Shaffer
2019-05-08 10:20           ` Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190425094600.15673-1-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.com \
    --cc=newren@gmail.com \
    --cc=rybak.a.v@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).