Re: [PATCH v7 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Nov 15, 2016, 21:19 UTC
- Message-ID
- <FAA5CD51-8772-4AA9-A9BF-F32C9D0A47CA@gmail.com>
- In-Reply-To
- <xmqq4m38vdw4.fsf@gitster.mtv.corp.google.com>
On November 15, 2016 9:42:03 AM PST, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>I think you are going in the right direction. I had a similar >thought but built around a different axis. I.e. if strip=1 strips >one from the left, perhaps we want to have rstrip=1 that strips one >from the right, and also strip=-1 to mean strip everything except >one from the left and so on?. I think this and your keep (and >perhaps you'll have rkeep for completeness) have the same expressive >power. I do not offhand have a preference one over the other.
I prefer strip implemented with negative numbers. That is simple and expressive and if we need we can implement rstrip if necessary.
Show 8 quoted lines
> >Somehow it sounds a bit strange to me to treat 'remotes' as the same >class of token as 'heads' and 'tags' (I'd expect 'heads' and >'remotes/origin' would be at the same level in end-user's mind), but >that is probably an unrelated tangent. The reason this series wants >to introduce :base must be to emulate an existing feature, so that >existing feature is a concrete counter-example that argues against >my "it sounds a bit strange" reaction.
It may be a bit strange indeed. What is the requirement for this?
I think implementing a strip and rstrip ( if necessary ) with negative numbers would be most ideal.
Thanks Jake