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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> ========================================================================
> 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux