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

Re: [RFC] add test cases for the --repo option to git push

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 27, 2009, 20:48 UTC
Message-ID
<76718490902271248p2de44082ka66645203c9683d4@mail.gmail.com>
In-Reply-To
<49A7C3A7.6060202@drmicha.warpmail.net>

On Fri, Feb 27, 2009 at 5:42 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

> bcc785f (git push: add verbose flag and allow overriding of default
> target repository, 2006-10-30) Linus introduces --repo.

So I still don't get why Linus introduced the option. I'm looking at bcc785f:builtin-push.c and AFAICT, the following are exactly equivalent:

$ git push [options]... <repo> $ git push [options]... --repo=<repo>

Which is why I sent the original message that has spawned this saga. :-)
Here's the abbreviated code in question:
        const char *repo = "origin";    /* default repository */
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
                if (arg[0] != '-') {
                        repo = arg;
                        i++;
                        break;
                }
                if (!strncmp(arg, "--repo=", 7)) {
                        repo = arg+7;
                        continue;
                }
        }
        set_refspecs(argv + i, argc - i);
        return do_push(repo);

--repo can be placed anywhere on the command line, but other than that, it's identical in effect to specifying the repo as the first non-dashed argument.

Or am I completely blind?
j.
Previous: Junio C HamanoNext: Linus Torvalds
Message 11 of 13 in “git push usage”
  1. Jay SoffianFeb 20, 2009
  2. Jay SoffianFeb 21, 2009
  3. [RFC] add test cases for the --repo option to git pushMichael J Gruber, Feb 24, 2009
  4. Junio C HamanoFeb 25, 2009
  5. Michael J GruberFeb 26, 2009
  6. Junio C HamanoFeb 26, 2009
  7. Michael J GruberFeb 26, 2009
  8. Jay SoffianFeb 26, 2009
  9. Michael J GruberFeb 27, 2009
  10. Junio C HamanoFeb 27, 2009
  11. Jay SoffianFeb 27, 2009
  12. Linus TorvaldsFeb 27, 2009
  13. Jay SoffianFeb 27, 2009

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.