git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Gummerer <t.gummerer@gmail.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Git Mailing list <git@vger.kernel.org>
Subject: Re: "man git-stash" explanation of "--include-untracked" and "--all" seems ambiguous
Date: Sun, 1 Oct 2017 21:16:04 +0100	[thread overview]
Message-ID: <20171001201604.GA30301@hank> (raw)
In-Reply-To: <alpine.LFD.2.21.1709290650530.1446@localhost.localdomain>

On 09/29, Robert P. J. Day wrote:
> 
>   from the man page:
> 
> "If the --include-untracked option is used, all untracked files are
> also stashed and then cleaned up with git clean, leaving the working
> directory in a very clean state. If the --all option is used instead
>                                                              ^^^^^^^
> then the ignored files are stashed and cleaned in addition to the
> untracked files."
> 
>   the use of the word "instead" suggests you can use one of those
> options, or the other, but not both at the same time. but it seems you
> can combine them, so that paragraph seems a bit misleading, no?

Looking at the code, really only one (the last one that's specified on
the command line) is respected, so I think the man page is correct.
This happens silently, where I guess your impression that it's
possible to combine them comes from.

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.  Do you have any inserest in submitting a patch that fixes
this? :)

> rday
> 
> -- 
> 
> ========================================================================
> Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                         http://crashcourse.ca
> 
> Twitter:                                       http://twitter.com/rpjday
> LinkedIn:                               http://ca.linkedin.com/in/rpjday
> ========================================================================
> 

  reply	other threads:[~2017-10-01 20:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 16:26 "man git-stash" explanation of "--include-untracked" and "--all" seems ambiguous Robert P. J. Day
2017-10-01 20:16 ` Thomas Gummerer [this message]
2017-10-01 20:44   ` Robert P. J. Day
2017-10-01 23:29   ` Junio C Hamano
2017-10-04 17:05     ` Robert P. J. Day
2017-10-05  5:16       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171001201604.GA30301@hank \
    --to=t.gummerer@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).