# gitweb: how to name main "action" subroutines?

6 messages from 2006-07-31 to 2006-07-31. Participants: Jakub Narebski, Luben Tuikov, Josef Weidendorfer.
Thread: https://gitlist.dev/t/5058

## Jakub Narebski, 2006-07-31 14:03

Subject: gitweb: how to name main "action" subroutines?
Message-ID: <eal2ic$14o$1@sea.gmane.org>
URL: https://gitlist.dev/e/eal2ic%2414o%241%40sea.gmane.org

```
I'm going to rename some gitweb subroutines to better correspond to what
given subroutine does. I have problem: how to name main "action"
subroutines? Currently they use git_ prefix, e.g. git_logo.
git_project_list, git_rss, git_summary, git_heads,...

I have thought about do_logo, or gitweb_logo, or out_logo etc., but somehow
none is best.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Luben Tuikov, 2006-07-31 17:26

Subject: Re: gitweb: how to name main "action" subroutines?
Message-ID: <20060731172625.48437.qmail@web31811.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20060731172625.48437.qmail%40web31811.mail.mud.yahoo.com
In-Reply-To: <eal2ic$14o$1@sea.gmane.org>

```
--- Jakub Narebski <jnareb@gmail.com> wrote:
> I'm going to rename some gitweb subroutines to better correspond to what
> given subroutine does. I have problem: how to name main "action"
> subroutines? Currently they use git_ prefix, e.g. git_logo.
> git_project_list, git_rss, git_summary, git_heads,...
> 
> I have thought about do_logo, or gitweb_logo, or out_logo etc., but somehow
> none is best.

"git_<noun>_<verb>" ?  So then you'd have, for example "git_logo_show".

   Luben

```

## Jakub Narebski, 2006-07-31 17:50

Subject: Re: gitweb: how to name main "action" subroutines?
Message-ID: <ealfsa$hho$1@sea.gmane.org>
URL: https://gitlist.dev/e/ealfsa%24hho%241%40sea.gmane.org
In-Reply-To: <20060731172625.48437.qmail@web31811.mail.mud.yahoo.com>

```
<opublikowany i wysłany>

Luben Tuikov wrote:

> --- Jakub Narebski <jnareb@gmail.com> wrote:
>> I'm going to rename some gitweb subroutines to better correspond to what
>> given subroutine does. I have problem: how to name main "action"
>> subroutines? Currently they use git_ prefix, e.g. git_logo.
>> git_project_list, git_rss, git_summary, git_heads,...
>> 
>> I have thought about do_logo, or gitweb_logo, or out_logo etc., but somehow
>> none is best.
> 
> "git_<noun>_<verb>" ?  So then you'd have, for example "git_logo_show".

I'd rather reserve git_ prefix for subroutines which deal with git repository, 
either by calling git commands (e.g. git_get_type), or accessing git repository
directly (e.g. git_read_hash, git_read_description).

I'm partial to either out_foo or gitweb_foo...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Josef Weidendorfer, 2006-07-31 18:38

Subject: Re: gitweb: how to name main "action" subroutines?
Message-ID: <200607312038.44337.Josef.Weidendorfer@gmx.de>
URL: https://gitlist.dev/e/200607312038.44337.Josef.Weidendorfer%40gmx.de
In-Reply-To: <eal2ic$14o$1@sea.gmane.org>

```
On Monday 31 July 2006 16:03, you wrote:
> I'm going to rename some gitweb subroutines to better correspond to what
> given subroutine does. I have problem: how to name main "action"
> subroutines? Currently they use git_ prefix, e.g. git_logo.
> git_project_list, git_rss, git_summary, git_heads,...

print_* or write_* ?
At least, the functions print/write the HTML code to stdout of the script.

Josef

> 
> I have thought about do_logo, or gitweb_logo, or out_logo etc., but somehow
> none is best.

```

## Jakub Narebski, 2006-07-31 18:45

Subject: Re: gitweb: how to name main "action" subroutines?
Message-ID: <ealj3h$to2$1@sea.gmane.org>
URL: https://gitlist.dev/e/ealj3h%24to2%241%40sea.gmane.org
In-Reply-To: <200607312038.44337.Josef.Weidendorfer@gmx.de>

```
Josef Weidendorfer wrote:

> On Monday 31 July 2006 16:03, you wrote:
>> I'm going to rename some gitweb subroutines to better correspond to what
>> given subroutine does. I have problem: how to name main "action"
>> subroutines? Currently they use git_ prefix, e.g. git_logo.
>> git_project_list, git_rss, git_summary, git_heads,...
> 
> print_* or write_* ?
> At least, the functions print/write the HTML code to stdout of the script.

The problem is that there are subroutines which print _fragments_ of HTML
code (like git_header_html or git_print_page_path) which would use probably
print_ prefix. Action subroutines output always whole page.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Josef Weidendorfer, 2006-07-31 20:41

Subject: Re: gitweb: how to name main "action" subroutines?
Message-ID: <200607312241.02711.Josef.Weidendorfer@gmx.de>
URL: https://gitlist.dev/e/200607312241.02711.Josef.Weidendorfer%40gmx.de
In-Reply-To: <ealj3h$to2$1@sea.gmane.org>

```
On Monday 31 July 2006 20:45, Jakub Narebski wrote:
> Josef Weidendorfer wrote:
> 
> > On Monday 31 July 2006 16:03, you wrote:
> >> I'm going to rename some gitweb subroutines to better correspond to what
> >> given subroutine does. I have problem: how to name main "action"
> >> subroutines? Currently they use git_ prefix, e.g. git_logo.
> >> git_project_list, git_rss, git_summary, git_heads,...
> > 
> > print_* or write_* ?
> > At least, the functions print/write the HTML code to stdout of the script.
> 
> The problem is that there are subroutines which print _fragments_ of HTML
> code (like git_header_html or git_print_page_path) which would use probably
> print_ prefix. Action subroutines output always whole page.

Why not "print_*_page", if they print out a whole page?
I would "git_header_html" rename to "print_header"; it's clear that
it prints out HTML ;-)
And "git_print_page_path" only needs stripping of "git_" prefix.

Josef

```
