From: Junio C Hamano <gitster@pobox•com>
To: git@vger•kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation•org>
Subject: Re: git pull
Date: Mon, 20 Nov 2017 14:37:45 +0900 [thread overview]
Message-ID: <xmqqr2stldcm.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CA+55aFzhK+GPO1_Zm2PoQiq5-cHAq6nz1ejrBhGhWX-KAjTU9A@mail.gmail.com> (Linus Torvalds's message of "Thu, 16 Nov 2017 12:36:08 -0800")
Linus Torvalds <torvalds@linux-foundation•org> writes:
> A few notes for other people who end up doing this:
[this meaning use of insteadOf to redirect public URLs to
ssh://git@gitolite URL]
> (a) ssh is slower, and the gitolite machine is not as reachable.
>
> (b) it affects your merge commit message.
>
> As to (a), yes it's noticeable, but the extra couple of seconds isn't
> really that big of a deal. Depending on exactly where you are, though,
> you might end up wanting to use https:// to the public servers
> instead.
>
> But (b) actually ends up being annoying, because I don't like my merge
> commits to contain references to repositories that aren't actually
> available unless you have a kernel.org account.
> ...
> Which is simple. Just create a .git/hooks/prepare-commit-msg file that contains
>
> #!/bin/sh
> sed -i 's|ssh://gitolite.kernel.org/|git://git.kernel.org/|g' "$1"
>
> and make it executable, and git will do that commit message editing for you.
This should work with any recent versions of Git (1.7.4.2 and
upwards), but it still is a workaround. Should we mark it as a
feature request in the Git land to record the URL you typed as-is in
the builtin/fetch.c::store_updated_refs() function, instead of the
one that was rewritten by the insteadOf mechanism?
It would probably need an update to "struct remote" to have new
fields, to teach remote.c::alias_all_urls() not to overwrite the
url[] (and pushurl[] merely for symmetry) fields, to add a field to
"struct transport" and teach transport.c::transport_get() to record
the original URL in it so that builtin/fetch.c::fetch_refs() can
give it to store_updated_refs() instead of the rewritten one.
Many tiny changes in a rather deep codepath, but feels fairly a safe
change that is isolated and straightforward.
next parent reply other threads:[~2017-11-20 5:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171113231155.GA26779@eros>
[not found] ` <20171114110500.GA21175@kroah.com>
[not found] ` <20171114213320.GB905@eros>
[not found] ` <CA+55aFyMxkS=8JzZ+ROOAFkwR45EKBnQ0GUMQS4f+r_-fFWiEA@mail.gmail.com>
[not found] ` <CA+55aFzhK+GPO1_Zm2PoQiq5-cHAq6nz1ejrBhGhWX-KAjTU9A@mail.gmail.com>
2017-11-20 5:37 ` Junio C Hamano [this message]
2017-11-20 6:04 ` git pull Linus Torvalds
2012-04-12 14:47 GIT pull cvalusek
2012-04-12 15:03 ` Matthieu Moy
2012-04-12 15:07 ` Michael Witten
2012-04-12 16:58 ` Johannes Sixt
2012-04-12 17:29 ` cvalusek
-- strict thread matches above, loose matches on Subject: below --
2010-05-17 21:51 git pull matteo brutti
2010-05-18 16:31 ` Nicolas Sebrecht
2010-05-19 11:03 ` hasen j
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=xmqqr2stldcm.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=torvalds@linux-foundation$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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