Re: [PATCH 5/9] gitweb: add a get function to compliment print_local_time
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jan 23, 2010, 11:13 UTC
- Message-ID
- <m3r5phaxd1.fsf@localhost.localdomain>
- In-Reply-To
- <1263432185-21334-6-git-send-email-warthog9@eaglescrag.net>
"John 'Warthog9' Hawley" <warthog9@eaglescrag.net> writes:
Should authorship be associated with eaglescrag.net or kernel.org?
> This adds a get function for print_local_time so that the basic > function can be used outside of their straight printing operation.
Signoff?
Show 16 quoted lines
> ---
> gitweb/gitweb.perl | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index b41bc33..d38aad6 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3537,14 +3537,21 @@ sub git_print_header_div {
> }
>
> sub print_local_time {
> + print get_local_time(@_);
> +}
> +
> +sub get_local_time {This new function should be rather named 'format_local_time', to follow gitweb convention of naming subroutines. (And of course commit message needs to be changed accordingly.)
This comment applies also to the following patch.
Show 13 quoted lines
> + my $localtime = "";
> my %date = @_;
> if ($date{'hour_local'} < 6) {
> - printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
> + $localtime .= sprintf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
> $date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
> } else {
> - printf(" (%02d:%02d %s)",
> + $localtime .= sprintf(" (%02d:%02d %s)",
> $date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
> }
> +
> + return $localtimeStyle (terminate statement with ';'):
+ return $localtime;
Show 6 quoted lines
> } > > # Outputs the author name and date in long form > -- > 1.6.5.2 >
-- Jakub Narebski Poland ShadeHawk on #git