Re: [PATCH] object name: introduce ':::<oneline prefix>' notation
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 24, 2007, 01:18 UTC
- Message-ID
- <7vzm741hfx.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.63.0702232347310.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
> On Fri, 23 Feb 2007, Johannes Schindelin wrote:
>
>> To name a commit, you can now say
>>
>> git rev-parse ':::Initial revision of "git"'
>
> Alex Riesen and Shawn Pearce suggested ":/" instead of ":::", to reflect
> the searching nature ("/" is the key to search in "less" output).
>
> Comments?Sounds good. "git show :/path" does not currently mean "find /path in the index", so I do not see offhand it would interfere with anything.
However, it would be worthwhile to plant an escape hatch for future extension. Using short-and-sweet ":/" for the most common case such as exact prefix match would be fine, but we might want to say:
':/!' syntax is reserved for future extension and does not look for a string that begins with "!". one extension "do not do anything special" is defined and is spelled as "!!" - so if you want to look for a commit that begins with "!something", please spell it as ':/!!something'
or something like that.
Obvious extension possibilities include:
":/!(r=regexp)"
":/!(a=author)"
":/!(d=2001-09-17)"
":/!(p=Documentation/)"or various combination of them e.g.
":!(p=Documentation/)!(a=Johannes)Update command list"
to look for a commit by Johannes that touches Documentation/ area and oneline begins with "Update command list".
By the way, where do you start digging from? From all refs?