git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* push not resolving commit-ish?
@ 2013-05-23 10:53 Michael S. Tsirkin
  2013-05-23 10:56 ` Michael S. Tsirkin
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Michael S. Tsirkin @ 2013-05-23 10:53 UTC (permalink / raw)
  To: git

Looks like push can't resolve tags to commits.
Why is that?

linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next
error: Trying to write non-commit object
a8c6d53c4d84b3a5eb182758a9cdceceba4691da to branch refs/heads/vhost-next
To /scm/linux
 ! [remote rejected] v3.10-rc2 -> vhost-next (failed to write)
error: failed to push some refs to '/scm/linux'

linux$ git log v3.10-rc2|head -5
commit c7788792a5e7b0d5d7f96d0766b4cb6112d47d75
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon May 20 14:37:38 2013 -0700

    Linux 3.10-rc2


linux$ $ git push -f $PWD
c7788792a5e7b0d5d7f96d0766b4cb6112d47d75:refs/heads/vhost-next
Everything up-to-date

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 10:53 push not resolving commit-ish? Michael S. Tsirkin
@ 2013-05-23 10:56 ` Michael S. Tsirkin
  2013-05-23 10:56 ` Felipe Contreras
  2013-05-23 18:05 ` Junio C Hamano
  2 siblings, 0 replies; 12+ messages in thread
From: Michael S. Tsirkin @ 2013-05-23 10:56 UTC (permalink / raw)
  To: git

On Thu, May 23, 2013 at 01:53:10PM +0300, Michael S. Tsirkin wrote:
> Looks like push can't resolve tags to commits.
> Why is that?
> 
> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next
> error: Trying to write non-commit object
> a8c6d53c4d84b3a5eb182758a9cdceceba4691da to branch refs/heads/vhost-next
> To /scm/linux
>  ! [remote rejected] v3.10-rc2 -> vhost-next (failed to write)
> error: failed to push some refs to '/scm/linux'
> 
> linux$ git log v3.10-rc2|head -5
> commit c7788792a5e7b0d5d7f96d0766b4cb6112d47d75
> Author: Linus Torvalds <torvalds@linux-foundation.org>
> Date:   Mon May 20 14:37:38 2013 -0700
> 
>     Linux 3.10-rc2
> 
> 
> linux$ $ git push -f $PWD
> c7788792a5e7b0d5d7f96d0766b4cb6112d47d75:refs/heads/vhost-next
> Everything up-to-date
> 
> 

Forgot to say - this is recent git.git master:

1.8.3.rc3.8.g5e49f30

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 10:53 push not resolving commit-ish? Michael S. Tsirkin
  2013-05-23 10:56 ` Michael S. Tsirkin
@ 2013-05-23 10:56 ` Felipe Contreras
  2013-05-23 18:10   ` Junio C Hamano
  2013-05-23 18:05 ` Junio C Hamano
  2 siblings, 1 reply; 12+ messages in thread
From: Felipe Contreras @ 2013-05-23 10:56 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: git

On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> Looks like push can't resolve tags to commits.
> Why is that?
>
> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next

Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,
I already complained about it to no avail.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 10:53 push not resolving commit-ish? Michael S. Tsirkin
  2013-05-23 10:56 ` Michael S. Tsirkin
  2013-05-23 10:56 ` Felipe Contreras
@ 2013-05-23 18:05 ` Junio C Hamano
  2013-05-23 21:09   ` Michael S. Tsirkin
  2 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2013-05-23 18:05 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: git

"Michael S. Tsirkin" <mst@redhat.com> writes:

> Looks like push can't resolve tags to commits.
> Why is that?

How else would you push a tag out?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 10:56 ` Felipe Contreras
@ 2013-05-23 18:10   ` Junio C Hamano
  2013-05-23 21:05     ` Michael S. Tsirkin
  2013-05-23 21:16     ` Michael S. Tsirkin
  0 siblings, 2 replies; 12+ messages in thread
From: Junio C Hamano @ 2013-05-23 18:10 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Michael S. Tsirkin, git

Felipe Contreras <felipe.contreras@gmail.com> writes:

> On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> Looks like push can't resolve tags to commits.
>> Why is that?
>>
>> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next
>
> Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,

