user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] git: local_nick: handle trailing or redundant '/' in git_dir
@ 2021-03-29 23:58 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-03-29 23:58 UTC (permalink / raw)
  To: meta

Some cgit configs use trailing slashes in pathnames
which we preserve internally.

Before this change, trailing slashes in cgit config files
was causing ViewVCS (SolverGit) output to show up as "???"
for coderepos without cgitUrl configured.
---
 lib/PublicInbox/Git.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 2ae5eff9..96ac17a3 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -426,7 +426,7 @@ sub local_nick ($) {
 	my ($self) = @_;
 	my $ret = '???';
 	# don't show full FS path, basename should be OK:
-	if ($self->{git_dir} =~ m!/([^/]+)(?:/\.git)?\z!) {
+	if ($self->{git_dir} =~ m!/([^/]+)(?:/*\.git/*)?\z!) {
 		$ret = "$1.git";
 	}
 	wantarray ? ($ret) : $ret;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-29 23:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 23:58 [PATCH] git: local_nick: handle trailing or redundant '/' in git_dir Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git