# [PATCH] gitweb: Show project's README.html if available

3 messages from 2006-10-24 to 2006-10-24. Participants: Petr Baudis, Luben Tuikov.
Thread: https://gitlist.dev/t/6028

## Petr Baudis, 2006-10-24 03:23

Subject: [PATCH] gitweb: Show project's README.html if available
Message-ID: <20061024032346.4185.85330.stgit@rover>
URL: https://gitlist.dev/e/20061024032346.4185.85330.stgit%40rover

```
If the repository includes a README.html file, show it in the summary page.
The usual "this should be in the config file" argument does not apply here
since this can be larger and having such a big string in the config file
would be impractical.

I don't know if this is suitable upstream, but it's one of the repo.or.cz
custom modifications that I've thought could be interesting for others
as well.

Compared to the previous patch, this adds the '.html' extension to the
filename, so that it's clear it is, well, HTML.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---

 gitweb/gitweb.perl |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3b26ec3..81adc71 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2538,6 +2538,14 @@ sub git_summary {
 	}
 	print "</table>\n";
 
+	if (-s "$projectroot/$project/README.html") {
+		if (open my $fd, "$projectroot/$project/README.html") {
+			print "<div class=\"title\">readme</div>\n";
+			print $_ while (<$fd>);
+			close $fd;
+		}
+	}
+
 	open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
 		git_get_head_hash($project)
 		or die_error(undef, "Open git-rev-list failed");

```

## Luben Tuikov, 2006-10-24 08:43

Subject: Re: [PATCH] gitweb: Show project's README.html if available
Message-ID: <350280.74860.qm@web31804.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/350280.74860.qm%40web31804.mail.mud.yahoo.com
In-Reply-To: <20061024032346.4185.85330.stgit@rover>

```
--- Petr Baudis <pasky@suse.cz> wrote:
> If the repository includes a README.html file, show it in the summary page.
> The usual "this should be in the config file" argument does not apply here
> since this can be larger and having such a big string in the config file
> would be impractical.
> 
> I don't know if this is suitable upstream, but it's one of the repo.or.cz
> custom modifications that I've thought could be interesting for others
> as well.
> 
> Compared to the previous patch, this adds the '.html' extension to the
> filename, so that it's clear it is, well, HTML.
> 
> Signed-off-by: Petr Baudis <pasky@suse.cz>
> ---

Why not instead re-submit a patch implementing what was discussed
in this thread bearing the same name:

http://marc.theaimsgroup.com/?t=116044914900001&r=1&w=2

     Luben


> 
>  gitweb/gitweb.perl |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 3b26ec3..81adc71 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -2538,6 +2538,14 @@ sub git_summary {
>  	}
>  	print "</table>\n";
>  
> +	if (-s "$projectroot/$project/README.html") {
> +		if (open my $fd, "$projectroot/$project/README.html") {
> +			print "<div class=\"title\">readme</div>\n";
> +			print $_ while (<$fd>);
> +			close $fd;
> +		}
> +	}
> +
>  	open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
>  		git_get_head_hash($project)
>  		or die_error(undef, "Open git-rev-list failed");
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

```

## Petr Baudis, 2006-10-24 11:30

Subject: Re: [PATCH] gitweb: Show project's README.html if available
Message-ID: <20061024113057.GA20017@pasky.or.cz>
URL: https://gitlist.dev/e/20061024113057.GA20017%40pasky.or.cz
In-Reply-To: <350280.74860.qm@web31804.mail.mud.yahoo.com>

```
Dear diary, on Tue, Oct 24, 2006 at 10:43:08AM CEST, I got a letter
where Luben Tuikov <ltuikov@yahoo.com> said that...
> --- Petr Baudis <pasky@suse.cz> wrote:
> > If the repository includes a README.html file, show it in the summary page.
> > The usual "this should be in the config file" argument does not apply here
> > since this can be larger and having such a big string in the config file
> > would be impractical.
> > 
> > I don't know if this is suitable upstream, but it's one of the repo.or.cz
> > custom modifications that I've thought could be interesting for others
> > as well.
> > 
> > Compared to the previous patch, this adds the '.html' extension to the
> > filename, so that it's clear it is, well, HTML.
> > 
> > Signed-off-by: Petr Baudis <pasky@suse.cz>
> > ---
> 
> Why not instead re-submit a patch implementing what was discussed
> in this thread bearing the same name:
> 
> http://marc.theaimsgroup.com/?t=116044914900001&r=1&w=2

This implements

	http://marc.theaimsgroup.com/?l=git&m=116047939517299&w=2

I see no other ideas I could take there except various naming proposals
and perhaps using File::Copy but I'll wait until someone does a
gitweb-wide change for the latter.

I don't really care _what_ name it bears, but I'd like to have it
included. :-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

```
