git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] git clone: is an URL local or ssh

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 27, 2013, 18:31 UTC
Message-ID
<CAPig+cTCesnmj1z2H1ZkXAcRqZKQu-NLeLxfCYPYUZe45aadtQ@mail.gmail.com>
In-Reply-To
<201310262103.35770.tboegi@web.de>
On Saturday, October 26, 2013, Torsten Bögershausen wrote:
Show 10 quoted lines
> diff --git a/connect.c b/connect.c
> index 06e88b0..903063e 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -564,9 +574,9 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
>         char *url;
>         char *host, *path;
>         char *end;
> -       int c;
> +       int seperator;
s/seperator/separator/g
Show 20 quoted lines
>         struct child_process *conn = &no_fork;
> -       enum protocol protocol = PROTO_LOCAL;
> +       enum protocol protocol = PROTO_LOCAL_OR_SSH;
>         int free_path = 0;
>         char *port = NULL;
>         const char **arg;
> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index 1d1c875..69af007 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -294,39 +294,93 @@ test_expect_success 'setup ssh wrapper' '
>         export TRASH_DIRECTORY
>  '
>
> -clear_ssh () {
> -       >"$TRASH_DIRECTORY/ssh-output"
> -}
> -
> -expect_ssh () {
> +i6501=0

Is this variable meant to be named after the test script t5601? If so: s/i6501/i5601/g

Show 21 quoted lines
> +# $1 url
> +# $2 none|host
> +# $3 path
> +test_clone_url () {
> +       i6501=$(($i6501 + 1))
> +       >"$TRASH_DIRECTORY/ssh-output" &&
> +       test_might_fail git clone "$1" tmp$i6501 &&
>         {
> -               case "$1" in
> +               case "$2" in
>                 none)
>                         ;;
>                 *)
> -                       echo "ssh: $1 git-upload-pack '$2'"
> +                       echo "ssh: $2 git-upload-pack '$3'"
>                 esac
>         } >"$TRASH_DIRECTORY/ssh-expect" &&
> -       (cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output)
> +       (cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output) && {
> +               rm -rf ssh-expect ssh-output
> +       }

Should the 'rm' be inside the (cd...) subshell? If not, are the braces wrapping 'rm' needed, and wouldn't you want to prefix the paths with $TRASH_DIRECTORY/?

Show 7 quoted lines
>  }
>
> -test_expect_success 'cloning myhost:src uses ssh' '
> -       clear_ssh &&
> -       git clone myhost:src ssh-clone &&
> -       expect_ssh myhost src
> -'
Previous: Torsten Bögershausen
Message 2 of 2 in “git clone: is an URL local or ssh”
  1. git clone: is an URL local or sshTorsten Bögershausen, Oct 26, 2013
  2. Eric SunshineOct 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.