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

Re: [PATCH 1/2] Documentation/git-checkout.txt: clarify usage

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 18, 2012, 16:43 UTC
Message-ID
<7vvcbzgvk5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAEUsAPa1XMeymEXbLu=iy8VTdLO=iPUeVN3QPH+FbQecL8XnsA@mail.gmail.com>
Chris Rorvick <chris@rorvick.com> writes:
> I like Johannes' suggestion of using "<branch>" in the --detach case
> instead of "<commit>" as I think it makes the reason for the
> separation more obvious at a glance.

Sounds sensible; even though the option does not require its argument to be a branch name, the user does not have a reason to use the option if it is not giving a branch name, either, so it all balances out ;-).

Show 25 quoted lines
>
> --->8---
> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
> index dcf1a32..4fdf41a 100644
> --- a/Documentation/git-checkout.txt
> +++ b/Documentation/git-checkout.txt
> @@ -61,8 +61,8 @@ $ git checkout <branch>
>  that is to say, the branch is not reset/created unless "git checkout" is
>  successful.
>
> -'git checkout' --detach [<commit>]::
>  'git checkout' <commit>::
> +'git checkout' --detach [<branch>]::
>
>         Prepare to work on top of <commit>, by detaching HEAD at it
>         (see "DETACHED HEAD" section), and updating the index and the
> @@ -71,7 +71,8 @@ successful.
>         tree will be the state recorded in the commit plus the local
>         modifications.
>  +
> -Passing `--detach` forces this behavior even if <commit> is a branch.
> +Passing `--detach` forces this behavior in the case of a <branch>, or
> +the current branch if one is not specified.
>
>  'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::
Previous: Chris RorvickNext: Philip Oakley
Message 18 of 23 in “Documentation: clarify usage of checkout”
  1. 0/2 Documentation: clarify usage of checkoutChris Rorvick, Dec 17, 2012
  2. 1/2 Documentation/git-checkout.txt: clarify usageChris Rorvick, Dec 17, 2012
  3. Junio C HamanoDec 17, 2012
  4. Johannes SixtDec 17, 2012
  5. Junio C HamanoDec 17, 2012
  6. Johannes SixtDec 17, 2012
  7. Junio C HamanoDec 17, 2012
  8. Andrew ArdillDec 17, 2012
  9. Chris RorvickDec 18, 2012
  10. Philip OakleyDec 17, 2012
  11. Junio C HamanoDec 17, 2012
  12. Andrew ArdillDec 17, 2012
  13. Junio C HamanoDec 17, 2012
  14. Andrew ArdillDec 18, 2012
  15. Junio C HamanoDec 18, 2012
  16. Andrew ArdillDec 18, 2012
  17. Chris RorvickDec 18, 2012
  18. Junio C HamanoDec 18, 2012
  19. Philip OakleyDec 17, 2012
  20. 2/2 Documentation/git-checkout.txt: document 70c9ac2 behaviorChris Rorvick, Dec 17, 2012
  21. Junio C HamanoDec 17, 2012
  22. Andrew ArdillDec 17, 2012
  23. Junio C HamanoDec 17, 2012

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.