Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp845994ybi; Fri, 21 Jun 2019 09:07:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNdiSPwpqKTNOL2GBR4a08bUdNXUfHzSkLfsrlhxd2EhIZHpc+qMy/kg56+Tmyzvdosn+p X-Received: by 2002:a17:90a:634a:: with SMTP id v10mr5367848pjs.16.1561133241221; Fri, 21 Jun 2019 09:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561133241; cv=none; d=google.com; s=arc-20160816; b=DuflvHvKK2W/rNvjXuMn+y8asP8euoLzlUY7tJ7zVWOGZx5vaW/5Msp3XDOYGyIPrp RQ9/PrCMBnPHV4tKlGc9gEEgUHWh3yh7tfa7f09pxGmWMhRicDrVbehTr7H5L44kkwMP edPNLuLAWv0SHFpERxQkYuPF6IX6jlUjJsnGzELW68ORvyKsIkffRQfb1Kl7J+coZviZ tGzh6PKnaxojAeNNxjWNTw400a/39qGFjgI/KDZu1lJODEsdJAzbcNRPo/l5Tjf/drgs xuPZRw7CgH5H1Cf7nhSmtA7DcSG0AJTymC86S3CMQNLpgN2LnUrj5BBrmnQaSNjA3eu/ tOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:domainkey-signature:dkim-signature; bh=iTsDmUN7Uh3gBr6wtXdQhYbRhsGhbM5dJqly/VC9ums=; b=jYLgOIiYOPUnIyuotsX7o85EFHECfXMwGPtSl8UpCByfK+PW2+VIzdBc8TQZdm5v72 3R2gkUJwSFgZ/jlEpCT8ar51l//WsWOb9Lp0bLLtp2s1/NRCud4bDLk5k3JOy4HY4xkY tTln0mDLPiV/MICXVzPqLMZWRvPUBOHuJHZD64hmJJ6Sc+1CsUNqtaFuFRtuFbVJjOVo wExu/w2x6B2LDADTtHWsu4X6YAMZww/8sRLIxr+0ystD3IZ4Mx2Y5ti23ee4via2UKZ1 7WHQP6RyRX+6EL60+MKoqJUfIEf2yUg1lPWpRnT1726D4rN7jKBbVaMVlRyQeb6g+QQB SQkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=kbuntiSj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=pobox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16si2833059plo.211.2019.06.21.09.07.03; Fri, 21 Jun 2019 09:07:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=kbuntiSj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=pobox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbfFUQFh (ORCPT + 99 others); Fri, 21 Jun 2019 12:05:37 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:57962 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbfFUQFh (ORCPT ); Fri, 21 Jun 2019 12:05:37 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id C1AE668F5F; Fri, 21 Jun 2019 12:05:32 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=kXZMJjy8G0Oh j2TWekaQYV5QspM=; b=kbuntiSjMqAQv2SA03mNSl5CkJ+b+JKJbAN5wf6H1Zo7 lwePC9R9XrS1U5Kq0kwQt0oviy7LWvY2SIVeFg5sg5DktFmgj+2PHJvJEA91lPAZ iyYE40UZSibBthdGoSmhekIBs9c+16IK7ThLyqceXXAjbOchBBCouW1eA5HLYsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=mSzYn6 y+RpQJcxmaO2rRYEzXVlWDo00eUCX6vckAbnNJoCZYIENQrg+ry5F1ewv1Q9pzaP lqXETjUxW4NIMdvBnHWWI9b3Un8LJJZrtyKufZeLonfAxSargJuZdWTLal9BJjXc swdYH00eLjE0YaLmK/gJRMA+QwAzo2J+An/MI= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id B747168F5E; Fri, 21 Jun 2019 12:05:32 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.76.80.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id A406468F5C; Fri, 21 Jun 2019 12:05:28 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Linus Torvalds , Paolo Bonzini , Linux List Kernel Mailing , Radim =?utf-8?B?S3LEjW3DocWZ?= , KVM list Subject: Re: [PATCH] push: make "HEAD:tags/my-tag" consistently push to a branch References: <20190526225445.21618-1-avarab@gmail.com> <20190621144447.21769-1-avarab@gmail.com> Date: Fri, 21 Jun 2019 09:05:26 -0700 In-Reply-To: <20190621144447.21769-1-avarab@gmail.com> (=?utf-8?B?IsOGdmFy?= =?utf-8?B?IEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Fri, 21 Jun 2019 16:44:47 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 6354856E-943E-11E9-BC01-B0405B776F7B-77302942!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > This resulted in a case[1] where someone on LKML did: > > git push kvm +HEAD:tags/for-linus > > Which would have created a new "refs/heads/tags/for-linus" branch in > their "kvm" repository. But since they happened to have an existing > "refs/tags/for-linus" reference we pushed there instead, and replaced > an annotated tag with a lightweight tag. I do not think that is a problematic behaviour in the context of asking Linus to pull when every time a merge window opens. One would keep refs/tags/for-linus at the publishing site, and update it (forcing as necessary) before request-pull. If it went to a branch with confusing name tags/for-linus, that would be a disaster. > Now we'll print out the following advice when this happens, and act > differently as described therein: > > hint: The part of the refspec matched both of: > hint: > hint: 1. tags/my-tag -> refs/tags/my-tag > hint: 2. tags/my-tag -> refs/heads/tags/my-tag > hint: > hint: Earlier versions of git would have picked (1) as the RHS star= ts > hint: with a second-level ref prefix which could be fully-qualified= by > hint: adding 'refs/' in front of it. We now pick (2) which uses the= prefix > hint: inferred from the part of the refspec. > hint: > hint: See the "..." rules discussed in 'git help push'. "matched" in past tense means that your example scenario actually has such a confusing branch? Then I think the above is OK (or just silently updating the branch is also fine, I think). If there were no such branch currently, the above woudl be a serious regression, but as long as both exist, I think it is probably OK. From my quick scan of your new tests, I couldn't quite tell if that case (i.e. the a tag "my-tag" exists but a bbranch "tags/my-tag"does not exist at the receiving end when push happens, and the tag is updated without touching the branch nor giving extra warnings and hints) is covered, though. Thanks.