Re: [RFC/PATCH] refs: tone down the dwimmery in refname_match() for {heads,tags,remotes}/*
- From
Paolo Bonzini <pbonzini@redhat.com>
- Date
- May 27, 2019, 12:33 UTC
- Message-ID
- <5c9ce55c-2c3a-fce0-d6e3-dfe5f8fc9b01@redhat.com>
- In-Reply-To
- <20190526225445.21618-1-avarab@gmail.com>
On 27/05/19 00:54, Ævar Arnfjörð Bjarmason wrote:
Show 8 quoted lines
> 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