emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Automatic setup for bug-reference-mode


From: Basil L. Contovounesios
Subject: Re: RFC: Automatic setup for bug-reference-mode
Date: Sun, 14 Jun 2020 22:03:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 14.06.2020 23:39, Tassilo Horn wrote:
>> Actually, "git ls-remote --get-url" doesn't work satisfactory which I
>> noticed after committing above change on a new local branch.  In that
>> case, it returned "." so I've changed to this version
>> (defun vc-git-repository-url (file-or-dir)
>>    (let ((default-directory (vc-git-root file-or-dir)))
>>      (with-temp-buffer
>>        (vc-git-command (current-buffer) 0 nil "remote" "get-url" "origin")
>>        (buffer-substring-no-properties (point-min) (1- (point-max))))))
>> where I explicitly name the remote "origin" (which, I know, doesn't need
>> to exist but still works in 99% of all cases).
>
> Sounds good!
>
> If the new version can be used in vc-git-dir-extra-headers, could you please
> make it so?
>
> That aside, I was going to ask whether the new backend method should take a
> "remote-name" argument, but I don't know how many backends support different
> remotes. Or what other actual code is going to use this method anyway.

It would definitely be nice to somehow make this configurable.  For
example in my local Emacs checkout I have Savannah as the "upstream"
remote, and my mirror on GitLab as the "origin" remote, because that's
where I push to most of the time.

I think Forge[1] achieves this by supporting a per-repository git-config
variable which tells it which remote to use.

[1]: https://github.com/magit/forge

Thanks,

-- 
Basil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]