From: "Kristian Høgsberg" <krh@redhat.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Johannes Sixt <johannes.sixt@telecom.at>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] builtin-clone: Use is_dir_sep() instead of '/'
Date: Mon, 21 Jul 2008 09:43:17 -0400 [thread overview]
Message-ID: <1216647797.3997.6.camel@gaara.bos.redhat.com> (raw)
In-Reply-To: <alpine.LNX.1.00.0807191333550.19665@iabervon.org>
On Sat, 2008-07-19 at 13:44 -0400, Daniel Barkalow wrote:
> On Sat, 19 Jul 2008, Johannes Sixt wrote:
>
> > On Samstag, 19. Juli 2008, Johannes Sixt wrote:
> > > On Samstag, 19. Juli 2008, Junio C Hamano wrote:
> > > > Ok, but the surrounding code in this function look very suspicious.
> > >
> > > How about this then?
> > >
> > > -- snip --
> > > builtin-clone: Rewrite guess_dir_name()
> > >
> > > The function has to do three small and independent tasks, but all of them
> > > were crammed into a single loop. This rewrites the function entirely by
> > > unrolling these tasks.
> >
> > Sigh. I knew it, I knew it. If it had been that trivial, then Daniel had done
> > it this way in the first place. :-(
> >
> > This needs to be squashed in. It makes sure that we handle 'foo/.git';
> > and .git was not stripped if we cloned from 'foo.git/'.
>
> I actually got that from Johannes Schindelin, who added bundle support to
> my clone patch. I remember looking at his change, thinking it looked
> overly complicated, but finding that anything I tried to do to simplify it
> failed tests. If this gets through the test suite (lots of the tests other
> than the clone test try to do a wider variety of odd things than I expect
> users do in practice most of the time), then it's probably a better
> implementation.
I wrote the original guess_git_dir(), and it *is* pretty subtle, sorry.
I would not rewrite it unless you really have to, since git clone now is
pretty stable and the dir sep separator change doesn't need this kind of
rewrite to fix the issue. That said, with the last couple of changes
from Johannes Sixt, I believe it handles the same case that I had in
mind when I first wrote the loop.
cheers,
Kristian
prev parent reply other threads:[~2008-07-21 13:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 7:34 [PATCH] Windows related patches Johannes Sixt
2008-07-18 7:34 ` [PATCH] Teach lookup_prog not to select directories Johannes Sixt
2008-07-18 7:34 ` [PATCH] builtin-clone: Use is_dir_sep() instead of '/' Johannes Sixt
2008-07-18 7:34 ` [PATCH] Add ANSI control code emulation for the Windows console Johannes Sixt
2008-07-18 7:34 ` [PATCH] Windows: set gitexecdir = $(bindir) Johannes Sixt
2008-07-19 0:32 ` Junio C Hamano
2008-07-19 8:52 ` Johannes Sixt
2008-07-19 17:10 ` Steffen Prohaska
2008-07-19 17:28 ` Junio C Hamano
2008-07-19 19:31 ` Johannes Sixt
2008-07-19 0:32 ` [PATCH] builtin-clone: Use is_dir_sep() instead of '/' Junio C Hamano
2008-07-19 9:32 ` Johannes Sixt
2008-07-19 11:35 ` Johannes Schindelin
2008-07-19 13:49 ` Johannes Sixt
2008-07-19 17:44 ` Daniel Barkalow
2008-07-21 13:43 ` Kristian Høgsberg [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=1216647797.3997.6.camel@gaara.bos.redhat.com \
--to=krh@redhat.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.sixt@telecom.at \
/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).