git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Santi Béjar" <sbejar@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv2] clone: support cloning full bundles
Date: Thu, 28 Feb 2008 00:16:40 +0100	[thread overview]
Message-ID: <8aa486160802271516h7c2c636dna3a9f067fc51da2@mail.gmail.com> (raw)
In-Reply-To: <8aa486160802271504r7744422ag290b1f4d1725210f@mail.gmail.com>

On Thu, Feb 28, 2008 at 12:04 AM, Santi Béjar <sbejar@gmail.com> wrote:
>
> On Wed, Feb 27, 2008 at 11:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
>  > Santi Béjar <sbejar@gmail.com> writes:
>  >
>  >  > Signed-off-by: Santi Béjar <sbejar@gmail.com>
>  >
>  > > diff --git a/git-clone.sh b/git-clone.sh
>  >  > index 0d686c3..2efb947 100755
>  >  > --- a/git-clone.sh
>  >  > +++ b/git-clone.sh
>  >  > @@ -210,11 +210,14 @@ if base=$(get_repo_base "$repo"); then
>  >  >       then
>  >  >               local=yes
>  >  >       fi
>  >  > +elif [ -f "$repo" ] ; then
>  >  > +     case "$repo" in /*);; *) repo="$PWD/$repo" ; esac
>  >  >  fi
>  >  >
>  >  >  dir="$2"
>  >  >  # Try using "humanish" part of source repo if user didn't specify one
>  >  >  [ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*[/:]||g')
>  >  > +[ -f "$dir" ] && dir=$(expr "$repo" : '.*/\([^/]*\)\.[^/]*')
>  >  >  [ -e "$dir" ] && die "destination directory '$dir' already exists."
>  >  >  [ yes = "$bare" ] && unset GIT_WORK_TREE
>  >  >  [ -n "$GIT_WORK_TREE" ] && [ -e "$GIT_WORK_TREE" ] &&
>  >
>  >  What is this [ -f "$dir" ] line doing?  The purpose of these
>  >  lines is:
>  >
>  >   - The user (might have) said "clone to $2";
>  >
>  >   - If the user didn't, then set dir to humanish part;
>  >
>  >   - If that exists, we barf.
>  >
>  >  I do not see any valid reason for an additional logic in this
>  >  sequence when adding a new clone _source_ type.
>  >
>  >  The check to see if "$dir" _exists_ is even worse.  If the user
>  >  said "clone _to_ this", then we would not have invented $dir
>  >  based on the $repo (which is what the user said "clone _from_")
>  >  but used whatever name the user has given us.  The existing
>  >  check to barf "Hey, that explicit location you told me to clone
>  >  to is WRONG!!!" should not be broken.
>  >
>
>  Oops, I did not thought about that possibility. The check was to be
>  able to clone a bundle that was in the local directory. So:
>
>  $ git clone git.bundle
>
>  clones git.bundle to the directory git. Maybe we can add an && in the
>  previous line

and check for [ -f "$repo" ] insted of [ -f "$dir" ]

>  , or we can say simply that to clone a bundle in the same
>  directory you have to specify explicitly where to clone.
>
>  In another patch we could add an "official" extension to the bundles
>  (the same way as with the repositories "*.git") as project.bdl or
>  project.bundle and just remove this extension.

My preference are in order:

1) define an official extension + the && [ -f "$repo" ]
2) the && [ -f "$repo"]
3) just remove this line

but not that strong.

Santi

  reply	other threads:[~2008-02-27 23:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 10:12 [PATCHv2] clone: support cloning full bundles Santi Béjar
2008-02-25 19:30 ` Junio C Hamano
2008-02-25 20:29   ` Santi Béjar
2008-02-25 21:00     ` Junio C Hamano
2008-02-27 22:44 ` Junio C Hamano
2008-02-27 23:04   ` Santi Béjar
2008-02-27 23:16     ` Santi Béjar [this message]
2008-02-27 23:48       ` Daniel Barkalow
2008-02-28  0:19       ` Junio C Hamano
2008-02-28  0:26         ` Johannes Schindelin
2008-02-28  0:32           ` Santi Béjar
2008-02-29  4:27           ` Mark Levedahl
  -- strict thread matches above, loose matches on Subject: below --
2008-02-28  2:22 [PATCHv3] " Santi Béjar
2008-02-29 19:16 ` [PATCHv2] " Santi Béjar

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8aa486160802271516h7c2c636dna3a9f067fc51da2@mail.gmail.com \
    --to=sbejar@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).