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

Re: [PATCH] Documentation: explain "git branch --with"

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 9, 2010, 22:45 UTC
Message-ID
<7vhbhyleo6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100907055209.GT1182@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
> More precisely, it is advertised by "git branch --help-all" but not
> the manual or "git branch -h".

Sorry, but I don't understand what you are trying to say here. Isn't it the whole point of distinction between --help-all vs -h (aka PARSE_OPT_HIDDEN)?

Some interesting findings after a quick "grep" to see which ones are hidden (potential bugs below might be good for janitors).

* apply --allow-binary-replacement, --binary
  These are always on, and are no-op (even --no-binary is a no-op);
  documented.
* archive -[2-8]
  git-archive manual page mentions -0 thru -9 can be used as "zip backend
  option", while explicitly describing -0 and -9.  "git archive -h" gives
  special description for -1 as well.  Perhaps we should be consistent and
  document -1 in the manual page.
  
* checkout --[no-]guess
  Controls the "dwim 'git checkout x' to 'git checkout -b x remote/x' when
  'x' cannot possibly name anything other than a branch that we copied
  from a remote repository uniquely"; since the dwimming is on by default,
  the only use case is to say --no-guess; not documented.
* clone --naked
  An old name used during the development for the current --bare option;
  not documented.
* commit --allow-empty --allow-empty-message
  Documented; hidden primarily to discourage their uses and also to keep
  output from 'commit -h' short.
* fmt-merge-msg --summary
  An old name used during the development for the current --log option;
  documented.
* grep --help-all, show-ref --help-all
  I do not know why an entry for this needs to be in the struct option []
  for the command.  It is not (and should not be) documented in the manual
  page of the individual commands.
* show-ref -h
  "-h" was meant to be a historical synonym for "--head" (i.e. tells the
  command include HEAD in the output not just under refs/ hierarchy), but
  it seems that we broke it somewhere between v1.6.5 and v1.7.0; it now
  shows the help text.
* write-tree --ignore-cache-tree
  A debugging aid; not documented.

It seems that our use of OPT_HIDDEN or if a hidden option is documented are not entirely consistent. The "--with" under discussion is similar to "clone --naked" and "fmt-merge-msg --summary".

I am Ok with a policy to document historical synonyms that are hidden, but if we were to document them, I suspect that we would need to explicitly state they are synonyms. Otherwise, somebody who saw this...

>  --contains <commit>::
> +--with <commit>::
>  	Only list branches which contain the specified commit.

... for the first time is bound to ask what the differences are between the two.

Previous: Ævar Arnfjörð BjarmasonNext: Nguyen Thai Ngoc Duy
Message 11 of 13 in “Determining commit reachability”
  1. Artur SkawinaSep 5, 2010
  2. Jeff KingSep 6, 2010
  3. Artur SkawinaSep 6, 2010
  4. Junio C HamanoSep 6, 2010
  5. Sverre RabbelierSep 6, 2010
  6. Ævar Arnfjörð BjarmasonSep 6, 2010
  7. Sverre RabbelierSep 6, 2010
  8. Junio C HamanoSep 6, 2010
  9. Documentation: explain "git branch --with"Jonathan Nieder, Sep 7, 2010
  10. Ævar Arnfjörð BjarmasonSep 7, 2010
  11. Junio C HamanoSep 9, 2010
  12. Nguyen Thai Ngoc DuySep 7, 2010
  13. Nguyen Thai Ngoc DuySep 7, 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.