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: Stephen Leake
Subject: Re: RFC: Automatic setup for bug-reference-mode
Date: Mon, 15 Jun 2020 02:56:34 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt)

Tassilo Horn <tsdh@gnu.org> writes:

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

I'm in the 1%; I have git repositories that don't have 'origin'; they
have 'savannah'. I migrated from monotone, where the remotes have real
names.

So some method of overriding 'origin' would be appreciated.

'git remote -v' lists all remotes; you could just pick the first one. 

-- 
-- Stephe



reply via email to

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