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
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 27, 2009, 21:00 UTC
Message-ID
<alpine.LFD.2.00.0902271255530.3111@localhost.localdomain>
In-Reply-To
<76718490902271248p2de44082ka66645203c9683d4@mail.gmail.com>
On Fri, 27 Feb 2009, Jay Soffian wrote:
Show 7 quoted lines
> 
> 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>
Yes. 
But now do
	[alias]
		push-all=push all
and then try to add those options AFTERWARDS!
Show 5 quoted lines
> --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?
It's the "placed anywhere on the command line" that is the important part.
Try 
	git push-all --tags
and it didn't use to work without "--repo=all".

Of course, I think it works now, because I think "git push" uses "parse_options" these days, so now "--tags" actually works even after the repository definition. So _these_ days, you can just do

	git push all --tags

but that was not true historically. Back then, if you wanted to use an alias (which mean that the repo was named _before_ the arguments), you needed to do

	git push --repo=all --tags
because putting "--tags" after the repository name wouldn't work.

So _today_, we could remove the use of "--repo". But today, we have another reason to do "--repo" - compatibility.

		Linus
Previous: Jay SoffianNext: Jay Soffian
Message 12 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.