All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	git@vger.kernel.org, Kevin Ballard <kevin@sb.org>,
	Yann Dirson <dirson@bertin.fr>, Jeff King <peff@peff.net>
Subject: Re: [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators
Date: Thu, 9 Dec 2010 12:38:14 +0100	[thread overview]
Message-ID: <201012091238.15685.jnareb@gmail.com> (raw)
In-Reply-To: <7vsjy7h3db.fsf@alter.siamese.dyndns.org>

On Thu, 9 Dec 2010, Junio C Hamano wrote:
> 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?

The idea is to follow Perl 6 rule of combining modifiers "Every modifier
must start with its own colon."
  http://perlcabal.org/syn/S05.html#Modifiers

This allow for easy combining modifiers without introducing special rules,
for example ^{:g:i/foo} would return all matches (:g == :global) instead
of only the first, ignoring case (:i == :ignorecase).
 
> 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.

Hmmm... I haven't thought about it.  I guess that ^{:nth(N)/foo} should
return Nth element in the list that ^{:g/foo} / --grep=foo would return.

This way one could use

  $ git log pu@{1}..pu --merges --grep="Merge branch 'nd/"

to find all new Nguyen contributions in 'pu', and

  $ git log pu..pu^{:2nd/Merge branch 'nd/}^2

to view 2nd (2nd == nth(2)) such branch on the list.

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

I'd like to deprecate ":/foo" in favor of "--all ^{/foo}", or even special
case it to "^{/foo}" (if not attached to ref, ^{(:<modifier>)*/<regexp>}
acts on positive revs replacing them).

But ^{/foo} might be overengineered...
-- 
Jakub Narebski
Poland

  reply	other threads:[~2010-12-09 11:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 14:58 [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators Nguyễn Thái Ngọc Duy
2010-12-08 14:58 ` [PATCH 1/2] get_sha1_oneline: allow to input commit_list Nguyễn Thái Ngọc Duy
2010-12-08 15:11   ` Thiago Farina
2010-12-08 14:58 ` [PATCH 2/2] get_sha1: support ref^{/regex} syntax Nguyễn Thái Ngọc Duy
2010-12-08 22:50   ` Junio C Hamano
2010-12-08 18:06 ` [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators Jonathan Nieder
2010-12-08 19:51   ` Jakub Narebski
2010-12-09  1:28     ` Nguyen Thai Ngoc Duy
2010-12-09  1:54       ` Jakub Narebski
2010-12-09  1:59         ` Jonathan Nieder
2010-12-09  2:02           ` Kevin Ballard
2010-12-09  2:06             ` Nguyen Thai Ngoc Duy
2010-12-09  2:11               ` Jonathan Nieder
2010-12-09  6:22           ` Junio C Hamano
2010-12-09 11:38             ` Jakub Narebski [this message]
2010-12-10 13:25             ` Nguyen Thai Ngoc Duy
2010-12-10 19:03               ` Jonathan Nieder
2010-12-10 19:26                 ` Jakub Narebski
2010-12-10 21:21                 ` Kevin Ballard
2010-12-10 21:30                   ` Jeff King
2010-12-10 23:08                   ` Junio C Hamano
2010-12-10 23:11                     ` Kevin Ballard
2010-12-10 23:36                       ` Junio C Hamano
2010-12-09  5:15     ` Junio C Hamano
2010-12-08 19:47 ` Jakub Narebski
2010-12-08 20:40   ` Jonathan Nieder
2010-12-09  0:30   ` Nguyen Thai Ngoc Duy
2010-12-09  0:44     ` Jakub Narebski
2010-12-09  1:42       ` Nguyen Thai Ngoc Duy
2010-12-09  1:46         ` Kevin Ballard
2010-12-09 11:43         ` Jakub Narebski
2010-12-09 11:53           ` Nguyen Thai Ngoc Duy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201012091238.15685.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=dirson@bertin.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=kevin@sb.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.