All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David ‘Bombe’ Roden" <bombe@pterodactylus.net>
To: git@vger.kernel.org
Subject: Re: [PATCH] handle http urls with query string ("?foo") correctly
Date: Thu, 5 Jun 2008 10:29:16 +0200	[thread overview]
Message-ID: <200806051029.22580.bombe@pterodactylus.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0806050758210.21190@racer>

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

On Thursday 05 June 2008 09:15:01 Johannes Schindelin wrote:

> And of course, you usually sign off your patches.

As soon as there are no more objections, I will. :)


> How about
>
> 	strbuf_addf(&suffix_buffer, "/objects/%c%c/%s",
> 		hex[0], hex[1], hex + 2);
>
> ?

Now that you mention it... ;) Changed.


> And this line wrapped, like so?
>
> 	url = transform_url(obj_req->repo->base,
> 		strbuf_detach(&suffix_buffer, NULL));

I usually don't do line-wrapping because all my terminals are wide enough but 
I might just make an exception here. :)


> Oh, but maybe it makes more sense to let transform_url() work on the
> strbuf itself?

Then I would have to rewrite more unrelated stuff because everything else in 
those files still relies on char*. I'd rather not meddle with that for now; I 
agree that at some point it should all be rewritten to use strbuf (more or 
less) exclusively. :)


> Junio usually prefers assignments outside of the if() statement.

Can do.


> But another thing is more pressing: obviously, there were reasons to quote
> the ref names with this funny URL encoding (%45%75%6E%6E%79), and you
> effectively undid that change.

Hmm, yes. Ref names should probably be url-escaped.


> > +#include <stddef.h>
> Why?

For ptrdiff_t. Yes, I know that the offset between the start of a URL and the 
question mark will never really exceed the 32-bit range and it's also highly 
unlikely that the two pointers in comparison differ in the upper 32 bits but 
as I'm actually calculating the difference between two pointers ptrdiff_t was 
the logical choice over int.


> Dscho

	David

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      parent reply	other threads:[~2008-06-05  8:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04 23:28 [PATCH] handle http urls with query string ("?foo") correctly David ‘Bombe’ Roden
2008-06-05  0:12 ` Johannes Schindelin
2008-06-05  6:48   ` David ‘Bombe’ Roden
2008-06-05  7:15     ` Johannes Schindelin
2008-06-05  7:57       ` Junio C Hamano
2008-06-05  8:37         ` David ‘Bombe’ Roden
2008-06-05 12:14         ` David ‘Bombe’ Roden
2008-06-05  8:29       ` David ‘Bombe’ Roden [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=200806051029.22580.bombe@pterodactylus.net \
    --to=bombe@pterodactylus.net \
    --cc=git@vger.kernel.org \
    /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.