Re: [PATCH/RFC] gitweb: Create Gitweb::Git module
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jun 7, 2010, 15:25 UTC
- Message-ID
- <201006071725.51263.jnareb@gmail.com>
- In-Reply-To
- <20100607144852.GN20775@machine.or.cz>
On Mon, Jun 07, 2010, Petr Baudis wrote:
> On Mon, Jun 07, 2010 at 02:54:11AM +0530, Pavan Kumar Sunkara wrote:
Show 6 quoted lines
> > @@ -1548,21 +1536,6 @@ sub get_feed_info {
> > ## ----------------------------------------------------------------------
> > ## git utility subroutines, invoking git commands
>
> Is there any reason why didn't you move the rest of the commands from
> this section to Gitweb::Git as well?Probably because they are less clear about being about running (git) commands, I guess?
Let's examine those subroutines in more detail:
* git_cmd - requires $GIT and $git_dir, also $number_of_git_cmds
* quote_command - helper command, not exactly about running comands, but about shell escaping / shell quoting. Should it be in Gitweb::Git or in Gitweb::Escape?
* evaluate_git_version - requires $GIT, sets $number_of_git_cmds and $git_version. Does it belong to Gitweb::Git, or Gitweb::Config, or perhaps Gitweb::Request?
* git_get_hash (and wrappers: git_get_head_hash, git_get_full_hash, git_get_short_hash) - requires $projectroot, something which other commands do not require, and $git_dir. Uses git_cmd().
* git_get_type - uses git_cmd().
* git_get_hash_by_path - uses git_cmd() * git_get_path_by_hash - uses git_cmd()
Subroutines related to parsing per-repository configuration should be either in Gitweb::Config, or in a separate module, e.g. Gitweb::Git::Config (or something like that, like Gitweb::RepoConfig, etc.).
Next there are 'git utility functions, directly accessing git repository'
-- Jakub Narebski Poland