Re: [PATCH] git-stash: fix flag parsing

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

 



Brian Gernhardt <brian@xxxxxxxxxxxxxxxxxxxxx> writes:

> Currently git-stash uses `git rev-parse --no-revs -- "$@"` to set its
> FLAGS variable.  This is the same as `FLAGS="-- $@"`.  It should use
> `git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or
> "--quiet" argument.  So move the check for quiet before rev-parse.
>
> Signed-off-by: Brian Gernhardt <brian@xxxxxxxxxxxxxxxxxxxxx>
> ---
>
>  Not the most elegant solution, but it works.

Thanks.

rev-parse as a flag parser was useful hack when most of the log family was
"rev-list | diff-tree" with various options, but the recent push to make
flags consistent across commands inevitably has made it fundamentally
impossible for the function to function sensibly in all cases, as it
itself has to share some options, like "-q", with others.

After the push of rewriting everything as C builtin, combined with the
improvement of parse-options, I have to say that rev-parse flag parser
hack has outlived its usefulness.  The former means there is less reason
to script end-user commands as a "rev-list | diff-tree" pipeline (I am not
talking about special purpose statistics commands that use rev-list here),
and the latter means that it has become easier for a Porcelain script to
parse _its_ command line options and come up with a set of sensible
options to underlying rev-list and the command at the downstream of the
pipe, without following the original hacky pattern of "we let random
options and args and without interpreting them we guess which ones to
throw at rev-list and which ones to throw at diff-tree".

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]