git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, git@vger.kernel.org
Subject: Re: [RFC PATCH] gitweb: improve title shortening heuristics
Date: Tue, 26 Jul 2022 23:31:32 -0700	[thread overview]
Message-ID: <xmqq4jz3vzgb.fsf@gitster.g> (raw)
In-Reply-To: <20220726135911.ycvgwbkixb3ei6w3@jrouhaud> (Julien Rouhaud's message of "Tue, 26 Jul 2022 21:59:11 +0800")

Julien Rouhaud <rjuju123@gmail.com> writes:

> Hi,
>
> On Mon, Jul 25, 2022 at 07:54:34AM +0200, Ævar Arnfjörð Bjarmason wrote:
>>
>> Please "inline" your patches, see "Sending your patches" in
>> Documentation/SubmittingPatches (I.e. send it with git-send-email, or
>> similar). I see this as:
>>
>> > [2. text/plain; v2-0001-gitweb-Remove-title_short-shortening-heuristics.patch]...
>
> Ah I'm sorry about that.  For the archives sake (and to make sure that I
> correctly configured my MUA), I'm reattaching the v2 inline.

Thanks.  It is not for the archives' sake; I do not take (or notice
in the first place) patches in attachments, simply because rarely
anybody reviews attachments.

>> This looks good to me, The one thing I'd add is that we're just running:
>>
>> 	 git rev-list --parents --header  --max-count=1 HEAD
>>
>> And parsing that, but if we're truncating things perhaps we should just
>> run "git log" or "git show" with the "%<(<N>[,trunc|ltrunc|mtrunc])"
>> syntax or similar.
>>
>> That's obviously a follow-up, but if anyone's interested in deleting
>> even more code here...
>
> Note that I didn't try to do anything about that.  I have the feeling that
> gitweb isn't wildly used nowadays, especially for bigger projects, so it didn't
> seems worth spending too much efforts.
>
> From ea4f31c0a2276f042322a11e258e55223863cd35 Mon Sep 17 00:00:00 2001

When you are sending the patch in for real, after making a non-patch
discussion (all of the above), you can write a "scissors" line

----- >8 -----

right here, immediately before your "From:" and "Subject:".  What it
does is to tell "git am" on the receiving end to ignore everything
it saw up to that point and pretend the message starts there.

You do not want to include "From <object name>" line that is used as
an internal separator in the mailbox format.  You do not want to
include the "Date:" in-body header, either.  "From:" and "Subject:"
are used often because they are frequently different from the e-mail
(e.g. in the message I am responding to, the sender is rjuju123@gmail,
not julien.rouhaud@free.fr, and we want the latter on the From: line
because that is what appears on the Signed-off-by: line).

> From: Julien Rouhaud <julien.rouhaud@free.fr>
> Subject: [PATCH v2] gitweb: Remove title_short shortening heuristics
>
> Those heuristics are way outdated and too general to be useful outside of
> kernel.org.  Since kernel.org doesn't use gitweb anymore and at least one
> project complained about incorrect behavior, entirely remove them.
>
> Signed-off-by: Julien Rouhaud <julien.rouhaud@free.fr>
> ---
>
> Notes:
>     Patch re-submitted inline rather than in attachment, sorry about the
>     previous attachments.

Thanks.  Will queue.


>  gitweb/gitweb.perl | 17 -----------------
>  1 file changed, 17 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 1835487ab2..e66eb3d9ba 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3560,23 +3560,6 @@ sub parse_commit_text {
>  		$title =~ s/^    //;
>  		if ($title ne "") {
>  			$co{'title'} = chop_str($title, 80, 5);
> -			# remove leading stuff of merges to make the interesting part visible
> -			if (length($title) > 50) {
> -				$title =~ s/^Automatic //;
> -				$title =~ s/^merge (of|with) /Merge ... /i;
> -				if (length($title) > 50) {
> -					$title =~ s/(http|rsync):\/\///;
> -				}
> -				if (length($title) > 50) {
> -					$title =~ s/(master|www|rsync)\.//;
> -				}
> -				if (length($title) > 50) {
> -					$title =~ s/kernel.org:?//;
> -				}
> -				if (length($title) > 50) {
> -					$title =~ s/\/pub\/scm//;
> -				}
> -			}
>  			$co{'title_short'} = chop_str($title, 50, 5);
>  			last;
>  		}
> --
> 2.37.0

  reply	other threads:[~2022-07-27  6:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  6:12 [RFC PATCH] gitweb: improve title shortening heuristics Julien Rouhaud
2022-07-25  1:30 ` Junio C Hamano
2022-07-25  2:12   ` Julien Rouhaud
2022-07-25  5:54     ` Ævar Arnfjörð Bjarmason
2022-07-26 13:59       ` Julien Rouhaud
2022-07-27  6:31         ` Junio C Hamano [this message]
2022-07-28  1:30           ` Julien Rouhaud

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq4jz3vzgb.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rjuju123@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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