git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add ls-remote --get-push-url option

From
Ben Boeckel <mathstuf@gmail.com>
Date
Jul 31, 2015, 20:51 UTC
Message-ID
<20150731205142.GB6556@megas.kitware.com>
In-Reply-To
<xmqqzj2c3zoh.fsf@gitster.dls.corp.google.com>
On Fri, Jul 31, 2015 at 12:16:46 -0700, Junio C Hamano wrote:
> Or even "git remote get url [$there]", "git remote get push-url [$there]".

Looking at `git remote`'s existing subcommands, consistency there would be something like:

    git remote get-url $there
    git remote get-url --push $there

The new call could also show *all* remotes which will be pushed to, not just the first. Looking at the structure, it also has fields for multiple fetch urls. I would assume git would fetch the union of refs; not sure about conflicts and such.

Show 10 quoted lines
> 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.

This is a little weird to me. `git push` is porcelain; `git ls-remote` feels more like plumbing (command-list.txt seems to agree). Maybe it is also useful since it takes these other configuration values into account. But maybe pushing has enough extra factors? Might it make sense in addition to a `git remote get-url`?

> 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.
OK. Thanks.
--Ben
Previous: Junio C HamanoNext: Ben Boeckel
Message 8 of 22 in “add ls-remote --get-push-url option”
  1. add ls-remote --get-push-url optionBen Boeckel, Jul 31, 2015
  2. ls-remote: add --get-push-url optionBen Boeckel, Jul 31, 2015
  3. Junio C HamanoJul 31, 2015
  4. Ben BoeckelJul 31, 2015
  5. Junio C HamanoJul 31, 2015
  6. Ben BoeckelJul 31, 2015
  7. Junio C HamanoJul 31, 2015
  8. Ben BoeckelJul 31, 2015
  9. add git-url subcommandBen Boeckel, Aug 3, 2015
  10. remote: add get-url subcommandBen Boeckel, Aug 3, 2015
  11. Eric SunshineAug 3, 2015
  12. Ben BoeckelAug 4, 2015
  13. Eric SunshineAug 4, 2015
  14. remote: add get-url subcommandBen Boeckel, Aug 4, 2015
  15. Junio C HamanoAug 5, 2015
  16. Ben BoeckelAug 5, 2015
  17. Junio C HamanoAug 5, 2015
  18. remote: add get-url subcommandBen Boeckel, Sep 4, 2015
  19. Junio C HamanoSep 4, 2015
  20. remote: add get-url subcommandBen Boeckel, Sep 16, 2015
  21. Junio C HamanoSep 16, 2015
  22. remote: add get-url subcommandBen Boeckel, Sep 17, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.