More commonly "v3.10-rc2^0:vhost-next", if you are truly pushing it
out to a remote repository, but then it invites a puzzlement "What
do you plan to do next after pushing?  The only reason v3.10-rc2 is
used is because there is not yet a local branch that will host the
vhost-next changes that is built on top of that tag (otherwise you
would be pushing that branch to vhost-next)".

But in this particular case, you are force-pushing into the current
repository, and it is spelled much more commonly

    git branch -f vhost-next v3.10-rc2

I would think.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 18:10   ` Junio C Hamano
@ 2013-05-23 21:05     ` Michael S. Tsirkin
  2013-05-23 21:06       ` Junio C Hamano
  2013-05-23 21:16     ` Michael S. Tsirkin
  1 sibling, 1 reply; 12+ messages in thread
From: Michael S. Tsirkin @ 2013-05-23 21:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Felipe Contreras, git

On Thu, May 23, 2013 at 11:10:32AM -0700, Junio C Hamano wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >> Looks like push can't resolve tags to commits.
> >> Why is that?
> >>
> >> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next
> >
> > Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,
> 
> More commonly "v3.10-rc2^0:vhost-next", if you are truly pushing it
> out to a remote repository, but then it invites a puzzlement "What
> do you plan to do next after pushing?  The only reason v3.10-rc2 is
> used is because there is not yet a local branch that will host the
> vhost-next changes that is built on top of that tag (otherwise you
> would be pushing that branch to vhost-next)".
> 
> But in this particular case, you are force-pushing into the current
> repository, and it is spelled much more commonly
> 
>     git branch -f vhost-next v3.10-rc2
> 
> I would think.

That was just a bad example though, I really use it for
push to remove.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 21:05     ` Michael S. Tsirkin
@ 2013-05-23 21:06       ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2013-05-23 21:06 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Felipe Contreras, git

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Thu, May 23, 2013 at 11:10:32AM -0700, Junio C Hamano wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>> 
>> > On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> >> Looks like push can't resolve tags to commits.
>> >> Why is that?
>> >>
>> >> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next
>> >
>> > Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,
>> 
>> More commonly "v3.10-rc2^0:vhost-next", if you are truly pushing it
>> out to a remote repository, but then it invites a puzzlement "What
>> do you plan to do next after pushing?  The only reason v3.10-rc2 is
>> used is because there is not yet a local branch that will host the
>> vhost-next changes that is built on top of that tag (otherwise you
>> would be pushing that branch to vhost-next)".
>> 
>> But in this particular case, you are force-pushing into the current
>> repository, and it is spelled much more commonly
>> 
>>     git branch -f vhost-next v3.10-rc2
>> 
>> I would think.
>
> That was just a bad example though, I really use it for
> push to remove.

Then it invites a puzzlement as you can see above.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 18:05 ` Junio C Hamano
@ 2013-05-23 21:09   ` Michael S. Tsirkin
  2013-05-23 21:19     ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Michael S. Tsirkin @ 2013-05-23 21:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Thu, May 23, 2013 at 11:05:00AM -0700, Junio C Hamano wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > Looks like push can't resolve tags to commits.
> > Why is that?
> 
> How else would you push a tag out?

Well my reaction is, it seems to figure out it needs a commit and then
instead of just getting it, it errors out.  Why not just DWIM?

But at least I see the reason now, thanks.
-- 
MST

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 18:10   ` Junio C Hamano
  2013-05-23 21:05     ` Michael S. Tsirkin
@ 2013-05-23 21:16     ` Michael S. Tsirkin
  2013-05-23 21:21       ` Junio C Hamano
  1 sibling, 1 reply; 12+ messages in thread
From: Michael S. Tsirkin @ 2013-05-23 21:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Felipe Contreras, git

On Thu, May 23, 2013 at 11:10:32AM -0700, Junio C Hamano wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > On Thu, May 23, 2013 at 5:53 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >> Looks like push can't resolve tags to commits.
> >> Why is that?
> >>
> >> linux$ git push -f $PWD v3.10-rc2:refs/heads/vhost-next
> >
> > Perhaps v3.10-rc2^{}. Yeah, totally and completely not-user-friendly,
> 
> More commonly "v3.10-rc2^0:vhost-next", if you are truly pushing it
> out to a remote repository, but then it invites a puzzlement "What
> do you plan to do next after pushing?  The only reason v3.10-rc2 is
> used is because there is not yet a local branch that will host the
> vhost-next changes that is built on top of that tag (otherwise you
> would be pushing that branch to vhost-next)".

This was just a bad example.
The real reason is this:

I have a development branch, vhost-next. I have a tag there
like for_linus for things that are ready to go out.
I don't always point it at the tip of the branch
since I might want to rebase/amend X last commits.

It's a tag and not a branch since I need to sign the tag.
I push to a branch and not just the tag since this way
people can track it and do downstream development on top.
So pushing the tag to branch would save me some churn.


> But in this particular case, you are force-pushing into the current
> repository, and it is spelled much more commonly
> 
>     git branch -f vhost-next v3.10-rc2
> 
> I would think.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 21:09   ` Michael S. Tsirkin
@ 2013-05-23 21:19     ` Junio C Hamano
  2013-05-23 21:26       ` Michael S. Tsirkin
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2013-05-23 21:19 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: git

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Thu, May 23, 2013 at 11:05:00AM -0700, Junio C Hamano wrote:
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>> 
>> > Looks like push can't resolve tags to commits.
>> > Why is that?
>> 
>> How else would you push a tag out?
>
> Well my reaction is, it seems to figure out it needs a commit and then
> instead of just getting it, it errors out.  Why not just DWIM?

