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

Re* [PATCH] man: git pull -r is a short for --rebase

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2012, 06:19 UTC
Message-ID
<7vfw7mvy40.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<B7310EA0CC00423EB5B26E3FAAB54541@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 23 quoted lines
> From: "Junio C Hamano" <gitster@pobox.com>
> Sent: Thursday, August 16, 2012 9:23 PM
>> "Philip Oakley" <philipoakley@iee.org> writes:
>>
>>> I wasn't aware of the  "abbreviated options" capability. Is meant to
>>> be in the man pages as I couldn't find it, or is it described
>>> differently?
>>
>> $ git help gitcli
>>
>> is the closest that comes to mind.
>>
>> If it is not reachable from "git help git", we may want to sprinkle
>> some more linkgit:gitfoo[$n] around the documentation sources.  I
>> didn't check.
>>
>
> I eventually found a reference in the parse-options API to the fact that
> 'Long options may be abbreviated, as long as the abbreviation is
> unambiguous.'
>
> It may be worth bringing some of those parse-options API basics bullets'
> forward into the gitcli page, if appropriate.
OK, how about doing this?  Sort of killing two birds with one stone.
-- >8 --
Subject: [PATCH] gitcli: describe abbreviation of long options
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/gitcli.txt | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
index ea17f7a..3e72a5d 100644
--- a/Documentation/gitcli.txt
+++ b/Documentation/gitcli.txt
@@ -62,6 +62,14 @@ scripting git:
    `git log -1 HEAD` but write `git log -1 HEAD --`; the former will not work
    if you happen to have a file called `HEAD` in the work tree.
 
+ * many commands allow a long option "--option" to be abbreviated
+   only to their unique prefix (e.g. if there is no other option
+   whose name begins with "opt", you may be able to spell "--opt" to
+   invoke the "--option" flag), but you should fully spell them out
+   when writing your scripts; later versions of Git may introduce a
+   new option whose name shares the same prefix, e.g. "--optimize",
+   to make a short prefix that used to be unique no longer unique.
+
 
 ENHANCED OPTION PARSER
 ----------------------
-- 
1.7.12.rc3.2.gbd120e3
Previous: Philip OakleyNext: Philip Oakley
Message 9 of 19 in “man: git pull -r is a short for --rebase”
  1. man: git pull -r is a short for --rebaseMiklos Vajna, Aug 16, 2012
  2. Junio C HamanoAug 16, 2012
  3. Miklos VajnaAug 16, 2012
  4. Junio C HamanoAug 16, 2012
  5. Junio C HamanoAug 16, 2012
  6. Philip OakleyAug 16, 2012
  7. Junio C HamanoAug 16, 2012
  8. Philip OakleyAug 16, 2012
  9. Re* [PATCH] man: git pull -r is a short for --rebaseJunio C Hamano, Aug 17, 2012
  10. Philip OakleyAug 17, 2012
  11. Junio C HamanoAug 17, 2012
  12. Philip OakleyAug 17, 2012
  13. Johannes SixtAug 16, 2012
  14. Junio C HamanoAug 16, 2012
  15. Junio C HamanoAug 16, 2012
  16. Miklos VajnaAug 17, 2012
  17. Junio C HamanoAug 17, 2012
  18. Miklos VajnaAug 17, 2012
  19. Junio C HamanoAug 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.