From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Thomas Gummerer <t.gummerer@gmail.com>
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 16:44:01 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.21.1710011643070.27165@localhost.localdomain> (raw)
In-Reply-To: <20171001201604.GA30301@hank>
On Sun, 1 Oct 2017, Thomas Gummerer wrote:
> 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? :)
sure, might as well jump in with both feet. is there another example
in the code of mutually exclusive options so i can just steal the
error code?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next prev parent reply other threads:[~2017-10-01 20:44 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
2017-10-01 20:44 ` Robert P. J. Day [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.21.1710011643070.27165@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=git@vger.kernel.org \
--cc=t.gummerer@gmail.com \
/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.
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 NNTP newsgroup(s).