git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH/RFC] gitweb: Great subroutines renaming
Date: Wed, 09 Aug 2006 00:33:40 +0200	[thread overview]
Message-ID: <ebb3fm$2md$1@sea.gmane.org> (raw)
In-Reply-To: 7vu04mucaq.fsf@assigned-by-dhcp.cox.net

Junio C Hamano wrote:

> Jakub Narebski <jnareb@gmail.com> writes:

>>  - git_blob_plain_mimetype => blob_plain_mimetype
> 
> Does it matter that the function is used in blob-plain?  In
> other words, how would this function, blob-plain-mimetype, be
> different if we were to have another function called blob-mimetype?
> 
> How about calling it "guess-mimetype"?

There are two functions, mimetype_guess_file and mimetype_guess, of which
first one gets mimetype of file based on specified mime.types like file,
second tries $mimetypes_file then '/etc/mime.types', while currently named
git_blob_plain_mimetype subroutine first tries mimetype_guess, then checks
if the file is text file (-T $fd) and if not uses some built in mime.types
rules. Perhaps current mimetype_guess could be embedded into current
git_blob_plain_mimetype.

All those subroutines need better names I think.
 
>>  - git_page_nav => git_print_page_nav
>>  - git_header_div => git_print_header_div
> 
> Both sounds sane (I would have said "git-show-blah" if I were
> doing this myself, though).

They are called among print statements. I'm not sure if some of them
wouldn't be better converted to format_* types subroutines.
 
>>  - read_info_ref => git_read_info_refs => git_get_references
>>  (this one depend too much on implementation, which might be changed to 
>>   parsing 'git ls-remotes .' output instead of relying on info/refs being
>>   up to date thanks to git-update-server-info in post-update hook, 
>>   and on its format).
> 
> I am not worried too much about the format (because clone/fetch
> over http depends on it), but reading from ls-remote self would
> make it unnecessary to run update-server-info if a repo is not
> served over http but is shown over gitweb.

Do the git_get_references for this subroutine, which returns hashref which
keys are ids, and values are refs pointing to the key id, sounds good?

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

  reply	other threads:[~2006-08-08 22:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 14:26 [PATCH/RFC] gitweb: Great subroutines renaming Jakub Narebski
2006-08-07 19:37 ` Junio C Hamano
2006-08-07 21:47   ` Jakub Narebski
2006-08-07 21:52     ` Jakub Narebski
2006-08-07 22:00     ` Junio C Hamano
2006-08-07 22:15       ` Jakub Narebski
2006-08-07 22:58         ` Jakub Narebski
2006-08-07 23:49         ` Junio C Hamano
2006-08-08  0:10           ` Jakub Narebski
2006-08-08  9:38           ` Jakub Narebski
2006-08-08 20:18             ` Junio C Hamano
2006-08-08 20:24               ` Jakub Narebski
2006-08-08  9:51           ` Jakub Narebski
2006-08-08 18:12           ` git-show-refs (was: [PATCH/RFC] gitweb: Great subroutines renaming) Jakub Narebski
2006-08-09 10:26           ` [PATCH/RFC] gitweb: Great subroutines renaming Jakub Narebski
2006-08-09 10:51             ` Junio C Hamano
2006-08-09 11:01               ` Jakub Narebski
2006-08-09 11:11                 ` Junio C Hamano
2006-08-08  9:48     ` Jakub Narebski
2006-08-08 21:13 ` Jakub Narebski
2006-08-08 21:50   ` Junio C Hamano
2006-08-08 22:33     ` Jakub Narebski [this message]
2006-08-09 20:54       ` Jakub Narebski
2006-08-09 21:11         ` Junio C Hamano
2006-08-10  7:57           ` Jakub Narebski
2006-08-12 23:09 ` Jakub Narebski
2006-08-13  2:21   ` Junio C Hamano
2006-08-13  2:27     ` Junio C Hamano
2006-08-13  9:29     ` Jakub Narebski
2006-08-14  0:11       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ebb3fm$2md$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).