Re: [PATCH v5 01/15] Add new git-related helper to contrib
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 19, 2013, 15:48 UTC
- Message-ID
- <CAMP44s34uDwZiFiy7cno_3M+_QB2zweGsuwvpYQ6p4O_Ct3CZA@mail.gmail.com>
- In-Reply-To
- <CAMP44s1xguzX=iavUJxYXBEPOpGvJtJ_7FDHNCWMrF6qxOsuOQ@mail.gmail.com>
On Sun, May 19, 2013 at 10:05 AM, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> On Sun, May 19, 2013 at 9:40 AM, Ramkumar Ramachandra > <artagnon@gmail.com> wrote:
Show 11 quoted lines
>>> + '-L', '%u,+%u' % [start, len],
>>> + '--since', $since, from + '^',
>>> + '--', source]) do |p|
>>> + p.each do |line|
>>> + if line =~ /^(\h{40})/
>>> + id = $1
>>
>> Use $0 and remove the parens: you're matching the whole line.
>
> No, I'm not matching the whole line, but you are right; there's no
> need for groups.Actually $&.
-- Felipe Contreras