Re: [PATCH 2/3] add new Git::Repo API
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jul 19, 2008, 00:03 UTC
- Message-ID
- <200807190203.35758.jnareb@gmail.com>
- In-Reply-To
- <20080718165407.GU10151@machine.or.cz>
Petr Baudis wrote:
> Jakub Narebski wrote:
Show 22 quoted lines
>> [...]
>> $r = Git::Repo->new(<git_dir>);
>> $r->output_pipe('ls_tree', 'HEAD');
>> [...]
>> $nb = Git::Repo::NonBare->new(<git_dir>[, <working_area>]);
>> $nb->output_pipe('ls-files');
>>
>>
>> How can it be done with minimal effort, unfortunately I don't know...
>
> Well, this interface is almost identical to what I delineated, except
> that I have the extra ->cmd-> step there. But maybe, we could go with
> your API and instead have Git::CommandFactory as a base of Git::Repo?
> The hierarchy would be
>
> Git::CommandFactory - provides the cmd_pipe toolkit
> |
> Git::Repo - provides repository model
> |
> Git::Repo::NonBare - additional working-copy-related methods
>
> I think I will post a sample implementation sometime over the weekend.What I would want from the solution is an easy way to set up path to git binary for _all_ git command calls, and for invoking command which does not need git repository to run (like git-ls-remote).
-- Jakub Narebski Poland