threads / patch / 10569

patchMake git-clone obey "--" (end argument parsing)

Subject: [PATCH] Make git-clone obey "--" (end argument parsing)

## tl;dr

2 messages between Nov 1, 2007 and Nov 1, 2007. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Heikki Orsila· Nov 1, 2007, 19:54 UTC · lore
Oops. Reposting the patch.
This patch handles "--" argument for git-clone.
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
>From bd2d661c565062eacc80dda90f3978303308f9bb Mon Sep 17 00:00:00 2001
From: Heikki Orsila <heikki.orsila@iki.fi>
Date: Thu, 1 Nov 2007 16:21:39 +0200
Subject: [PATCH] Make git-clone obey "--" (end argument parsing)
---
 Documentation/git-clone.txt |    2 +-
 git-clone.sh                |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
Show changes to 2 files +5 −2

Documentation/git-clone.txt, git-clone.sh

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 253f4f0..7fdcd42 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -12,7 +12,7 @@ SYNOPSIS
 'git-clone' [--template=<template_directory>]
 	  [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare]
 	  [-o <name>] [-u <upload-pack>] [--reference <repository>]
-	  [--depth <depth>] <repository> [<directory>]
+	  [--depth <depth>] [--] <repository> [<directory>]
 
 DESCRIPTION
 -----------
diff --git a/git-clone.sh b/git-clone.sh
index 0ea3c24..3f00693 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -14,7 +14,7 @@ die() {
 }
 
 usage() {
-	die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] <repo> [<dir>]"
+	die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] [--] <repo> [<dir>]"
 }
 
 get_repo_base() {
@@ -160,6 +160,9 @@ while
 	*,--depth)
 		shift
 		depth="--depth=$1";;
+	*,--)
+		shift
+		break ;;
 	*,-*) usage ;;
 	*) break ;;
 	esac
-- 
1.5.3.4.498.g9c514-dirty
Junio C Hamano· Nov 1, 2007, 20:39 UTC · re: Heikki Orsila · lore

Re: [PATCH] Make git-clone obey "--" (end argument parsing)

shd@jolt.modeemi.cs.tut.fi (Heikki Orsila) writes:
Show 26 quoted lines
> Oops. Reposting the patch.
>
> This patch handles "--" argument for git-clone.
>
> Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
>
>>From bd2d661c565062eacc80dda90f3978303308f9bb Mon Sep 17 00:00:00 2001
> From: Heikki Orsila <heikki.orsila@iki.fi>
> Date: Thu, 1 Nov 2007 16:21:39 +0200
> Subject: [PATCH] Make git-clone obey "--" (end argument parsing)
>
> ---
>  Documentation/git-clone.txt |    2 +-
>  git-clone.sh                |    5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index 253f4f0..7fdcd42 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -12,7 +12,7 @@ SYNOPSIS
>  'git-clone' [--template=<template_directory>]
>  	  [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare]
>  	  [-o <name>] [-u <upload-pack>] [--reference <repository>]
> -	  [--depth <depth>] <repository> [<directory>]
> +	  [--depth <depth>] [--] <repository> [<directory>]

I do not think this breaks anything, but does it _help_ anything in practice?

What kind of breakage does this patch fix?

← back to recent threads