[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: Automatic setup for bug-reference-mode
From: |
Tassilo Horn |
Subject: |
Re: RFC: Automatic setup for bug-reference-mode |
Date: |
Sun, 14 Jun 2020 22:39:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 14.06.2020 19:30, Tassilo Horn wrote:
>> +(defun vc-git-repository-url (file-or-dir)
>> + (let ((default-directory (vc-git-root file-or-dir)))
>> + (with-temp-buffer
>> + (vc-git--call (current-buffer) "ls-remote" "--get-url")
>> + (buffer-substring-no-properties (point-min) (1- (point-max))))))
>
> Can it be used in vc-git-dir-extra-headers, to replace the logic that
> calculates the value of 'remote'?
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).
Bye,
Tassilo
- Re: RFC: Automatic setup for bug-reference-mode, (continued)
- Re: RFC: Automatic setup for bug-reference-mode, Stefan Monnier, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Tassilo Horn, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Tassilo Horn, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Basil L. Contovounesios, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Stefan Monnier, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Basil L. Contovounesios, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Tassilo Horn, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Dmitry Gutov, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode,
Tassilo Horn <=
- Re: RFC: Automatic setup for bug-reference-mode, Dmitry Gutov, 2020/06/14
- Re: RFC: Automatic setup for bug-reference-mode, Basil L. Contovounesios, 2020/06/14
- VC repository-url command (was: RFC: Automatic setup for bug-reference-mode), Tassilo Horn, 2020/06/15
- Re: VC repository-url command, Basil L. Contovounesios, 2020/06/15
- Re: RFC: Automatic setup for bug-reference-mode, Stephen Leake, 2020/06/15
- Re: RFC: Automatic setup for bug-reference-mode, Tassilo Horn, 2020/06/15
- Re: RFC: Automatic setup for bug-reference-mode, Juri Linkov, 2020/06/17
- Re: RFC: Automatic setup for bug-reference-mode, Dmitry Gutov, 2020/06/17
- Re: RFC: Automatic setup for bug-reference-mode, Tassilo Horn, 2020/06/18
- Re: RFC: Automatic setup for bug-reference-mode, Dmitry Gutov, 2020/06/18