git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	Git <git@vger.kernel.org>,
	jost.schulte@tutanota.com
Subject: Re: Configure default merge message
Date: Wed, 24 Mar 2021 18:41:41 -0400	[thread overview]
Message-ID: <YFvAJU3Euxhjb+uw@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqk0pwxqvt.fsf@gitster.g>

On Wed, Mar 24, 2021 at 01:01:42PM -0700, Junio C Hamano wrote:

> > I'd like to configure git to omit the "of https://bitbucket.org/repository-name" part. How can I do that?
> 
> Ævar, is this something we recently made it impossible with 4e168333
> (shortlog: remove unused(?) "repo-abbrev" feature, 2021-01-12), or
> is there more to it than resurrecting that "feature" to do what Jost
> seems to want?

IIRC, in that earlier discussion Linus said he used a prepare-commit-msg
hook these days instead of repo-abbrev. And it should be able to handle
this case, as well.

Something like this seems to work for me:

  $ cat .git/hooks/prepare-commit-msg
  #!/bin/sh
  case "$2" in
  merge)
  	perl -i -pe '
  	  s{Merge (.*) of https://github.com/gitster/git}{Merge $1}
  	' "$1"
  	;;
  esac

  $ git pull https://github.com/gitster/git next
  [...]
  $ git log -1 --format=%s
  Merge branch 'next'

-Peff

  reply	other threads:[~2021-03-24 22:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 18:57 Configure default merge message jost.schulte
2021-03-24 20:01 ` Junio C Hamano
2021-03-24 22:41   ` Jeff King [this message]
2021-03-25  2:02   ` Ævar Arnfjörð Bjarmason
2021-03-26  6:30     ` jost.schulte
     [not found]     ` <MWhDNa_--3-2@tutanota.com>
2021-03-26 10:43       ` Ævar Arnfjörð Bjarmason

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=YFvAJU3Euxhjb+uw@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jost.schulte@tutanota.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).