git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Documentation: do not treat reset --keep as a special case

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2011, 20:35 UTC
Message-ID
<7v7hdyov0d.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110121183734.GB16325@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 10 quoted lines
> The current treatment of "git reset --keep" emphasizes how it
> differs from --hard (treatment of local changes) and how it breaks
> down into plumbing (git read-tree -m -u HEAD <commit> followed by git
> update-ref HEAD <commit>).  This can discourage people from using
> it, since it might seem to be a complex or niche option.
>
> Better to emphasize what the --keep flag is intended for --- moving
> the index and worktree from one commit to another, like "git checkout"
> would --- so the reader can make a more informed decision about the
> appropriate situations in which to use it.

The updated text makes quite a lot of sense ;-) while the old text doesn't. What were we smoking when we wrote it and passed it through the review?

Show 20 quoted lines
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
>  Documentation/git-reset.txt |    9 ++-------
>  1 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
> index fd72976..927ecee 100644
> --- a/Documentation/git-reset.txt
> +++ b/Documentation/git-reset.txt
> @@ -76,15 +76,10 @@ In other words, --merge does something like a 'git read-tree -u -m <commit>',
>  but carries forward unmerged index entries.
>  
>  --keep::
> -	Resets the index, updates files in the working tree that are
> -	different between <commit> and HEAD, but keeps those
> -	which are different between HEAD and the working tree (i.e.
> -	which have local changes).
> +	Resets index entries and updates files in the working tree that are
> +	different between <commit> and HEAD.
>  	If a file that is different between <commit> and HEAD has local changes,
>  	reset is aborted.

I saw "updates files" and one question immediately came to mind: update how? "... to match what is in HEAD"? "Resets index entries" is less of a problem as the word "reset" already strongly suggests that the current state does not matter as much as the target state, though.

Thanks.
Previous: Jonathan NiederNext: Jay Soffian
Message 35 of 38 in “Black smoke from git rebase -i exec”
  1. Ævar Arnfjörð BjarmasonAug 10, 2010
  2. Matthieu MoyAug 10, 2010
  3. Ævar Arnfjörð BjarmasonAug 10, 2010
  4. Johannes SixtAug 10, 2010
  5. Ævar Arnfjörð BjarmasonAug 10, 2010
  6. Matthieu MoyAug 10, 2010
  7. 1/2 rebase -i: add exec command to launch a shell commandMatthieu Moy, Aug 10, 2010
  8. Junio C HamanoAug 11, 2010
  9. Matthieu MoyAug 12, 2010
  10. 0/2 rebase -i: in-editor documentation nitsJonathan Nieder, Jan 16, 2011
  11. 1/2 rebase -i: reword in-editor documentation of "exec"Jonathan Nieder, Jan 16, 2011
  12. Matthieu MoyJan 16, 2011
  13. Junio C HamanoJan 18, 2011
  14. Jonathan NiederJan 20, 2011
  15. Junio C HamanoJan 20, 2011
  16. 1/2 rebase -i: clarify in-editor documentation of "exec"Jonathan Nieder, Jan 21, 2011
  17. Matthieu MoyJan 21, 2011
  18. Jonathan NiederJan 21, 2011
  19. Matthieu MoyJan 21, 2011
  20. 2/2 rebase -i: explain how to discard all commitsJonathan Nieder, Jan 16, 2011
  21. 2/2 Re: rebase -i: explain how to discard all commitsNicolas Sebrecht, Jan 20, 2011
  22. Jonathan NiederJan 20, 2011
  23. 2/2 Re: rebase -i: explain how to discard all commitsNicolas Sebrecht, Jan 20, 2011
  24. Thomas RastJan 20, 2011
  25. Junio C HamanoJan 20, 2011
  26. Johannes SchindelinJan 21, 2011
  27. Documentation: suggest "reset --keep" to undo a commitJonathan Nieder, Jan 21, 2011
  28. Junio C HamanoJan 21, 2011
  29. Jonathan NiederJan 21, 2011
  30. Junio C HamanoJan 21, 2011
  31. Junio C HamanoJan 21, 2011
  32. Matthieu MoyJan 21, 2011
  33. Joshua JensenJan 21, 2011
  34. Documentation: do not treat reset --keep as a special caseJonathan Nieder, Jan 21, 2011
  35. Junio C HamanoJan 21, 2011
  36. Jay SoffianJan 26, 2011
  37. Johannes SchindelinJan 23, 2011
  38. 2/2 test-lib: user-friendly alternatives to test [-d|-f|-e]Matthieu Moy, Aug 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.