Re: [RFC] Using gitrevisions :/search style with other operators

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

 



On Mon, Nov 08, 2010 at 02:11:54PM -0800, Kevin Ballard wrote:

> >    $ git log 'HEAD..:( :/Merge branch 'kb/blame-author-email' )^2'
> > 
> > I haven't visited the particular codepath for some time, so I don't know
> > offhand how involved the change would be, though.
> 
> Interesting idea. It certainly solves the problem of being able to embed it
> within other operations (though you do then have to worry about escaping any
> embedded close-parens in the search), though it does mean my suggestion for
> being able to select the 2nd (or nth) match won't work. When I have the time
> I'll start taking a look at the code.
> 
> Any comments on my suggestion to specify the ref to search from, e.g.
> origin/pu:/"Merge 'kb/blame-author-email'"? As I stated before, I believe

It seems to me the natural way to do that would be to use our existing
generic "start at this ref and follow some chain" syntax, which is
ref^{foo}. For example: origin/pu^{:Merge 'kb/blame-author-email'}.

We already use it for "follow tree link" and "peel tag objects", and it
is syntactically similar to the usual "follow the ancestry chain" syntax
("ref^"). And I believe it should be unambiguous, as nothing that could
go in ^{} could start with ":". And presumably one would have to
backslash-escape embedded closing curly braces.

We also have ref@{upstream}. The analogue here would be
origin/pu@{:Merge 'kb/blame-author-email'}.

I don't recall whether we put any conscious thought into ref@{upstream}
versus ref^{upstream}. Certainly the former implies to me finding a
particular starting point (as we do for reflogs), and the latter implies
walking object graph (either by parent ancestry links, or through
dereferencing tag and commit pointers). But I may just be rationalizing
after the fact. :)

Certainly this particular case seems to me to be more like "^" or "~";
you are walking the ancestry tree not a specific number of steps, but
until you see a particular subject.

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