Re: [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 10, 2010, 13:25 UTC
- Message-ID
- <AANLkTimg4Cy83gjzgC3fwg+t=B57b6gzOE98p-=2AR+K@mail.gmail.com>
- In-Reply-To
- <7vsjy7h3db.fsf@alter.siamese.dyndns.org>
On Thu, Dec 9, 2010 at 1:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>> Jakub Narebski wrote:
>>
>>> You would need HEAD{^{/foo}^@}x3, or use special rule that HEAD^{/foo}x2
>>> means really HEAD^{/foo}^@^{/foo}, with ^@ used to join them.
>>
>> That said, does ^2x500 really do something meaningful that a person
>> would ever need? I like the
>>
>> ^{:nth(3)/foo}
>>
>> syntax because perl6 supports m:nth(3)/foo/, suggesting a menu of
>> already-defined modifiers to implement when they prove useful,...
>
> Can you explain what the colon in "$commit^{:nth(3)/foo}" is doing?
>
> Are we declaring anything that begins with ':' is a magic inside ^{...}
> construct?
>
> I do not think nth($n) without specifying where to start (iow, what the
> current ":/foo" implementation does but with "three levels deep") makes
> any sense, but because the main point of your argument is that we can have
> modifies other than nth($n) that may make sense in such a context, I would
> want to make sure anything we come up with is extensible to that syntax.There's also another similar operation: note search. I don't think we need to invent another syntax for note search, a modifier for ^{/foo} may be a good choice.
> On the "starting from any ref" front, I think "!" (as in ":/!some magic")
> was the introducer we reserved for such a magic some time ago, so perhaps
> on the "starting from this commit" side, "^{!magic/foo}" may be more
> appropriate?Can we use ! modifier for other ^{} too? What I have in mind is how to say ^{commit} that has two parents. Or even better, "search from the given tip for a commit that has two parents and the commit message matches 'foo'". Hmm.. too complex. Perhaps "^{grep: <grep arguments>}" that pulls the whole git-grep functionality in.
-- Duy