From: Tom Miller <jackerran@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] fetch: Print full url in header
Date: Thu, 9 Jan 2014 21:03:54 -0600 [thread overview]
Message-ID: <20140110030354.GA19887@gmail.com> (raw)
In-Reply-To: <xmqqwqi8aph1.fsf@gitster.dls.corp.google.com>
On Thu, Jan 09, 2014 at 12:07:38PM -0800, Junio C Hamano wrote:
>
> Having said all that, the difference between the full URL shown by
> "remote --verbose" (which is used to interact with the remote in
> this repository) and the abbreviated URL (which is shown by "fetch"
> and is designed to be sharable with others with a simple cut&paste)
> matters only when there are a pair of ambiguously configured
> repositories (e.g. there are two repositories "git://host/a.git/"
> and "git://host/a/.git") that serve different things and you are
> debugging the situation. And to me, "remote --verbose" looks more
> or less a debugging aid, nothing more. So another alternative that
> may be to leave everything as-is.
>
> Thanks.
I like the alterantive option of "leave everything as-is", especially
after the arguments you've presented. There is still the problem of the
logic that has been duplicated. I think it should be put in a function,
but if you are ok with leaving it duplicated that is fine by me.
if (raw_url)
url = transport_anonymize_url(raw_url);
else
url = xstrdup("foreign");
url_len = strlen(url);
for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
;
url_len = i + 1;
if (4 < i && !strncmp(".git", url + i - 3, 4))
url_len = i - 3;
Thanks,
Tom Miller
prev parent reply other threads:[~2014-01-10 3:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 2:39 [PATCH] fetch: Print full url in header Tom Miller
2014-01-09 20:07 ` Junio C Hamano
2014-01-10 3:03 ` Tom Miller [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=20140110030354.GA19887@gmail.com \
--to=jackerran@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.