Re: [PATCH 3/3] gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jun 21, 2006, 13:42 UTC
- Message-ID
- <e7bibt$7m0$1@sea.gmane.org>
- In-Reply-To
- <20060621163302.47271f89.tihirvon@gmail.com>
Timo Hirvonen wrote:
Show 9 quoted lines
> Dennis Stosberg <dennis@stosberg.net> wrote:
>
>> - open my $fd, "-|", "$gitbin/git-cat-file -t $hash" or return;
>> + open my $fd, "-|", "$gitbin/git --git-dir=$git_dir cat-file -t $hash" or return;
>
> How about adding a function to simplify calling the git commands?
>
> Something like git("cat-file -t $hash") which would return
> "$gitbin/git --git-dir=$git_dir cat-file -t $hash" string.Or rather add a function(s) to call git commands, either returning git command output, or filehandle to read from, e.g.
my $fd = git_open("cat-file", "-t $hash") or return; i.e. each parameter separately, just in case.
-- Jakub Narebski Warsaw, Poland ShadeHawk on #git