Re: [PATCH 4/4] gitweb: show notes in commit(diff) view

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

 



On Sat, 6 Feb 2010, Giuseppe Bilotta wrote:
> On Sat, Feb 6, 2010 at 3:34 PM, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
>> Giuseppe Bilotta wrote:
>>> 2010/2/6 Jakub Narebski <jnareb@xxxxxxxxx>:
>>>> On Thu, 4 Jan 2010, Giuseppe Bilotta wrote:
>>
>> [...]
>>>>>  # return all refs matching refs/notes/<globspecs> where the globspecs
>>>>>  # are taken from the notes feature content.
>>>>>  sub get_note_refs {
>>>>> +     local $/ = "";
>>>>> +
>>>>
>>>> Why it is needed here?  Why you want to use empty lines as terminator
>>>> (which means reading whole paragraphs), while treating two or more
>>>> consecutive empty lines as a single empty line (according to
>>>> perlvar(1))?
>>>>
>>>> If you want to slurp whole file, this should be
>>>>
>>>>        local $/;
>>>>
>>>> or more explicit
>>>>
>>>>        local $/ = undef;
>>>
>>> Ah, sorry, for some reason I thought "" was the default.
>>
>> If you wanted to use default value, why set it at all?
> 
> Ach, sorry, forgot to reply to the first part of the question. It's
> used in a context where $/ is locally set to \0, so it needs to be
> reset.

Oh, so it should be something like the following, then?

   sub get_note_refs {
  +	# reset to default value (can be called with $/ set to "\0")
  +	local $/ = "\n"; # line by line

> 
> -- 
> Giuseppe "Oblomov" Bilotta
> 

-- 
Jakub Narebski
Poland
--
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]