Subject: bug#50689: 28.0.50; Wrong VC repo URL detection in bug-reference-mode

From: Tassilo Horn <[email-masked]>
Date: Mon, 20 Sep 2021 08:45:18 +0200

"Basil L. Contovounesios" <[email-masked]> writes:

Hey Basil,

> Tags: patch
>
> In a clone of https://github.com/abo-abo/swiper.git, with the following
> remotes:
>
>     $ git remote -v
>     elpa	savannah:/srv/git/emacs/elpa.git (fetch)
>     elpa	savannah:/srv/git/emacs/elpa.git (push)
>     origin	[email-masked]:basil-conto/swiper.git (fetch)
>     origin	[email-masked]:basil-conto/swiper.git (push)
>     upstream	[email-masked]:abo-abo/swiper.git (fetch)
>     upstream	[email-masked]:abo-abo/swiper.git (push)
>
> 0. emacs -Q ivy.el
> 1. M-: (vc-call-backend 'Git 'repository-url "upstream") RET
>
> This returns: "[email-masked]:basil-conto/swiper.git"
> instead of:   "[email-masked]:abo-abo/swiper.git"
>
> Step 1 is effectively what bug-reference-try-setup-from-vc does, and I
> believe the incorrect result is due to vc-git-repository-url expecting
> a file name, not a Git remote name, as its first argument.

Oh, good catch!

BTW, I've thought I've checked that previously <fork>/issues/X
redirected you to <originalrepo>/issues/X but that doesn't seem to be
the case right anymore...

> How's the attached fix?

LGTM.  Not sure about when-let/seq-fns.  I refrained from using them in
bug-reference.el so that it doesn't require subr-x.el and seq.el.  But
OTHO, I very much like them and would happily use them once they are
loaded anyway.

Bye,
Tassilo