Re: [RFD} Use regex's in :/ revision naming machinery

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

 




On Tue, 6 Apr 2010, Johannes Sixt wrote:
>
> Am 4/6/2010 1:00, schrieb Linus Torvalds:
> > I never use ':/', and part of it is that it's so horribly cumbersome. I'd 
> > _like_ to use it to do things like 
> > 
> > 	gitk :/slabh..
> 
> Rhethoric question: Do you mean history _starting_ at the commit that
> contains "slabh" or _ending_ at the commit that contains "slabh" followed
> by two arbitrary characters?

Ending in the commit that contains "slabh".

The last two dots are removed by the revision handling machinery, _before_ 
we even see the ':/' thing. See 'handle_revision_arg()', and notice how it 
searches for ".." and then does "*dotdot = 0".

So the regex is 'slabh'.

> If :/ is pattern-ized in some way, then IMO pattern matching syntax would
> be more use-friendly than (extended) regular expresssions, particluarly
> also because the single-character wildcard would be ? and avoid the
> otherwise overloaded dot.

I do agree that regex'es might contain the invalid sequence "..", but it's 
fairly unusual, and you can work around it, ie you can do

	gitk :/'slabh(.)(.)of'..

which now that I write it out admittedly looks like you are searching for 
titties, but hey, sex sells, so we can call it a _feature_.

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