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: git@vger.kernel.org
Subject: Re: [RFC PATCH] gitweb: improve title shortening heuristics
Date: Sun, 24 Jul 2022 18:30:44 -0700	[thread overview]
Message-ID: <xmqqfsiq6ksb.fsf@gitster.g> (raw)
In-Reply-To: <20220724061231.jddhqns7bqx5c2xm@jrouhaud> (Julien Rouhaud's message of "Sun, 24 Jul 2022 14:12:31 +0800")

Julien Rouhaud <rjuju123@gmail.com> writes:

> Otherwise, would it be acceptable to disable the whole block (the "remove
> leading stuff of merges to make the interesting part visible") with some new
> configuration option?

I personally find that "shortening" logic way too specific to the
kernel project hosted at kernel.org and would be inappropriate to
use it anywhere else.

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

Of course, http:// and rsync:// are way outdated (https://, ssh://
and git:// are probably reasonable).  Equally outdated is to merge
branches from master.kernel.org, www.kernel.org, or rsync.kernel.org
(many merges are recorded as pulling from git://git.kernel.org/ or
https://git.kernel.org/ these days).

The above code is all from 198066916a8 (Kay Sievers 2005-08-07), so
it is very much understandable that its shortening heuristics no
longer match reality.

Even worse, I somehow thought that kernel.org no longer uses gitweb
but uses something else.  So I suspect that nobody sheds tears if we
remove the whole block unconditionally.  In fact, it would make the
world a better place.


  reply	other threads:[~2022-07-25  1: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 [this message]
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
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=xmqqfsiq6ksb.fsf@gitster.g \
    --to=gitster@pobox.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).