git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Santi Béjar" <sbejar@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv3] clone: support cloning full bundles
Date: Thu, 28 Feb 2008 09:57:23 -0800	[thread overview]
Message-ID: <7vmyplj75o.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1204165372-12175-1-git-send-email-sbejar@gmail.com

Santi Béjar <sbejar@gmail.com> writes:

> diff --git a/git-clone.sh b/git-clone.sh
> index 0d686c3..0580b5a 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')
> +[ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*[/:]||g') &&
> +[ -f "$repo" ] && dir=$(echo "$repo" | sed -e 's|/*\.bundle$||' -e 's|.*/||g')
>  [ -e "$dir" ] && die "destination directory '$dir' already exists."
>  [ yes = "$bare" ] && unset GIT_WORK_TREE
>  [ -n "$GIT_WORK_TREE" ] && [ -e "$GIT_WORK_TREE" ] &&

This sequence was terse, to the point and very readable when the
logic was simpler, but now it is getting out of hand.  I think
it is a time for rewriting to something more verbose, like...

	# Decide the directory name of the new repository
        if test -n "$2"
        then
        	dir="$2"
	else
        	# Derive one from the repository name
                if test -f "$repo"
                then
                        # Cloning from a bundle
                        dir=... humanish ...
                else
                        dir=... humanish ...
                fi
        fi


  reply	other threads:[~2008-02-28 17:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28  2:22 [PATCHv3] clone: support cloning full bundles Santi Béjar
2008-02-28 17:57 ` Junio C Hamano [this message]
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=7vmyplj75o.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sbejar@gmail.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).