{"thread":{"id":"33906","subject":"push not resolving commit-ish?","startedAt":"2013-05-23T10:53:10Z","lastAt":"2013-05-23T21:26:50Z","messageCount":12,"participants":["Michael S. Tsirkin","Felipe Contreras","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"218251","messageId":"20130523105310.GA17361@redhat.com","threadId":"33906","inReplyTo":null,"subject":"push not resolving commit-ish?","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-05-23T10:53:10Z","receivedAt":"2013-05-23T10:53:10Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"Looks like push can't resolve tags to commits.\nWhy is that?\n\nlinux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\nerror: Trying to write non-commit object\na8c6d53c4d84b3a5eb182758a9cdceceba4691da to branch refs/heads/vhost-next\nTo /scm/linux\n ! [remote rejected] v3.10-rc2 -> vhost-next (failed to write)\nerror: failed to push some refs to '/scm/linux'\n\nlinux$ git log v3.10-rc2|head -5\ncommit c7788792a5e7b0d5d7f96d0766b4cb6112d47d75\nAuthor: Linus Torvalds <torvalds@linux-foundation.org>\nDate:   Mon May 20 14:37:38 2013 -0700\n\n    Linux 3.10-rc2\n\n\nlinux$ $ git push -f $PWD\nc7788792a5e7b0d5d7f96d0766b4cb6112d47d75:refs/heads/vhost-next\nEverything up-to-date\n"},{"id":"218253","messageId":"20130523105625.GA17455@redhat.com","threadId":"33906","inReplyTo":"20130523105310.GA17361@redhat.com","subject":"Re: push not resolving commit-ish?","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-05-23T10:56:25Z","receivedAt":"2013-05-23T10:56:25Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"On Thu, May 23, 2013 at 01:53:10PM +0300, Michael S. Tsirkin wrote:\n> Looks like push can't resolve tags to commits.\n> Why is that?\n> \n> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\n> error: Trying to write non-commit object\n> a8c6d53c4d84b3a5eb182758a9cdceceba4691da to branch refs/heads/vhost-next\n> To /scm/linux\n>  ! [remote rejected] v3.10-rc2 -> vhost-next (failed to write)\n> error: failed to push some refs to '/scm/linux'\n> \n> linux$ git log v3.10-rc2|head -5\n> commit c7788792a5e7b0d5d7f96d0766b4cb6112d47d75\n> Author: Linus Torvalds <torvalds@linux-foundation.org>\n> Date:   Mon May 20 14:37:38 2013 -0700\n> \n>     Linux 3.10-rc2\n> \n> \n> linux$ $ git push -f $PWD\n> c7788792a5e7b0d5d7f96d0766b4cb6112d47d75:refs/heads/vhost-next\n> Everything up-to-date\n> \n> \n\nForgot to say - this is recent git.git master:\n\n1.8.3.rc3.8.g5e49f30\n"},{"id":"218254","messageId":"CAMP44s18KCYEZaMTn_S2znocyr-WDCT5ciuzLoYaSHPQFc4XCw@mail.gmail.com","threadId":"33906","inReplyTo":"20130523105310.GA17361@redhat.com","subject":"Re: push not resolving commit-ish?","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-23T10:56:57Z","receivedAt":"2013-05-23T10:56:57Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> Looks like push can't resolve tags to commits.\n> Why is that?\n>\n> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\n\nPerhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,\nI already complained about it to no avail.\n\n-- \nFelipe Contreras\n"},{"id":"218292","messageId":"7v8v35fu7n.fsf@alter.siamese.dyndns.org","threadId":"33906","inReplyTo":"20130523105310.GA17361@redhat.com","subject":"Re: push not resolving commit-ish?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-23T18:05:00Z","receivedAt":"2013-05-23T18:05:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@redhat.com> writes:\n\n> Looks like push can't resolve tags to commits.\n> Why is that?\n\nHow else would you push a tag out?\n"},{"id":"218293","messageId":"7v4ndtftyf.fsf@alter.siamese.dyndns.org","threadId":"33906","inReplyTo":"CAMP44s18KCYEZaMTn_S2znocyr-WDCT5ciuzLoYaSHPQFc4XCw@mail.gmail.com","subject":"Re: push not resolving commit-ish?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-23T18:10:32Z","receivedAt":"2013-05-23T18:10:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:\n>> Looks like push can't resolve tags to commits.\n>> Why is that?\n>>\n>> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\n>\n> Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,\n\nMore commonly \"v3.10-rc2^0:vhost-next\", if you are truly pushing it\nout to a remote repository, but then it invites a puzzlement \"What\ndo you plan to do next after pushing?  The only reason v3.10-rc2 is\nused is because there is not yet a local branch that will host the\nvhost-next changes that is built on top of that tag (otherwise you\nwould be pushing that branch to vhost-next)\".\n\nBut in this particular case, you are force-pushing into the current\nrepository, and it is spelled much more commonly\n\n    git branch -f vhost-next v3.10-rc2\n\nI would think.\n"},{"id":"218308","messageId":"20130523210550.GA31421@redhat.com","threadId":"33906","inReplyTo":"7v4ndtftyf.fsf@alter.siamese.dyndns.org","subject":"Re: push not resolving commit-ish?","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-05-23T21:05:50Z","receivedAt":"2013-05-23T21:05:50Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"On Thu, May 23, 2013 at 11:10:32AM -0700, Junio C Hamano wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n> \n> > On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> >> Looks like push can't resolve tags to commits.\n> >> Why is that?\n> >>\n> >> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\n> >\n> > Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,\n> \n> More commonly \"v3.10-rc2^0:vhost-next\", if you are truly pushing it\n> out to a remote repository, but then it invites a puzzlement \"What\n> do you plan to do next after pushing?  The only reason v3.10-rc2 is\n> used is because there is not yet a local branch that will host the\n> vhost-next changes that is built on top of that tag (otherwise you\n> would be pushing that branch to vhost-next)\".\n> \n> But in this particular case, you are force-pushing into the current\n> repository, and it is spelled much more commonly\n> \n>     git branch -f vhost-next v3.10-rc2\n> \n> I would think.\n\nThat was just a bad example though, I really use it for\npush to remove.\n"},{"id":"218309","messageId":"7v7gipe78q.fsf@alter.siamese.dyndns.org","threadId":"33906","inReplyTo":"20130523210550.GA31421@redhat.com","subject":"Re: push not resolving commit-ish?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-23T21:06:29Z","receivedAt":"2013-05-23T21:06:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@redhat.com> writes:\n\n> On Thu, May 23, 2013 at 11:10:32AM -0700, Junio C Hamano wrote:\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>> \n>> > On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:\n>> >> Looks like push can't resolve tags to commits.\n>> >> Why is that?\n>> >>\n>> >> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\n>> >\n>> > Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,\n>> \n>> More commonly \"v3.10-rc2^0:vhost-next\", if you are truly pushing it\n>> out to a remote repository, but then it invites a puzzlement \"What\n>> do you plan to do next after pushing?  The only reason v3.10-rc2 is\n>> used is because there is not yet a local branch that will host the\n>> vhost-next changes that is built on top of that tag (otherwise you\n>> would be pushing that branch to vhost-next)\".\n>> \n>> But in this particular case, you are force-pushing into the current\n>> repository, and it is spelled much more commonly\n>> \n>>     git branch -f vhost-next v3.10-rc2\n>> \n>> I would think.\n>\n> That was just a bad example though, I really use it for\n> push to remove.\n\nThen it invites a puzzlement as you can see above.\n"},{"id":"218310","messageId":"20130523210920.GB31421@redhat.com","threadId":"33906","inReplyTo":"7v8v35fu7n.fsf@alter.siamese.dyndns.org","subject":"Re: push not resolving commit-ish?","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-05-23T21:09:20Z","receivedAt":"2013-05-23T21:09:20Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"On Thu, May 23, 2013 at 11:05:00AM -0700, Junio C Hamano wrote:\n> \"Michael S. Tsirkin\" <mst@redhat.com> writes:\n> \n> > Looks like push can't resolve tags to commits.\n> > Why is that?\n> \n> How else would you push a tag out?\n\nWell my reaction is, it seems to figure out it needs a commit and then\ninstead of just getting it, it errors out.  Why not just DWIM?\n\nBut at least I see the reason now, thanks.\n-- \nMST\n"},{"id":"218311","messageId":"20130523211647.GC31421@redhat.com","threadId":"33906","inReplyTo":"7v4ndtftyf.fsf@alter.siamese.dyndns.org","subject":"Re: push not resolving commit-ish?","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-05-23T21:16:47Z","receivedAt":"2013-05-23T21:16:47Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"On Thu, May 23, 2013 at 11:10:32AM -0700, Junio C Hamano wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n> \n> > On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:\n> >> Looks like push can't resolve tags to commits.\n> >> Why is that?\n> >>\n> >> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next\n> >\n> > Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,\n> \n> More commonly \"v3.10-rc2^0:vhost-next\", if you are truly pushing it\n> out to a remote repository, but then it invites a puzzlement \"What\n> do you plan to do next after pushing?  The only reason v3.10-rc2 is\n> used is because there is not yet a local branch that will host the\n> vhost-next changes that is built on top of that tag (otherwise you\n> would be pushing that branch to vhost-next)\".\n\nThis was just a bad example.\nThe real reason is this:\n\nI have a development branch, vhost-next. I have a tag there\nlike for_linus for things that are ready to go out.\nI don't always point it at the tip of the branch\nsince I might want to rebase/amend X last commits.\n\nIt's a tag and not a branch since I need to sign the tag.\nI push to a branch and not just the tag since this way\npeople can track it and do downstream development on top.\nSo pushing the tag to branch would save me some churn.\n\n\n> But in this particular case, you are force-pushing into the current\n> repository, and it is spelled much more commonly\n> \n>     git branch -f vhost-next v3.10-rc2\n> \n> I would think.\n"},{"id":"218313","messageId":"7v38tde6mr.fsf@alter.siamese.dyndns.org","threadId":"33906","inReplyTo":"20130523210920.GB31421@redhat.com","subject":"Re: push not resolving commit-ish?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-23T21:19:40Z","receivedAt":"2013-05-23T21:19:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@redhat.com> writes:\n\n> On Thu, May 23, 2013 at 11:05:00AM -0700, Junio C Hamano wrote:\n>> \"Michael S. Tsirkin\" <mst@redhat.com> writes:\n>> \n>> > Looks like push can't resolve tags to commits.\n>> > Why is that?\n>> \n>> How else would you push a tag out?\n>\n> Well my reaction is, it seems to figure out it needs a commit and then\n> instead of just getting it, it errors out.  Why not just DWIM?\n\nAhh, that one.\n\nThe local branch name hierarchy refs/heads/ is special in that you\ncannot have a tag sitting at the tip, so when \"push\" decides to\nupdate something under refs/heads/ on the receiving end, it may not\nbe a bad idea to peel it to a commit (and fail if it does not)\nbefore creating a pack and telling the other end what the value of\nthe updated tip should be, and I do not think it will hurt anybody.\n\nRestriction in the other direction (i.e. \"if push does not go to\nrefs/tags/, unconditionally unwrap\") is a no-no, though.\n"},{"id":"218314","messageId":"7vy5b5crze.fsf@alter.siamese.dyndns.org","threadId":"33906","inReplyTo":"20130523211647.GC31421@redhat.com","subject":"Re: push not resolving commit-ish?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-23T21:21:25Z","receivedAt":"2013-05-23T21:21:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@redhat.com> writes:\n\n> It's a tag and not a branch since I need to sign the tag.\n> I push to a branch and not just the tag since this way\n> people can track it and do downstream development on top.\n> So pushing the tag to branch would save me some churn.\n\nIt seems our messages crossed.\n\nEverything you said before the last sentence makes sense to me, and\nif the last sentence were \"pushing the commit that is tagged to\nbranch\", it also makes sense to me.\n"},{"id":"218315","messageId":"20130523212650.GF31421@redhat.com","threadId":"33906","inReplyTo":"7v38tde6mr.fsf@alter.siamese.dyndns.org","subject":"Re: push not resolving commit-ish?","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-05-23T21:26:50Z","receivedAt":"2013-05-23T21:26:50Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"On Thu, May 23, 2013 at 02:19:40PM -0700, Junio C Hamano wrote:\n> \"Michael S. Tsirkin\" <mst@redhat.com> writes:\n> \n> > On Thu, May 23, 2013 at 11:05:00AM -0700, Junio C Hamano wrote:\n> >> \"Michael S. Tsirkin\" <mst@redhat.com> writes:\n> >> \n> >> > Looks like push can't resolve tags to commits.\n> >> > Why is that?\n> >> \n> >> How else would you push a tag out?\n> >\n> > Well my reaction is, it seems to figure out it needs a commit and then\n> > instead of just getting it, it errors out.  Why not just DWIM?\n> \n> Ahh, that one.\n> \n> The local branch name hierarchy refs/heads/ is special in that you\n> cannot have a tag sitting at the tip, so when \"push\" decides to\n> update something under refs/heads/ on the receiving end, it may not\n> be a bad idea to peel it to a commit (and fail if it does not)\n> before creating a pack and telling the other end what the value of\n> the updated tip should be, and I do not think it will hurt anybody.\n\nYes, that would help my case.\n\n> \n> Restriction in the other direction (i.e. \"if push does not go to\n> refs/tags/, unconditionally unwrap\") is a no-no, though.\n"}]}