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

Re: [PATCH v2 3/5] doc: git-checkout: don't use "reset"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2025, 16:22 UTC
Message-ID
<xmqqh5xqnlmo.fsf@gitster.g>
In-Reply-To
<360051d2a656727ca42d489de81ffec9b23a6386.1756467934.git.gitgitgadget@gmail.com>
"Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Julia Evans <julia@jvns.ca>
>
> Many Git users don't know what the term "reset" means. Resolve this by:

Even though it is the name of one of the most often used commands? And yet a separate step in this series made the claim that everybody knows what "switch" means because it is the name of another command?

I think the source of the problem is not that they "don't know what the term means" at all. Isn't the real problem that the use of the verb in the original sentence you are correcting in this patch is vague and does not say what the branch is reset *to*?

> - Expanding it into its definition, in one case
    The description says "-B <branch>" resets the branch if it
    exists, but does not say what it resets to.  Rephrase to clarify
    that it is made to point at the specified commit.
or something?
> - Giving a simpler but still accurate explanation ("the branch will not
>   be created or modified"), in the other case

By the way this kind of use of bulleted list in a proposed log message I do not mind all that much. What I reacted to was a list without the introducing text (in the case of this patch, "resolve this by doing these things:").

Show 18 quoted lines
>
> Signed-off-by: Julia Evans <julia@jvns.ca>
> ---
>  Documentation/git-checkout.adoc | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc
> index 4de3ac6680..e4614674f0 100644
> --- a/Documentation/git-checkout.adoc
> +++ b/Documentation/git-checkout.adoc
> @@ -54,18 +54,17 @@ to print out the tracking information for the current branch.
>  	`--track` without `-b` implies branch creation; see the
>  	description of `--track` below.
>  +
> -If `-B` is given, _<new-branch>_ is created if it doesn't exist; otherwise, it
> -is reset. This is the transactional equivalent of
> +If `-B` is given, _<new-branch>_ is created if it doesn't exist;
> +otherwise `<new-branch>` is forced to point at the commit. ...
Good.
Show 17 quoted lines
> ... This is the
> +transactional equivalent of
>  +
>  ------------
>  $ git branch -f <branch> [<start-point>]
>  $ git checkout <branch>
>  ------------
>  +
> -that is to say, the branch is not reset/created unless "git checkout" is
> -successful (e.g., when the branch is in use in another worktree, not
> -just the current branch stays the same, but the branch is not reset to
> -the start-point, either).
> +that is, the branch will not be created or modified unless
> +`git checkout` is successful.
>  
>  `git checkout --detach [<branch>]`::
>  `git checkout [--detach] <commit>`::

This is in response to "transactional equivalent". I've always felt that there is no need to say "transactional" in this at all. IOW, I wouldn't have minded if we rewrote this more heavily.

When you have to clarify with things like "that is", "what this means is", etc., after some text, I've often found that the result becomes crispier and more clear if we removed fuzzy text that needed such clarification and rewrite the sentence using elements form only the clarifying text.

    If `-B` is given, _<new-branch>_ is created if it doesn't exist,
    otherwise, it is made to point at the given commit.  And the
    branch is made the current branch.
    +
    Creation of the new branch or reseting of the existing branch to
    point at the commit happens only if the resulting branch can be
    successfully checked out.  Oterwise branch creation is not done
    and the exiting branch is left as-is.
or something?  I dunno.
Previous: Julia Evans via GitGitGadgetNext: Julia Evans
Message 34 of 68 in “doc: git-checkout: clarify DESCRIPTION section”
  1. 0/5 doc: git-checkout: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 25, 2025
  2. 1/5 doc: git-checkout: clarify introJulia Evans via GitGitGadget, Aug 25, 2025
  3. Junio C HamanoAug 26, 2025
  4. Junio C HamanoAug 26, 2025
  5. Julia EvansAug 26, 2025
  6. D. Ben KnobleAug 28, 2025
  7. Julia EvansAug 28, 2025
  8. Junio C HamanoAug 28, 2025
  9. D. Ben KnobleAug 29, 2025
  10. Junio C HamanoAug 29, 2025
  11. D. Ben KnobleSep 3, 2025
  12. 2/5 doc: git-checkout: clarify `git checkout <branch>`Julia Evans via GitGitGadget, Aug 25, 2025
  13. Junio C HamanoAug 26, 2025
  14. Julia EvansAug 28, 2025
  15. Junio C HamanoAug 28, 2025
  16. Julia EvansAug 28, 2025
  17. 3/5 doc: git-checkout: don't use "reset"Julia Evans via GitGitGadget, Aug 25, 2025
  18. 4/5 doc: git-checkout: deduplicate --detach explanationJulia Evans via GitGitGadget, Aug 25, 2025
  19. 5/5 doc: git-checkout: clarify restoring files sectionJulia Evans via GitGitGadget, Aug 25, 2025
  20. Junio C HamanoAug 26, 2025
  21. Julia EvansAug 28, 2025
  22. D. Ben KnobleAug 28, 2025
  23. Julia EvansAug 28, 2025
  24. Junio C HamanoAug 28, 2025
  25. D. Ben KnobleAug 29, 2025
  26. 0/5 doc: git-checkout: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 29, 2025
  27. 1/5 doc: git-checkout: clarify introJulia Evans via GitGitGadget, Aug 29, 2025
  28. Junio C HamanoAug 29, 2025
  29. Julia EvansSep 2, 2025
  30. 2/5 doc: git-checkout: clarify `git checkout <branch>`Julia Evans via GitGitGadget, Aug 29, 2025
  31. Junio C HamanoAug 29, 2025
  32. Julia EvansSep 2, 2025
  33. 3/5 doc: git-checkout: don't use "reset"Julia Evans via GitGitGadget, Aug 29, 2025
  34. Junio C HamanoAug 29, 2025
  35. Julia EvansSep 1, 2025
  36. Junio C HamanoSep 2, 2025
  37. 4/5 doc: git-checkout: deduplicate --detach explanationJulia Evans via GitGitGadget, Aug 29, 2025
  38. 5/5 doc: git-checkout: clarify restoring files sectionJulia Evans via GitGitGadget, Aug 29, 2025
  39. 0/6 doc: git-checkout: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Sep 3, 2025
  40. 1/6 doc: git-checkout: clarify introJulia Evans via GitGitGadget, Sep 3, 2025
  41. 2/6 doc: git-checkout: clarify `git checkout <branch>`Julia Evans via GitGitGadget, Sep 3, 2025
  42. 3/6 doc: git-checkout: clarify `-b` and `-B`Julia Evans via GitGitGadget, Sep 3, 2025
  43. 4/6 doc: git-checkout: deduplicate --detach explanationJulia Evans via GitGitGadget, Sep 3, 2025
  44. 5/6 doc: git-checkout: split up restoring files sectionJulia Evans via GitGitGadget, Sep 3, 2025
  45. 6/6 doc: git-checkout: clarify restoring files sectionJulia Evans via GitGitGadget, Sep 3, 2025
  46. Junio C HamanoSep 3, 2025
  47. Junio C HamanoSep 3, 2025
  48. Julia EvansSep 3, 2025
  49. 0/7 doc: git-checkout: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Sep 10, 2025
  50. 1/7 doc: git-checkout: clarify intro sentenceJulia Evans via GitGitGadget, Sep 10, 2025
  51. 2/7 doc: git-checkout: clarify ARGUMENT DISAMBIGUATIONJulia Evans via GitGitGadget, Sep 10, 2025
  52. 3/7 doc: git-checkout: clarify `git checkout <branch>`Julia Evans via GitGitGadget, Sep 10, 2025
  53. 4/7 doc: git-checkout: clarify `-b` and `-B`Julia Evans via GitGitGadget, Sep 10, 2025
  54. Kristoffer HaugsbakkSep 29, 2025
  55. doc: git-checkout: fix placeholder markupkristofferhaugsbakk@fastmail.com, Oct 2, 2025
  56. doc: git-checkout: fix placeholder markupkristofferhaugsbakk@fastmail.com, Oct 16, 2025
  57. Julia EvansOct 17, 2025
  58. doc: git-checkout: fix placeholder markupkristofferhaugsbakk@fastmail.com, Oct 17, 2025
  59. 5/7 doc: git-checkout: deduplicate --detach explanationJulia Evans via GitGitGadget, Sep 10, 2025
  60. 6/7 doc: git-checkout: split up restoring files sectionJulia Evans via GitGitGadget, Sep 10, 2025
  61. 7/7 doc: git-checkout: clarify restoring files sectionJulia Evans via GitGitGadget, Sep 10, 2025
  62. Ben KnobleSep 11, 2025
  63. Julia EvansSep 12, 2025
  64. Kristoffer HaugsbakkSep 12, 2025
  65. Junio C HamanoSep 15, 2025
  66. Kristoffer HaugsbakkSep 16, 2025
  67. Junio C HamanoSep 12, 2025
  68. Junio C HamanoSep 17, 2025

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.