From: Tay Ray Chuan <rctay89@gmail.com>
To: Thomas Schlichter <thomas.schlichter@web.de>
Cc: Junio C Hamano <gitster@pobox.com>,
willievu <willievu@dev.java.net>,
Sean Davis <sdavis2@mail.nih.gov>,
git@vger.kernel.org
Subject: Re: git http-push and MKCOL error (22/409)
Date: Mon, 17 Aug 2009 17:09:43 +0800 [thread overview]
Message-ID: <20090817170943.180dbedd.rctay89@gmail.com> (raw)
In-Reply-To: <200908170725.09592.thomas.schlichter@web.de>
Hi,
On Mon, Aug 17, 2009 at 1:25 PM, Thomas Schlichter<thomas.schlichter@web.de> wrote:
> Hmm. I hope you won't take this as an argument for not fixing it, because it
> is a clear regression! I tried git version 1.6.3.4, and it works flawlessly
> with exactly this server! Even during bisecting, some versions worked, some
> didn't (these after the mentioned commit...)
>
> So I think this commit didn't only refactor things, but unintentionally
> changed the behavior. And this must be the problem. As I'm not into this code,
> and the refactoring was not completely trivial, I was not able to quickly find
> the place where the behavior was changed...
Thomas, indeed you're right about this, the commit you noted in your
earlier email (5424bc5) was indeed at fault.
The commit changed how urls was handled, and resulted (incorrectly) in
an extra slash being added to the url. In other words, urls now look
like this:
http://server/repo.git//objects/2a/
This problem occurs only in http-push.c, because repo urls
(http://server/repo.git) are always made to end with a slash there.
Btw, on my Apache 2.2.x server, this didn't crop up when I tested,
while Thomas worked with a 2.0.x.
I've attached a patch below that hopefully fixes it.
-- >8 --
Subject: [PATCH] http.c: don't assume that urls don't end with slash
Make append_remote_object_url() (and by implication,
get_remote_object_url) use end_url_with_slash() to ensure that the url
ends with a slash.
Previously, they assumed that the url did not end with a slash and
as a result appended a slash, sometimes errorneously.
This fixes an issue introduced in 5424bc5 ("http*: add helper methods
for fetching objects (loose)"), where the append_remote_object_url()
implementation in http-push.c, which assumed that urls end with a
slash, was replaced by another one in http.c, which assumed urls did
not end with a slash.
The above issue was raised by Thomas Schlichter:
http://marc.info/?l=git&m=125043105231327
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
http.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/http.c b/http.c
index 14d5357..eb0c669 100644
--- a/http.c
+++ b/http.c
@@ -719,7 +719,9 @@ void append_remote_object_url(struct strbuf *buf, const char *url,
const char *hex,
int only_two_digit_prefix)
{
- strbuf_addf(buf, "%s/objects/%.*s/", url, 2, hex);
+ end_url_with_slash(buf, url);
+
+ strbuf_addf(buf, "objects/%.*s/", 2, hex);
if (!only_two_digit_prefix)
strbuf_addf(buf, "%s", hex+2);
}
--
1.6.4.dirty
next prev parent reply other threads:[~2009-08-17 9:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 13:57 git http-push and MKCOL error (22/409) Thomas Schlichter
2009-08-16 14:27 ` Tay Ray Chuan
2009-08-16 14:52 ` Thomas Schlichter
2009-08-17 4:52 ` Tay Ray Chuan
2009-08-17 5:18 ` Thomas Schlichter
2009-08-17 5:34 ` Thomas Schlichter
2009-08-16 19:34 ` Junio C Hamano
2009-08-17 4:58 ` Tay Ray Chuan
2009-08-17 5:25 ` Thomas Schlichter
2009-08-17 6:08 ` Junio C Hamano
2009-08-17 9:09 ` Tay Ray Chuan [this message]
2009-08-17 17:28 ` Thomas Schlichter
-- strict thread matches above, loose matches on Subject: below --
2008-09-22 23:51 Sean Davis
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=20090817170943.180dbedd.rctay89@gmail.com \
--to=rctay89@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sdavis2@mail.nih.gov \
--cc=thomas.schlichter@web.de \
--cc=willievu@dev.java.net \
/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).