Re: [PATCH 1/4] gitweb: notes feature
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Feb 4, 2010, 23:20 UTC
- Message-ID
- <201002050020.56643.jnareb@gmail.com>
- In-Reply-To
- <7vwrys7lrm.fsf@alter.siamese.dyndns.org>
Dnia czwartek 4. lutego 2010 22:07, Junio C Hamano napisał:
Show 18 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
>
>>> IOW, the code should be reading output from:
>>>
>>> GIT_NOTES_REF=$note_ref git show -s --format=%N $co{'id'}
>>>
>>> as the notes tree may not be storing notes in a flat one-level namespace
>>> like you are assuming.
>>
>> First, for some mechanism of deployment (IIRC Apache's mod_perl) changes
>> to environment variables from CGI script are not passed to invoked
>> commands (I guess for security reasons).
>
> I do not believe you are unable to spawn
>
> open $fd, '-|' 'sh', '-c', "GIT_NOTES_REF=$note_ref git show ..."
>
> and read from it ;-).You meant here
my $git_command = quote_command(git_cmd(), 'show', ...); open my $fd, '-|', 'sh', '-c', "GIT_NOTES_REF=$note_ref $git_command"
So you need to take care to quote parameters ($note_ref fortunately doesn't need to be quoted)... and you have one more process (shell) spawned.
Therefore I think it would be nice to have --notes-ref option to git wrapper,... especially that it should be easy to set it up in such way that it would be possible to pass --notes-ref multiple times, e.g.:
git --notes-ref=commits --notes-ref=git-svn show ...
-- Jakub Narebski Poland