Ahh, that one.

The local branch name hierarchy refs/heads/ is special in that you
cannot have a tag sitting at the tip, so when "push" decides to
update something under refs/heads/ on the receiving end, it may not
be a bad idea to peel it to a commit (and fail if it does not)
before creating a pack and telling the other end what the value of
the updated tip should be, and I do not think it will hurt anybody.

Restriction in the other direction (i.e. "if push does not go to
refs/tags/, unconditionally unwrap") is a no-no, though.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 21:16     ` Michael S. Tsirkin
@ 2013-05-23 21:21       ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2013-05-23 21:21 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Felipe Contreras, git

"Michael S. Tsirkin" <mst@redhat.com> writes:

> It's a tag and not a branch since I need to sign the tag.
> I push to a branch and not just the tag since this way
> people can track it and do downstream development on top.
> So pushing the tag to branch would save me some churn.

It seems our messages crossed.

Everything you said before the last sentence makes sense to me, and
if the last sentence were "pushing the commit that is tagged to
branch", it also makes sense to me.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: push not resolving commit-ish?
  2013-05-23 21:19     ` Junio C Hamano
@ 2013-05-23 21:26       ` Michael S. Tsirkin
  0 siblings, 0 replies; 12+ messages in thread
From: Michael S. Tsirkin @ 2013-05-23 21:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Thu, May 23, 2013 at 02:19:40PM -0700, Junio C Hamano wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > On Thu, May 23, 2013 at 11:05:00AM -0700, Junio C Hamano wrote:
> >> "Michael S. Tsirkin" <mst@redhat.com> writes:
> >> 
> >> > Looks like push can't resolve tags to commits.
> >> > Why is that?
> >> 
> >> How else would you push a tag out?
> >
> > Well my reaction is, it seems to figure out it needs a commit and then
> > instead of just getting it, it errors out.  Why not just DWIM?
> 
> Ahh, that one.
> 
> The local branch name hierarchy refs/heads/ is special in that you
> cannot have a tag sitting at the tip, so when "push" decides to
> update something under refs/heads/ on the receiving end, it may not
> be a bad idea to peel it to a commit (and fail if it does not)
> before creating a pack and telling the other end what the value of
> the updated tip should be, and I do not think it will hurt anybody.

Yes, that would help my case.

> 
> Restriction in the other direction (i.e. "if push does not go to
> refs/tags/, unconditionally unwrap") is a no-no, though.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-05-23 21:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 10:53 push not resolving commit-ish? Michael S. Tsirkin
2013-05-23 10:56 ` Michael S. Tsirkin
2013-05-23 10:56 ` Felipe Contreras
2013-05-23 18:10   ` Junio C Hamano
2013-05-23 21:05     ` Michael S. Tsirkin
2013-05-23 21:06       ` Junio C Hamano
2013-05-23 21:16     ` Michael S. Tsirkin
2013-05-23 21:21       ` Junio C Hamano
2013-05-23 18:05 ` Junio C Hamano
2013-05-23 21:09   ` Michael S. Tsirkin
2013-05-23 21:19     ` Junio C Hamano
2013-05-23 21:26       ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).