Re: [PATCH v3 7/8] push: add DWYM support for "git push refs/remotes/...:<dst>"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2018, 05:24 UTC
- Message-ID
- <xmqqlg6h4964.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20181026230741.23321-8-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Add DWYM support for pushing a ref in refs/remotes/* when the <dst>
I think most people call it do-what-*I*-mean, not do-what-you-mean.
Show 10 quoted lines
> ref is unqualified. Now instead of erroring out we support e.g.:
>
> $ ./git-push avar refs/remotes/origin/master:upstream-master -n
> To github.com:avar/git.git
> * [new branch] origin/master -> upstream-master
>
> Before this we wouldn't know what do do with
> refs/remotes/origin/master, now we'll look it up and discover that
> it's a commit (or tag) and add a refs/{heads,tags}/ prefix to <dst> as
> appropriate.I am not sure if this is a good change, as I already hinted earlier. If I were doing "git push" to any of my publishing places, I would be irritated if "refs/remotes/ko/master:something" created a local "something" branch at the desitnation, instead of erroring out.
On the other hand, I do not think I mind all that much if a src that is a tag object to automatically go to refs/tags/ (having a tag object in refs/remotes/** is rare enough to matter in the first place).