From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: <git@vger.kernel.org>
Subject: [PATCH] Make git-clone --use-separate-remote the default
Date: Thu, 23 Nov 2006 23:58:35 +0100 [thread overview]
Message-ID: <20061123225835.30071.99265.stgit@machine.or.cz> (raw)
and --use-immingled-remote can be used to get the original behaviour;
it is also implied by --bare.
We get confused, frustrated and data-losing users *daily* on #git now
because git-clone still produces the crippled repositories having the
remote and local heads freely mixed together.
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
Documentation/git-clone.txt | 20 ++++++++++++++------
git-clone.sh | 14 +++++++-------
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 8606047..b1ad79f 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -11,7 +11,8 @@ SYNOPSIS
[verse]
'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
[-o <name>] [-u <upload-pack>] [--reference <repository>]
- [--use-separate-remote] <repository> [<directory>]
+ [--use-separate-remote | --use-immingled-remote] <repository>
+ [<directory>]
DESCRIPTION
-----------
@@ -71,9 +72,10 @@ OPTIONS
Make a 'bare' GIT repository. That is, instead of
creating `<directory>` and placing the administrative
files in `<directory>/.git`, make the `<directory>`
- itself the `$GIT_DIR`. This implies `-n` option. When
- this option is used, neither the `origin` branch nor the
- default `remotes/origin` file is created.
+ itself the `$GIT_DIR`. This implies the `-n` and
+ `--use-immingled-remote' option. When this option is used,
+ neither the `origin` branch nor the default `remotes/origin`
+ file is created.
--origin <name>::
-o <name>::
@@ -97,8 +99,14 @@ OPTIONS
--use-separate-remote::
Save remotes heads under `$GIT_DIR/remotes/origin/` instead
- of `$GIT_DIR/refs/heads/`. Only the master branch is saved
- in the latter.
+ of `$GIT_DIR/refs/heads/`. Only the local master branch is
+ saved in the latter. This is the default.
+
+--use-immingled-remote::
+ Save remotes heads in the same namespace as the local heads,
+ `$GIT_DIR/refs/heads/'. In regular repositories, this is
+ a legacy setup git-clone created by default in older Git
+ versions. It is also still implied by `--bare'.
<repository>::
The (possibly remote) repository to clone from. It can
diff --git a/git-clone.sh b/git-clone.sh
index 3f006d1..9ed4135 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -14,7 +14,7 @@ die() {
}
usage() {
- die "Usage: $0 [--template=<template_directory>] [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
+ die "Usage: $0 [--template=<template_directory>] [--use-immingled-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
}
get_repo_base() {
@@ -115,7 +115,7 @@ bare=
reference=
origin=
origin_override=
-use_separate_remote=
+use_separate_remote=t
while
case "$#,$1" in
0,*) break ;;
@@ -134,7 +134,10 @@ while
template="$1" ;;
*,-q|*,--quiet) quiet=-q ;;
*,--use-separate-remote)
+ # default
use_separate_remote=t ;;
+ *,--use-immingled-remote)
+ use_separate_remote= ;;
1,--reference) usage ;;
*,--reference)
shift; reference="$1" ;;
@@ -169,18 +172,15 @@ repo="$1"
test -n "$repo" ||
die 'you must specify a repository to clone.'
-# --bare implies --no-checkout
+# --bare implies --no-checkout and --use-immingled-remote
if test yes = "$bare"
then
if test yes = "$origin_override"
then
die '--bare and --origin $origin options are incompatible.'
fi
- if test t = "$use_separate_remote"
- then
- die '--bare and --use-separate-remote options are incompatible.'
- fi
no_checkout=yes
+ use_separate_remote=
fi
next reply other threads:[~2006-11-23 22:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-23 22:58 Petr Baudis [this message]
2006-11-23 23:12 ` [PATCH] Make git-clone --use-separate-remote the default Junio C Hamano
2006-11-23 23:39 ` Andy Whitcroft
2006-11-23 23:42 ` Petr Baudis
2006-11-23 23:45 ` J. Bruce Fields
2006-11-24 0:17 ` Junio C Hamano
2006-11-24 5:47 ` Junio C Hamano
2006-11-24 6:36 ` Junio C Hamano
2006-11-24 10:14 ` Salikh Zakirov
2006-11-24 11:24 ` Junio C Hamano
2006-11-24 11:56 ` Salikh Zakirov
2006-11-24 23:28 ` Salikh Zakirov
2006-11-25 0:04 ` Junio C Hamano
2006-11-24 11:32 ` Sergey Vlasov
2006-11-24 11:37 ` Junio C Hamano
2006-11-24 9:22 ` Jakub Narebski
2006-11-24 9:58 ` Salikh Zakirov
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=20061123225835.30071.99265.stgit@machine.or.cz \
--to=pasky@suse.cz \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).