Web lists-archives.com

Re: [PATCH v1 11/11] doc: promote "git restore"




On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
>
> The new command "git restore" (together with "git switch") are added
> to avoid the confusion of one-command-do-all "git checkout" for new
> users. They are also helpful to avoid ambiguation context.

s/ambiguation/ambiguous/ or s/ambiguation context/ambiguity/?

> For these reasons, promote it everywhere possible. This includes
> documentation, suggestions/advice from other commands.
>
> One nice thing about git-restore is the ability to restore
> "everything", so it can be used in "git status" advice instead of both
> "git checkout" and "git reset".  The three commands suggested by "git
> status" are add, rm and restore.
>
> "git checkout" is also removed from "git help" (i.e. it's no longer
> considered a commonly used command)
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---

> @@ -56,7 +56,7 @@ summary of what is included by any of the above for the next
>  commit by giving the same set of parameters (options and paths).
>
>  If you make a commit and then find a mistake immediately after
> -that, you can recover from it with 'git reset'.
> +that, you can recover from it with 'git restore' or 'git reset'.

Does 'git revert' also belong in this set?  And do we need to extend
our blurb differentiating reset and restore to also include revert?

> @@ -26,8 +26,8 @@ effect of some earlier commits (often only a faulty one).  If you want to
>  throw away all uncommitted changes in your working directory, you
>  should see linkgit:git-reset[1], particularly the `--hard` option.  If
>  you want to extract specific files as they were in another commit, you
> -should see linkgit:git-checkout[1], specifically the `git checkout
> -<commit> -- <filename>` syntax.  Take care with these alternatives as
> +should see linkgit:git-restore[1], specifically the `--source`
> +option  Take care with these alternatives as
>  both will discard uncommitted changes in your working directory.

Missing period after "option".

>  -------------------------------------------------
> -$ git reset --hard HEAD
> +$ git merge --abort

Nice additional cleanup, but should it be in a separate patch since it
isn't about the restore command?


Elijah