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

Re: [RFC/PATCH] remote: add new sync command

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 11, 2011, 12:30 UTC
Message-ID
<CAMP44s2RjcFtdO2jft0Hg9RtqK-DRK47gX8By-dBFSBcSA+yFA@mail.gmail.com>
In-Reply-To
<20111108181442.GA17317@sigill.intra.peff.net>
On Tue, Nov 8, 2011 at 8:14 PM, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Tue, Nov 08, 2011 at 07:31:09PM +0200, Felipe Contreras wrote:
>
>> >  1. git push --prune <remote> :
>> >
>> >     I.e., use the "matching" refspec to not push new things, but turn
>> >     on pruning.
>>
>> I guess so, but ":" seems a bit obscure.
>
> Yeah, it is. It's also the default, so you could just do:
>
>  git push --prune <remote>

That would work only if not configured otherwise; remote.<foo>.push, push.default

> Although some people have argued for changing the default in future
> versions. I don't know what the status of that is.
IMO the default doesn't matter, it should be easy for everyone.
Show 9 quoted lines
>> >  2. git push <remote> refs/heads/*
>> >
>> >     Turn off pruning, but use an explicit refspec, not just "matching",
>> >     which will push all local branches.
>>
>> Isn't refs/heads/* the same as --all? BTW. I think --all is confusing,
>> should be --branches, or something.
>
> Doesn't --all mean all refs, including tags and branches?

Nope, only branches, try it. I also found it strange. And what is more, you can't use --all and --tags at the same time. Totally strange.

Also, --all doesn't push other refs (say refs/foobar/test)
I think this area has been neglected.
> I thought that was the thing you were avoiding.

--all + --tags is not the same as --mirror (refs/foobar/* is pushed only by --mirror).

And yes, in this particular use-case that's what I am trying to avoid, but in other use-cases (like creating a new repo and pushing *everything*), a *true* --all would be nice.

> We could add syntactic sugar to make
> --branches mean "refs/heads/*". But I do worry that pseudo-options like
> that just end up creating more confusion (I seem to recall there being a
> lot of confusion about "--tags", which is more or less the same thing).

But it's not, that could explain part of the confusion. I think these would be totally intuitive.

 --branches
 --tags
 --other
 --all
 --update
 --prune

But what about 'git fetch'? You didn't comment anything. I think we should try to be consistent in these imaginary future options, maybe to devise a transition, or at least to identify good names for the new options.

Cheers.
-- 
Felipe Contreras
Previous: Jeff KingNext: Jeff King
Message 18 of 26 in “remote: add new sync command”
  1. remote: add new sync commandFelipe Contreras, Nov 7, 2011
  2. Jeff KingNov 7, 2011
  3. Felipe ContrerasNov 7, 2011
  4. Jeff KingNov 7, 2011
  5. Felipe ContrerasNov 7, 2011
  6. Jeff KingNov 7, 2011
  7. Junio C HamanoNov 7, 2011
  8. Jeff KingNov 7, 2011
  9. Felipe ContrerasNov 8, 2011
  10. Junio C HamanoNov 8, 2011
  11. Felipe ContrerasNov 8, 2011
  12. Junio C HamanoNov 9, 2011
  13. Jakub NarebskiNov 11, 2011
  14. Junio C HamanoNov 11, 2011
  15. Jakub NarebskiNov 11, 2011
  16. Felipe ContrerasNov 8, 2011
  17. Jeff KingNov 8, 2011
  18. Felipe ContrerasNov 11, 2011
  19. Jeff KingNov 11, 2011
  20. Felipe ContrerasNov 12, 2011
  21. Jeff KingNov 14, 2011
  22. Felipe ContrerasNov 14, 2011
  23. Jeff KingNov 21, 2011
  24. Felipe ContrerasNov 21, 2011
  25. Jeff KingNov 30, 2011
  26. Felipe ContrerasNov 30, 2011

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.