Re: [RFC PATCH 1/1] for-each-ref: add '--no-symbolic' option

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Jeff King <peff@xxxxxxxx> writes:
>
>> So in my mind there's an endgame we'd like to eventually reach where
>> the option added by your patch isn't needed anymore. But we're a long
>> way from that. And it's not entirely clear where we'd draw the line
>> anyway.
>
> All true and very good "thinking out loud".
>
>> So in the meantime, this seems like a useful thing, and it
>> wouldn't be a burden to carry it even if we eventually added
>> "--omit=%(symref)" or something.

We can introduce two new options, e.g. --(include|exclude)=<format>
where

 * Without either, there is no filtering based on the placeholder
   expansion;

 * With only --include, only the refs for which <format> expands to
   non-empty are included.

 * With only --exclude, the refs for which <format> expands to
   non-empty are excluded (and everything else included).

 * With both --include and --exclude, only the refs for which the
   <format> for --include expands to non-empty are eligible to be
   included, but among them, the ones for which the <format> for
   --exclude expands to non-empty are discarded.

Then "--exclude=%(symref)" would be Eric's --no-symref,
"--include=%(symref)" would be the opposite (i.e. "show only
symbolic refs"), etc.

I guess with "%(if)...%(then)...%(else)...%(end)" you might be able
to do either one of --include/--exclude without supporting the
other, e.g. "--include='%(if)%(symref)%(then)%(else)not a
symref%(end)" would be usable as "I do not want to see symrefs" in a
system that supports only "--include" without "--exclude".




[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