{"thread":{"id":"10169","subject":"git-push [--all] and tags","startedAt":"2007-10-06T16:05:06Z","lastAt":"2007-10-07T16:39:53Z","messageCount":5,"participants":["martin f krafft","Linus Torvalds","Sam Vilain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"55017","messageId":"20071006160506.GA28238@lapse.madduck.net","threadId":"10169","inReplyTo":null,"subject":"git-push [--all] and tags","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-10-06T16:05:06Z","receivedAt":"2007-10-06T16:05:06Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"Hello people,\n\n`git-push --all --tags` does not work because git-push ends up\ncalling git-send-pack --all refs/tags/*, which the latter does not\ndeal with.\n\nLooking at the code, it seems that previously, --all would push\neverything, not just refs/heads/*. What's the reason that this was\nchanged? Why aren't tags considered part of --all?\n\nIf I wanted to fix this, so that --all pushes heads and --all --tags\npushes heads and tags, I could do so in two ways:\n\n  1. instead of --all, pass refs/heads/* to git-send-pack\n  2. add --tags to git-send-pack\n\nwhich of these two would you prefer and why?\n\nThanks,\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \n\"imagine if every thursday your shoes exploded if you\n tied them the usual way. this happens to us all the time\n with computers, and nobody thinks of complaining.\"\n                                                        -- jeff raskin\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"55038","messageId":"47083035.7070904@vilain.net","threadId":"10169","inReplyTo":"20071006160506.GA28238@lapse.madduck.net","subject":"Re: git-push [--all] and tags","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2007-10-07T01:02:45Z","receivedAt":"2007-10-07T01:02:45Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"martin f krafft wrote:\n> Hello people,\n>\n> `git-push --all --tags` does not work because git-push ends up\n> calling git-send-pack --all refs/tags/*, which the latter does not\n> deal with.\n>\n> Looking at the code, it seems that previously, --all would push\n> everything, not just refs/heads/*. What's the reason that this was\n> changed? Why aren't tags considered part of --all?\n>\n> If I wanted to fix this, so that --all pushes heads and --all --tags\n> pushes heads and tags, I could do so in two ways:\n>\n>   1. instead of --all, pass refs/heads/* to git-send-pack\n>   2. add --tags to git-send-pack\n>\n> which of these two would you prefer and why?\n>   \n\nThink is, pushing tags is considered to be something that needs to be\ndone very explicitly; the convention, after all, is that published tags\nare forever.  Whereas branches change all the time.  So, pushing tags\nshould require an extra flag.\n\nSam.\n"},{"id":"55034","messageId":"alpine.LFD.0.999.0710061814310.23684@woody.linux-foundation.org","threadId":"10169","inReplyTo":"47083035.7070904@vilain.net","subject":"Re: git-push [--all] and tags","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-10-07T01:26:45Z","receivedAt":"2007-10-07T01:26:45Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 7 Oct 2007, Sam Vilain wrote:\n>\n> Think is, pushing tags is considered to be something that needs to be\n> done very explicitly; the convention, after all, is that published tags\n> are forever.  Whereas branches change all the time.  So, pushing tags\n> should require an extra flag.\n\nWell, I agrewe with Martin, and I think you missed his point.\n\nSure, pushing tags should require you to say so explicitly, but right now \nyou cannot (for example) push *both* the common branches *and* tags \neasily.\n\nYou can do\n\n\tgit push\n\nto push common branches, and you can do\n\n\tgit push --tags\n\nto push tags, but there's no way to say \"push both the common branches \n_and_ all tags\".\n\n(And the same is true of \"--all\" and \"--tags\").\n\nSo I do think Martin is right. I think we should:\n\n - make sure that \"--all --tags\" DTRT, namely send all branches and all \n   tags. Right now they are actually very similar things (one works on \n   \"refs/heads\", while the other works on \"refs/tags\"), but they are \n   implemented using *totally* different logic, and they don't work \n   together.\n\n - I think it would be a good idea to implement a \"--shared\" flag, which \n   is the current default behavior when there are no command line flags, \n   and there are no listed branches to push in the config file. That would \n   allow doing \"git push --shared --tags\" to update shared branches _and_ \n   tags, but it would probably *also* make it easier to explain the \n   default behaviour of \"git push\", by making the behavior more explicit.\n\n   (IOW, you can introduce the notion of \"--shared updates all branches \n   that exists both locally and remotely under the same names\" separately \n   early on as a command line option, and then later just explain that if \n   there is nothing else telling git what to push, it will default to \n   that shared branch behavior)\n\nHmm? I do agree with \"git push\" as it now stands has a lot of warts, \nalthough I don't really agree with the people who want to change the \ndefault behavior.\n\n\t\t\tLinus\n"},{"id":"55042","messageId":"20071007093636.GA3568@lapse.madduck.net","threadId":"10169","inReplyTo":"alpine.LFD.0.999.0710061814310.23684@woody.linux-foundation.org","subject":"Re: git-push [--all] and tags","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-10-07T09:36:36Z","receivedAt":"2007-10-07T09:36:36Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Linus Torvalds <torvalds@linux-foundation.org> [2007.10.07.0226 +0100]:\n> Well, I agrewe with Martin, and I think you missed his point.\n\n(he did)\n\n> Hmm? I do agree with \"git push\" as it now stands has a lot of warts, \n> although I don't really agree with the people who want to change the \n> default behavior.\n\nSo am I right if I say that all the logic should really be happening\nin send-pack and that push is really just an interface when it comes\nto selecting the refs to push, so it should basically feed through\nthe options and refs, meaning that send-pack should get --tags and\n--shared as well?\n\nOr should push enumerate all refs needed and pass them directly to\nsend-pack, effectively making send-pack's --all option obsolete?\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \n\"time flies like an arrow. fruit flies like a banana.\"\n                                                       -- groucho marx\n(panda eats shoots and leaves)\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"55066","messageId":"alpine.LFD.0.999.0710070929340.23684@woody.linux-foundation.org","threadId":"10169","inReplyTo":"20071007093636.GA3568@lapse.madduck.net","subject":"Re: git-push [--all] and tags","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-10-07T16:39:53Z","receivedAt":"2007-10-07T16:39:53Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 7 Oct 2007, martin f krafft wrote:\n> \n> So am I right if I say that all the logic should really be happening\n> in send-pack and that push is really just an interface when it comes\n> to selecting the refs to push, so it should basically feed through\n> the options and refs, meaning that send-pack should get --tags and\n> --shared as well?\n\nI really don't have any strong personal opinions. I don't think anybody is \never supposed to use send-pack directly, so I don't think it really much \nmatters whether send-pack is taught to do all the helper options too, or \nwhether it should just get the list of refs..\n\nBut yes, I suspect it would be cleanest to just remove the \"expand --tags\" \nlogic from builtin-push, and make the actual sending side do that.\n\n> Or should push enumerate all refs needed and pass them directly to\n> send-pack, effectively making send-pack's --all option obsolete?\n\nI don't think this works very well - builtin-push doesn't even know what \nthe remote branches _are_, so it cannot list \"these branches are shared\". \nSo we'd always have to have that shared behaviour embedded in send-pack \nanyway, so I think the most logical thing is to also do the logic for \n--all and --tags there.\n\nIOW, builtin-push would just be a wrapper around send-pack, doing the \n\"for each remote\" thing, but just passing down all/tags/shared.\n\n\t\tLinus\n"}]}