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

Re: "man git-stash" explanation of "--include-untracked" and "--all" seems ambiguous

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Oct 4, 2017, 17:05 UTC
Message-ID
<alpine.LFD.2.21.1710041300350.9804@localhost.localdomain>
In-Reply-To
<xmqqtvzitpjv.fsf@gitster.mtv.corp.google.com>
On Mon, 2 Oct 2017, Junio C Hamano wrote:
Show 39 quoted lines
> Thomas Gummerer <t.gummerer@gmail.com> writes:
>
> > This is fine when --include-untracked is specified first, as --all
> > implies --include-untracked, but I guess the behaviour could be a
> > bit surprising if --all is specified first and --include-untracked
> > later on the command line.
> >
> > Changing this could possibly break someone that just adds
> > parameters to their 'git stash' invocation, but I'm tempted to say
> > allowing both at once is a bug, and change it to make git die when
> > both are specified.
>
> I am on the fence.
>
> If this were --include=untracked vs --include=all, then I'd say your
> suggestion will violate the usual expectation of "on the command
> line, last one wins", but "--include-untracked" and "--all" are
> spelled very differently, and may not look all that related to a
> casual reader, so the expectation for "the last one wins" might be
> weaker than usual.
>
> But once we start complaining to a command line that has both,
> saying they are mutually exclusive, people will realize that they
> are very much closely related options, even though spelled quite
> differently.  And at that point, they will find it very unreasonable
> that we do not follow the usual "the last one wins" rule but error
> out X-<.
>
> If I really cared deeply about these two options [*1*], I would
> think that the ideal longer term direction would be to introduce
> --include={untracked,all-crufts} to replace and deprecate the
> current two options.  And then we make sure --include=* forms follow
> the usual "last one wins" rule.
>
>
> [Footnote]
>
> *1* I personally don't, but that does not mean I will block efforts
>     by others who do to make this part of the system better.
  since i'm the one who tripped over this pedantic nitpickery, i'm
willing to take a shot at patching it, as long as there's consensus
from those *way* higher up the food chain as to what that patch should
look like.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “"man git-stash" explanation of "--include-untracked" and "--all" seems ambiguous”
  1. Robert P. J. DaySep 29, 2017
  2. Thomas GummererOct 1, 2017
  3. Robert P. J. DayOct 1, 2017
  4. Junio C HamanoOct 1, 2017
  5. Robert P. J. DayOct 4, 2017
  6. Junio C HamanoOct 5, 2017

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.