From: Jay Soffian Date: Fri, 27 Feb 2009 20:48:18 GMT Subject: Re: [RFC] add test cases for the --repo option to git push 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 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]... $ git push [options]... --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.