git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: make HTML links out of http/https URLs in changelogs
@ 2006-11-21 22:02 Kir Kolyshkin
  2006-11-21 22:28 ` Jakub Narebski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kir Kolyshkin @ 2006-11-21 22:02 UTC (permalink / raw)
  To: git

It is a common practice to put links to bugzillas, mailing lists, etc. 
in git log entries. The fact that gitweb doesn't make HTML links out of 
that URLs makes following those URLs inconvenient. This patch fixes that 
problem, trying to address cases when URL is enclosed in round or square 
brackets.

Slightly tested on http://git.openvz.org/. Applicable to git-1.4.4.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
---
 gitweb/gitweb.perl |    2 ++
 1 file changed, 2 insertions(+)

--- git-1.4.4/gitweb/gitweb.perl	2006-11-15 08:22:27.000000000 +0100
+++ git-1.4.4-my/gitweb/gitweb.perl	2006-11-21 22:49:14.000000000 +0100
@@ -828,6 +828,8 @@
 			$line =~ s/$hash_text/$link/;
 		}
 	}
+	# make HTML links out of http(s) URLs
+	$line =~ s/(http[s]?:\/\/[^[:space:]\]\)]+)/<a href="\1">\1<\/a>/g;
 	return $line;
 }
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-22 20:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21 22:02 [PATCH] gitweb: make HTML links out of http/https URLs in changelogs Kir Kolyshkin
2006-11-21 22:28 ` Jakub Narebski
2006-11-21 23:55 ` Randal L. Schwartz
2006-11-22  0:06 ` Petr Baudis
2006-11-22  9:00   ` Kir Kolyshkin
2006-11-22 20:56     ` Petr Baudis

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).