unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/3] wwwtext: minor config example tweaks
@ 2020-09-09 21:23 Eric Wong
  2020-09-09 21:23 ` [PATCH 1/3] wwwtext: describe the use of `coderepo' entries Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2020-09-09 21:23 UTC (permalink / raw)
  To: meta

Just a couple of things which hopefully makes things easier
for newbies...

Eric Wong (3):
  wwwtext: describe the use of `coderepo' entries
  wwwtext: don't blindly quote "git clone" destination
  wwwtext: config comment improvements

 lib/PublicInbox/WwwText.pm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)


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

* [PATCH 1/3] wwwtext: describe the use of `coderepo' entries
  2020-09-09 21:23 [PATCH 0/3] wwwtext: minor config example tweaks Eric Wong
@ 2020-09-09 21:23 ` Eric Wong
  2020-09-09 21:23 ` [PATCH 2/3] wwwtext: don't blindly quote "git clone" destination Eric Wong
  2020-09-09 21:23 ` [PATCH 3/3] wwwtext: config comment improvements Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2020-09-09 21:23 UTC (permalink / raw)
  To: meta

The `solver' feature is not very obvious, give potential
users a hint about it.
---
 lib/PublicInbox/WwwText.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index fa3774f8..14470b45 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -181,7 +181,13 @@ EOF
 	# and drop the original structure
 	if (defined(my $cr = $ibx->{coderepo})) {
 		$$txt .= "\tcoderepo = $_\n" for @$cr;
+		$$txt .= <<'EOF';
 
+; `coderepo' entries allows blob reconstruction via patch emails if
+; the inbox is indexed with Xapian.  `@@ <from-range> <to-range> @@'
+; line number ranges in `[PATCH]' emails link to /$INBOX_NAME/$OID/s/,
+; an HTTP endpoint which reconstructs git blobs via git-apply(1).
+EOF
 		my $pi_config = $ctx->{www}->{pi_config};
 		for my $cr_name (@$cr) {
 			my $urls = $pi_config->{"coderepo.$cr_name.cgiturl"};

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

* [PATCH 2/3] wwwtext: don't blindly quote "git clone" destination
  2020-09-09 21:23 [PATCH 0/3] wwwtext: minor config example tweaks Eric Wong
  2020-09-09 21:23 ` [PATCH 1/3] wwwtext: describe the use of `coderepo' entries Eric Wong
@ 2020-09-09 21:23 ` Eric Wong
  2020-09-09 21:23 ` [PATCH 3/3] wwwtext: config comment improvements Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2020-09-09 21:23 UTC (permalink / raw)
  To: meta

Save screen space and light up fewer pixels to reduce visual noise.
---
 lib/PublicInbox/WwwText.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index 14470b45..99aec370 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -198,11 +198,11 @@ EOF
 			if ($urls && scalar(@$urls)) {
 				$$txt .= "\t; ";
 				$$txt .= join(" ||\n\t;\t", map {;
-					my $cpath = $path;
+					my $dst = $path;
 					if ($path !~ m![a-z0-9_/\.\-]!i) {
-						$cpath = dq_escape($cpath);
+						$dst = '"'.dq_escape($dst).'"';
 					}
-					qq(git clone $_ "$cpath");
+					qq(git clone $_ $dst);
 				} @$urls);
 				$$txt .= "\n";
 			}

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

* [PATCH 3/3] wwwtext: config comment improvements
  2020-09-09 21:23 [PATCH 0/3] wwwtext: minor config example tweaks Eric Wong
  2020-09-09 21:23 ` [PATCH 1/3] wwwtext: describe the use of `coderepo' entries Eric Wong
  2020-09-09 21:23 ` [PATCH 2/3] wwwtext: don't blindly quote "git clone" destination Eric Wong
@ 2020-09-09 21:23 ` Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2020-09-09 21:23 UTC (permalink / raw)
  To: meta

Use the full URL of the inbox being mirrored to reduce ambiguity
(instead of just the inbox name).

Using asymmetric quotes (e.g `foo') improves readability for me
in that it's more obvious when a quote begins and ends.  It also
lights up fewer pixels and reduces visual noise compared to
double-quotes.

We'll also reflow the `mainrepo' vs `inboxdir' comment slightly
to emphasize the word `instead'.
---
 lib/PublicInbox/WwwText.pm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index 99aec370..04c9b1c4 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -139,14 +139,16 @@ sub inbox_config ($$$) {
 	push @$hdr, 'Content-Disposition', 'inline; filename=inbox.config';
 	my $name = dq_escape($ibx->{name});
 	my $inboxdir = '/path/to/top-level-inbox';
+	my $base_url = $ibx->base_url($ctx->{env});
 	$$txt .= <<EOS;
-; example public-inbox config snippet for "$name"
-; see public-inbox-config(5) manpage for more details:
+; Example public-inbox config snippet for a mirror of
+; $base_url
+; See public-inbox-config(5) manpage for more details:
 ; https://public-inbox.org/public-inbox-config.html
 [publicinbox "$name"]
 	inboxdir = $inboxdir
-	; note: public-inbox before v1.2.0 used "mainrepo"
-	; instead of "inboxdir", both remain supported after 1.2
+	; note: public-inbox before v1.2.0 used `mainrepo' instead of
+	; `inboxdir', both remain supported after 1.2
 	mainrepo = $inboxdir
 	url = https://example.com/$name/
 	url = http://example.onion/$name/
@@ -156,7 +158,6 @@ EOS
 		$$txt .= "\t$k = $_\n" for @$v;
 	}
 	if (my $altid = $ibx->{altid}) {
-		my $base_url = $ibx->base_url($ctx->{env});
 		my $altid_map = $ibx->altid_map;
 		$$txt .= <<EOF;
 	; altid DBs may be used to provide numeric article ID lookup from

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

end of thread, other threads:[~2020-09-09 21:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 21:23 [PATCH 0/3] wwwtext: minor config example tweaks Eric Wong
2020-09-09 21:23 ` [PATCH 1/3] wwwtext: describe the use of `coderepo' entries Eric Wong
2020-09-09 21:23 ` [PATCH 2/3] wwwtext: don't blindly quote "git clone" destination Eric Wong
2020-09-09 21:23 ` [PATCH 3/3] wwwtext: config comment improvements Eric Wong

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 read-only IMAP folder(s) and NNTP newsgroup(s).