unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH v2 0/3] viewvcs: commit => query improvements
Date: Wed,  2 Oct 2024 22:38:59 +0000	[thread overview]
Message-ID: <20241002223902.4139389-1-e@80x24.org> (raw)
In-Reply-To: <20241002194448.4123393-1-e@80x24.org>

Threw in some minor formatting and HTML fixups, as well.
Most notably, there is consistently a <hr> before the textarea.

Eric Wong (3):
  viewvcs: close the <pre> tag if no query is extracted
  viewvcs: use wider textarea for search query
  viewvcs: generate search query for merge commits

 lib/PublicInbox/ViewVCS.pm | 75 ++++++++++++++++++++++++++++----------
 1 file changed, 55 insertions(+), 20 deletions(-)

Range-diff against v1:
-:  -------- > 1:  62e2c882 viewvcs: close the <pre> tag if no query is extracted
-:  -------- > 2:  f4b73a39 viewvcs: use wider textarea for search query
1:  8e9b1865 ! 3:  b49fa73f viewvcs: generate search query for merge commits
    @@ lib/PublicInbox/ViewVCS.pm: sub ibx_url_for {
     +			$in_titles = 1;
     +		} elsif ($in_titles) { # commit titles
     +			if (s/^  //) { # break up Xapian phrases
    -+				$t = join ' AND ', map { qq{s:"$_"} }
    ++				$t = join " AND\n ", map { qq{s:"$_"} }
     +					split /["\x{201c}\x{201d}]+/;
     +				push @s, $t if $t ne 's:"..."';
     +			} else { # trailing text or trailers?
    @@ lib/PublicInbox/ViewVCS.pm: committer $co
      	if (-s $fh > $MAX_SIZE) {
     @@ lib/PublicInbox/ViewVCS.pm: EOM
      		# commit?
    + 		print $zfh '</pre>';
      		my ($rows, $q) = PublicInbox::View::dfqry_text $ctx, $s;
    - 		if ($rows) {
    +-		if ($rows) {
     -			my $ibx_url = ibx_url_for($ctx);
     -			my $alt;
     -			if (defined $ibx_url) {
    @@ lib/PublicInbox/ViewVCS.pm: EOM
     -				$ibx_url = $upfx;
     -				$alt = '';
     -			}
    - 			print $zfh <<EOM;
    - </pre><hr><form action="$ibx_url"
    +-			print $zfh <<EOM;
    ++		print $zfh <<EOM if $rows;
    + <hr><form action="$ibx_url"
      id=related><pre>find related emails, including ancestors/descendants/conflicts
    -@@ lib/PublicInbox/ViewVCS.pm: id=related><pre>find related emails, including ancestors/descendants/conflicts
    + <textarea name=q cols=78 rows=$rows>$q</textarea>
    + <input type=submit value="search$alt"
    + />\t(<a href="${ibx_url}_/text/help/">help</a>)</pre></form>
      EOM
    - 		}
    - 	}
    +-		}
    ++	}
     +	if ($merge_titles) {
     +		print $zfh <<EOM;
    -+<form action="$ibx_url" id=merged><pre>find merged patch emails
    ++<hr><form action="$ibx_url" id=merged><pre>find merged patch emails
     +<textarea name=q cols=78
     +EOM
     +		my $nr = scalar @$merge_titles;
    @@ lib/PublicInbox/ViewVCS.pm: id=related><pre>find related emails, including ances
     +/></pre></form>
     +EOM
     +		undef $merge_titles;
    -+	}
    + 	}
      	chop($x = <<EOM);
      <hr><pre>glossary
    - --------

  reply	other threads:[~2024-10-02 22:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02 19:44 [PATCH] viewvcs: generate search query for merge commits Eric Wong
2024-10-02 22:38 ` Eric Wong [this message]
2024-10-02 22:39 ` [PATCH v2 1/3] viewvcs: close the <pre> tag if no query is extracted Eric Wong
2024-10-02 22:39 ` [PATCH v2 2/3] viewvcs: use wider textarea for search query Eric Wong
2024-10-02 22:39 ` [PATCH v2 3/3] viewvcs: generate search query for merge commits Eric Wong
2024-10-07  8:29   ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241002223902.4139389-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).