From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alexander Duytschaever <Alexander.Duytschaever@UGent.be>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: rename a remote does not update pushdefault (v1.9.5)
Date: Mon, 30 Mar 2015 23:52:56 -0400 [thread overview]
Message-ID: <20150331035256.GA1408@peff.net> (raw)
In-Reply-To: <xmqq384mxoka.fsf@gitster.dls.corp.google.com>
On Mon, Mar 30, 2015 at 12:39:17PM -0700, Junio C Hamano wrote:
> Whichever way you implement "remote rename", you will make half of
> the users happy while making other half unhappy. One use case will
> be happier if remote.pushdefault is left intact; the other use case
> will be happier if remote.pushdefault is updated. There are two
> sides to this coin.
>
> I think the implementation took the most straight-forward path to
> say "we rename everything inside remote.C.* section and adjust the
> refspecs for remote-tracking branches because that is what appear in
> that section"; which allows the first use case and the second use
> case would be just a single "git config remote.pushDefault C" away.
I had a similar thought. But note that we do update "branch.*.remote"
that points to the renamed remote. So it seems inconsistent that we do
not similarly update "branch.*.pushremote". And if we update that, it
seems inconsistent that we do not update "remote.pushdefault".
In other words, we should probably choose to update all references or
none, but we are currently somewhere in between. Of course, the fact
that the code has been in this limbo for so long makes it doubly
awkward, as we do not know what people expect (and what they simply
consider a bug).
So I don't know what the right answer is.
I did take a peek at the code. I don't think updating these variables
would be too hard, but there needs to be some refactoring around
remote.c's pushremote_name. After calling read_config(), we do not have
a value that exactly corresponds to remote.pushdefault; we overwrite it
with the branch-specific pushremote if there is one.
-Peff
prev parent reply other threads:[~2015-03-31 3:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 9:28 rename a remote does not update pushdefault (v1.9.5) Alexander Duytschaever
2015-03-30 19:39 ` Junio C Hamano
2015-03-31 3:52 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150331035256.GA1408@peff.net \
--to=peff@peff.net \
--cc=Alexander.Duytschaever@UGent.be \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).