Re: [PATCH] add ls-remote --get-push-url option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 31, 2015, 19:16 UTC
- Message-ID
- <xmqqzj2c3zoh.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150731190415.GA23674@megas.kitware.com>
Ben Boeckel <mathstuf@gmail.com> writes:
Show 11 quoted lines
> On Fri, Jul 31, 2015 at 12:02:14 -0700, Junio C Hamano wrote: >> Ben Boeckel <mathstuf@gmail.com> writes: >> >> > With some sed, yes, but then so would `git remote show` just as useful >> > too (and in that case, "why does --get-url exist either?" comes to >> > mind). >> >> Either carelessness let it slip in, or it came before 'git remote show'. > > Would adding `git remote show --url $remote` and `git remote show > --push-url $remote` be acceptable?
It is not just acceptable; I think "git remote" is a much better place to have something like that.
Or even "git remote get url [$there]", "git remote get push-url [$there]".
Or to mirror the existing "ls-remote --get-url [$there]", which directly asks "where does this request go if I run it without '--get-url' option?":
$ git push --get-url [$there [$refspec...]]
$ git push --get-refspec [$there [$refspec...]]might be a better option. The logic in "push" takes the current branch and configurations like branch.*.remote and push.default into account, so it is likely that you will get the exact information without too much code.
I am not opposed to having a scriptable interface to obtain these pieces of information. I was only objecting to teach ls-remote anything about push, which ls-remote does not have anything to do with.