git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Petr Baudis
Message 5 of 5 in “gitweb: Create Gitweb::Git module”
  1. gitweb: Create Gitweb::Git modulePavan Kumar Sunkara, Jun 6, 2010
  2. Jakub NarebskiJun 7, 2010
  3. Pavan Kumar SunkaraJun 7, 2010
  4. Petr BaudisJun 7, 2010
  5. Jakub NarebskiJun 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.