[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c9ce55c-2c3a-fce0-d6e3-dfe5f8fc9b01@redhat.com>
Date: Mon, 27 May 2019 14:33:10 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Ævar Arnfjörð Bjarmason <avarab@...il.com>,
git@...r.kernel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Junio C Hamano <gitster@...ox.com>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
Radim Krčmář <rkrcmar@...hat.com>,
KVM list <kvm@...r.kernel.org>,
Michael Haggerty <mhagger@...m.mit.edu>
Subject: Re: [RFC/PATCH] refs: tone down the dwimmery in refname_match() for
{heads,tags,remotes}/*
On 27/05/19 00:54, Ævar Arnfjörð Bjarmason wrote:
> This resulted in a case[1] where someone on LKML did:
>
> git push kvm +HEAD:tags/for-linus
>
> Which would have created a new "tags/for-linus" branch in their "kvm"
> repository, except because they happened to have an existing
> "refs/tags/for-linus" reference we pushed there instead, and replaced
> an annotated tag with a lightweight tag.
Actually, I would not be surprised even if "git push foo
someref:tags/foo" _always_ created a lightweight tag (i.e. push to
refs/tags/foo).
In my opinion, the bug is that "git request-pull" should warn if the tag
is lightweight remotely but not locally, and possibly even vice versa.
Here is a simple testcase:
# setup "local" repo
mkdir -p testdir/a
cd testdir/a
git init
echo a > test
git add test
git commit -minitial
# setup "remote" repo
git clone --bare . ../b
# setup "local" tag
echo b >> test
git commit -msecond test
git tag -mtag tag1
# create remote lightweight tag and prepare a pull request
git push ../b HEAD:refs/tags/tag1
git request-pull HEAD^ ../b tags/tag1
Paolo
Powered by blists - more mailing lists