From c9be27f39488b20946e3a7ba57d776e03708a1fa Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Aug 2010 18:52:14 +0000 Subject: Documentation/git-svn: discourage "noMetadata" "noMetadata" is a sometimes harmful option, so better document its behavior and limitations. Suggested-by: Vadim Zeitlin Signed-off-by: Eric Wong --- Documentation/git-svn.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index 4b84d08fc8..be8a51fd06 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -56,6 +56,8 @@ COMMANDS as well, they take precedence. --no-metadata;; Set the 'noMetadata' option in the [svn-remote] config. + This option is not recommended, please read the 'svn.noMetadata' + section of this manpage before using this option. --use-svm-props;; Set the 'useSvmProps' option in the [svn-remote] config. --use-svnsync-props;; @@ -597,13 +599,22 @@ svn.noMetadata:: svn-remote..noMetadata:: This gets rid of the 'git-svn-id:' lines at the end of every commit. + -If you lose your .git/svn/git-svn/.rev_db file, 'git svn' will not -be able to rebuild it and you won't be able to fetch again, -either. This is fine for one-shot imports. +This option can only be used for one-shot imports as 'git svn' +will not be able to fetch again without metadata. Additionally, +if you lose your .git/svn/**/.rev_map.* files, 'git svn' will not +be able to rebuild them. + The 'git svn log' command will not work on repositories using this, either. Using this conflicts with the 'useSvmProps' option for (hopefully) obvious reasons. ++ +This option is NOT recommended as it makes it difficult to track down +old references to SVN revision numbers in existing documentation, bug +reports and archives. If you plan to eventually migrate from SVN to git +and are certain about dropping SVN history, consider +linkgit:git-filter-branch[1] instead. filter-branch also allows +reformating of metadata for ease-of-reading and rewriting authorship +info for non-"svn.authorsFile" users. svn.useSvmProps:: svn-remote..useSvmProps:: -- cgit v1.2.3 From a3c75056dc73661a6cdab180659f52cdb03b357c Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Thu, 2 Sep 2010 18:32:06 -0400 Subject: git-svn: check_cherry_pick should exclude commits already in our history The merge-base between @$parents and $merge_tip may have been reached through a merge commit. This means that some commits that are ancestors of @$parents will not be ancestors of $merge_base. The mergeinfo property will not list commits that are ancestors of @$parents, so we need to explicitly exclude them. [ew: squashed and cleaned up test case from Steven] Signed-off-by: Steven Walter Acked-by: Eric Wong --- git-svn.perl | 4 +++- t/t9157-git-svn-fetch-merge.sh | 50 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 t/t9157-git-svn-fetch-merge.sh diff --git a/git-svn.perl b/git-svn.perl index 9b046b693f..c7c4dcdba5 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -3118,9 +3118,10 @@ sub _rev_list { sub check_cherry_pick { my $base = shift; my $tip = shift; + my $parents = shift; my @ranges = @_; my %commits = map { $_ => 1 } - _rev_list("--no-merges", $tip, "--not", $base); + _rev_list("--no-merges", $tip, "--not", $base, @$parents); for my $range ( @ranges ) { delete @commits{_rev_list($range)}; } @@ -3296,6 +3297,7 @@ sub find_extra_svn_parents { # double check that there are no missing non-merge commits my (@incomplete) = check_cherry_pick( $merge_base, $merge_tip, + $parents, @$ranges, ); diff --git a/t/t9157-git-svn-fetch-merge.sh b/t/t9157-git-svn-fetch-merge.sh new file mode 100644 index 0000000000..da582c5382 --- /dev/null +++ b/t/t9157-git-svn-fetch-merge.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Copyright (c) 2010 Steven Walter +# + +test_description='git svn merge detection' +. ./lib-git-svn.sh + +test_expect_success 'initialize source svn repo' ' + svn_cmd mkdir -m x "$svnrepo"/trunk && + svn_cmd mkdir -m x "$svnrepo"/branches && + svn_cmd co "$svnrepo"/trunk "$SVN_TREE" && + ( + cd "$SVN_TREE" && + touch foo && + svn add foo && + svn commit -m "initial commit" && + svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch1 && + touch bar && + svn add bar && + svn commit -m x && + svn cp -m branch "$svnrepo"/trunk "$svnrepo"/branches/branch2 && + svn switch "$svnrepo"/branches/branch1 && + touch baz && + svn add baz && + svn commit -m x && + svn switch "$svnrepo"/trunk && + svn merge "$svnrepo"/branches/branch1 && + svn commit -m "merge" && + svn switch "$svnrepo"/branches/branch1 && + svn commit -m x && + svn switch "$svnrepo"/branches/branch2 && + svn merge "$svnrepo"/branches/branch1 && + svn commit -m "merge branch1" && + svn switch "$svnrepo"/trunk && + svn merge "$svnrepo"/branches/branch2 && + svn resolved baz && + svn commit -m "merge branch2" + ) && + rm -rf "$SVN_TREE" +' + +test_expect_success 'clone svn repo' ' + git svn init -s "$svnrepo" && + git svn fetch +' + +test_expect_success 'verify merge commit' 'git rev-parse HEAD^2' + +test_done -- cgit v1.2.3 From 8565a568cdd8604d4b5a00e52c64064a8aebf690 Mon Sep 17 00:00:00 2001 From: Mathias Lafeldt Date: Fri, 24 Sep 2010 00:05:03 +0200 Subject: git-svn: fix processing of decorated commit hashes The function working_head_info() fails to parse commit hashes if they are decorated (i.e. log.decorate is true), causing dcommit, rebase, and other vital git-svn commands to malfunction. This patch disables decorated log output with --no-decorate. [ew: wrapped long line] Signed-off-by: Mathias Lafeldt Acked-by: Eric Wong --- git-svn.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index c7c4dcdba5..18cfb2466d 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1513,7 +1513,8 @@ sub cmt_sha2rev_batch { sub working_head_info { my ($head, $refs) = @_; - my @args = ('log', '--no-color', '--first-parent', '--pretty=medium'); + my @args = qw/log --no-color --no-decorate --first-parent + --pretty=medium/; my ($fh, $ctx) = command_output_pipe(@args, $head); my $hash; my %max; -- cgit v1.2.3 From 7f7868eadce9b6a9d93e7e8bc80fd58c5e64cc67 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 2 Oct 2010 03:35:29 -0500 Subject: environment.c: remove unused variable After v1.6.0-rc0~230^2^ (environment.c: remove unused function, 2008-06-19), git_refs_dir is not used any more. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- environment.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/environment.c b/environment.c index 2d0c315379..c44a30be3e 100644 --- a/environment.c +++ b/environment.c @@ -64,7 +64,7 @@ char *git_work_tree_cfg; static char *work_tree; static const char *git_dir; -static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file; +static char *git_object_dir, *git_index_file, *git_graft_file; /* * Repository-local GIT_* environment variables @@ -96,8 +96,6 @@ static void setup_git_env(void) git_object_dir = xmalloc(strlen(git_dir) + 9); sprintf(git_object_dir, "%s/objects", git_dir); } - git_refs_dir = xmalloc(strlen(git_dir) + 6); - sprintf(git_refs_dir, "%s/refs", git_dir); git_index_file = getenv(INDEX_ENVIRONMENT); if (!git_index_file) { git_index_file = xmalloc(strlen(git_dir) + 7); -- cgit v1.2.3 From 06f3549d7146179c5cafe8f76e8fcbc064eba2f7 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 2 Oct 2010 03:36:52 -0500 Subject: setup: make sure git dir path is in a permanent buffer If setup_git_env() is run before the usual repository discovery sequence and .git is a file with the text gitdir: (with any string) then the in-core git_dir variable is set to the result of converting to an absolute path using make_absolute_path(). Unfortunately make_absolute_path() returns its result in a static buffer that is overwritten by later calls. Such a call could cause later accesses to git_dir (from git_pathdup(), for example) to read the wrong path, leaving git very confused. It is not obvious whether any existing code in git will trigger the problem, but in any case, it is worth a few dozen bytes to copy the return value from make_absolute_path() for some added peace of mind. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- environment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/environment.c b/environment.c index c44a30be3e..de5581fe51 100644 --- a/environment.c +++ b/environment.c @@ -87,8 +87,10 @@ const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = { static void setup_git_env(void) { git_dir = getenv(GIT_DIR_ENVIRONMENT); - if (!git_dir) + if (!git_dir) { git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT); + git_dir = git_dir ? xstrdup(git_dir) : NULL; + } if (!git_dir) git_dir = DEFAULT_GIT_DIR_ENVIRONMENT; git_object_dir = getenv(DB_ENVIRONMENT); -- cgit v1.2.3 From 2d2ef5ec82c912fcc5c06fa902c867d45cc8a53e Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sun, 3 Oct 2010 14:00:00 -0600 Subject: t3020 (ls-files-error-unmatch): remove stray '1' from end of file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked-by: Ævar Arnfjörð Bjarmason Reviewed-by: Jonathan Nieder Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- t/t3020-ls-files-error-unmatch.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/t/t3020-ls-files-error-unmatch.sh b/t/t3020-ls-files-error-unmatch.sh index a7d8187169..ca01053bcc 100755 --- a/t/t3020-ls-files-error-unmatch.sh +++ b/t/t3020-ls-files-error-unmatch.sh @@ -26,4 +26,3 @@ test_expect_success \ 'git ls-files --error-unmatch foo bar' test_done -1 -- cgit v1.2.3 From 95ae69b95ba595d884d31a5cee92a823ec0c705f Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Mon, 4 Oct 2010 17:51:47 -0500 Subject: diffcore-pickaxe.c: remove unnecessary curly braces Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- diffcore-pickaxe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index 929de15aa9..9c6544daac 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -128,9 +128,8 @@ void diffcore_pickaxe(const char *needle, int opts) diff_free_filepair(p); } - if (opts & DIFF_PICKAXE_REGEX) { + if (opts & DIFF_PICKAXE_REGEX) regfree(®ex); - } free(q->queue); *q = outq; -- cgit v1.2.3 From 9173912be36c4f967f42f176be767fc5ba3c4077 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sun, 3 Oct 2010 23:34:27 -0500 Subject: init: plug tiny one-time memory leak The buffer used to construct paths like ".git/objects/info" and ".git/objects/pack" is allocated on the heap and never freed. So free it. While at it, factor out the relevant code into its own function and rename the sha1_dir variable to object_directory (to match the change in everyday usage after the renaming of SHA1_FILE_DIRECTORY in v0.99~603^2~7, 2005). Noticed by valgrind while setting up tests (in test-lib). Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/init-db.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/builtin/init-db.c b/builtin/init-db.c index 0271285fad..9d4886c716 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -294,11 +294,26 @@ static int create_default_files(const char *template_path) return reinit; } +static void create_object_directory(void) +{ + const char *object_directory = get_object_directory(); + int len = strlen(object_directory); + char *path = xmalloc(len + 40); + + memcpy(path, object_directory, len); + + safe_create_dir(object_directory, 1); + strcpy(path+len, "/pack"); + safe_create_dir(path, 1); + strcpy(path+len, "/info"); + safe_create_dir(path, 1); + + free(path); +} + int init_db(const char *template_dir, unsigned int flags) { - const char *sha1_dir; - char *path; - int len, reinit; + int reinit; safe_create_dir(get_git_dir(), 0); @@ -313,16 +328,7 @@ int init_db(const char *template_dir, unsigned int flags) reinit = create_default_files(template_dir); - sha1_dir = get_object_directory(); - len = strlen(sha1_dir); - path = xmalloc(len + 40); - memcpy(path, sha1_dir, len); - - safe_create_dir(sha1_dir, 1); - strcpy(path+len, "/pack"); - safe_create_dir(path, 1); - strcpy(path+len, "/info"); - safe_create_dir(path, 1); + create_object_directory(); if (shared_repository) { char buf[10]; -- cgit v1.2.3 From 349362cc207c96bbf31f503db989f0289c13c05d Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 4 Oct 2010 04:09:17 -0500 Subject: xdiff: cast arguments for ctype functions to unsigned char MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ctype functions isspace(), isalnum(), et al take an integer argument representing an unsigned character, or -1 for EOF. On platforms with a signed char, it is unsafe to pass a char to them without casting it to unsigned char first. Most of git is already shielded against this by the ctype implementation in git-compat-util.h, but xdiff, which uses libc ctype.h, ought to be fixed. Noticed-by: der Mouse Reported-by: Ævar Arnfjörð Bjarmason Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- xdiff/xmacros.h | 1 + xdiff/xmerge.c | 2 +- xdiff/xutils.c | 18 +++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/xdiff/xmacros.h b/xdiff/xmacros.h index 8ef232cfad..165a895a93 100644 --- a/xdiff/xmacros.h +++ b/xdiff/xmacros.h @@ -30,6 +30,7 @@ #define XDL_MAX(a, b) ((a) > (b) ? (a): (b)) #define XDL_ABS(v) ((v) >= 0 ? (v): -(v)) #define XDL_ISDIGIT(c) ((c) >= '0' && (c) <= '9') +#define XDL_ISSPACE(c) (isspace((unsigned char)(c))) #define XDL_ADDBITS(v,b) ((v) + ((v) >> (b))) #define XDL_MASKBITS(b) ((1UL << (b)) - 1) #define XDL_HASHLONG(v,b) (XDL_ADDBITS((unsigned long)(v), b) & XDL_MASKBITS(b)) diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c index 6d6fc1bc5e..9e13b25abc 100644 --- a/xdiff/xmerge.c +++ b/xdiff/xmerge.c @@ -336,7 +336,7 @@ static int xdl_refine_conflicts(xdfenv_t *xe1, xdfenv_t *xe2, xdmerge_t *m, static int line_contains_alnum(const char *ptr, long size) { while (size--) - if (isalnum(*(ptr++))) + if (isalnum((unsigned char)*(ptr++))) return 1; return 0; } diff --git a/xdiff/xutils.c b/xdiff/xutils.c index 22f9bd692c..ab6503460f 100644 --- a/xdiff/xutils.c +++ b/xdiff/xutils.c @@ -211,18 +211,18 @@ int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags) if (l1[i1++] != l2[i2++]) return 0; skip_ws: - while (i1 < s1 && isspace(l1[i1])) + while (i1 < s1 && XDL_ISSPACE(l1[i1])) i1++; - while (i2 < s2 && isspace(l2[i2])) + while (i2 < s2 && XDL_ISSPACE(l2[i2])) i2++; } } else if (flags & XDF_IGNORE_WHITESPACE_CHANGE) { while (i1 < s1 && i2 < s2) { - if (isspace(l1[i1]) && isspace(l2[i2])) { + if (XDL_ISSPACE(l1[i1]) && XDL_ISSPACE(l2[i2])) { /* Skip matching spaces and try again */ - while (i1 < s1 && isspace(l1[i1])) + while (i1 < s1 && XDL_ISSPACE(l1[i1])) i1++; - while (i2 < s2 && isspace(l2[i2])) + while (i2 < s2 && XDL_ISSPACE(l2[i2])) i2++; continue; } @@ -241,13 +241,13 @@ int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags) * while there still are characters remaining on both lines. */ if (i1 < s1) { - while (i1 < s1 && isspace(l1[i1])) + while (i1 < s1 && XDL_ISSPACE(l1[i1])) i1++; if (s1 != i1) return 0; } if (i2 < s2) { - while (i2 < s2 && isspace(l2[i2])) + while (i2 < s2 && XDL_ISSPACE(l2[i2])) i2++; return (s2 == i2); } @@ -260,10 +260,10 @@ static unsigned long xdl_hash_record_with_whitespace(char const **data, char const *ptr = *data; for (; ptr < top && *ptr != '\n'; ptr++) { - if (isspace(*ptr)) { + if (XDL_ISSPACE(*ptr)) { const char *ptr2 = ptr; int at_eol; - while (ptr + 1 < top && isspace(ptr[1]) + while (ptr + 1 < top && XDL_ISSPACE(ptr[1]) && ptr[1] != '\n') ptr++; at_eol = (top <= ptr + 1 || ptr[1] == '\n'); -- cgit v1.2.3 From b90d9b889588ca1cfd5667d1fa703d976edd71ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Mon, 4 Oct 2010 12:53:11 +0200 Subject: work around buggy S_ISxxx(m) implementations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are buggy implementations of S_ISxxx(m) macros on some platforms (e.g. NetBSD). The issue is that NetBSD doesn't take care to wrap its macro arguments in parentheses, so on Linux and sane systems we have S_ISREG(m) defined as something like: (((m) & S_IFMT) == S_IFREG) But on NetBSD: ((m & _S_IFMT) == _S_IFREG) Since a caller in builtin/diff.c called our macro as `S_IFREG | 0644' this bug introduced a logic error on NetBSD, since the precedence of bit-wise & is higher than | in C. [jc: took change description from Ævar Arnfjörð Bjarmason's patch] Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- cache.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index 2ef2fa3a5e..3d5ed51989 100644 --- a/cache.h +++ b/cache.h @@ -277,9 +277,16 @@ static inline int ce_to_dtype(const struct cache_entry *ce) else return DT_UNKNOWN; } -#define canon_mode(mode) \ - (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \ - S_ISLNK(mode) ? S_IFLNK : S_ISDIR(mode) ? S_IFDIR : S_IFGITLINK) +static inline unsigned int canon_mode(unsigned int mode) +{ + if (S_ISREG(mode)) + return S_IFREG | ce_permissions(mode); + if (S_ISLNK(mode)) + return S_IFLNK; + if (S_ISDIR(mode)) + return S_IFDIR; + return S_IFGITLINK; +} #define flexible_size(STRUCT,len) ((offsetof(struct STRUCT,name) + (len) + 8) & ~7) #define cache_entry_size(len) flexible_size(cache_entry,len) -- cgit v1.2.3 From c03c83152d6ce6fa5ae49a8698da5fc25a53127f Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 5 Oct 2010 09:24:10 +0200 Subject: do not depend on signed integer overflow Signed integer overflow is not defined in C, so do not depend on it. This fixes a problem with GCC 4.4.0 and -O3 where the optimizer would consider "consumed_bytes > consumed_bytes + bytes" as a constant expression, and never execute the die()-call. Signed-off-by: Erik Faye-Lund Acked-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- builtin/index-pack.c | 2 +- builtin/pack-objects.c | 2 +- builtin/unpack-objects.c | 2 +- git-compat-util.h | 12 ++++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 2e680d7a7a..e243d9d22e 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -161,7 +161,7 @@ static void use(int bytes) input_offset += bytes; /* make sure off_t is sufficiently large not to wrap */ - if (consumed_bytes > consumed_bytes + bytes) + if (signed_add_overflows(consumed_bytes, bytes)) die("pack too large for current definition of off_t"); consumed_bytes += bytes; } diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 3756cf36ee..d5a8db1bb6 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -431,7 +431,7 @@ static int write_one(struct sha1file *f, written_list[nr_written++] = &e->idx; /* make sure off_t is sufficiently large not to wrap */ - if (*offset > *offset + size) + if (signed_add_overflows(*offset, size)) die("pack too large for current definition of off_t"); *offset += size; return 1; diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index 685566e0b5..f63973c914 100644 --- a/builtin/unpack-objects.c +++ b/builtin/unpack-objects.c @@ -83,7 +83,7 @@ static void use(int bytes) offset += bytes; /* make sure off_t is sufficiently large not to wrap */ - if (consumed_bytes > consumed_bytes + bytes) + if (signed_add_overflows(consumed_bytes, bytes)) die("pack too large for current definition of off_t"); consumed_bytes += bytes; } diff --git a/git-compat-util.h b/git-compat-util.h index 81883e7270..2af8d3edbe 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -28,6 +28,18 @@ #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define bitsizeof(x) (CHAR_BIT * sizeof(x)) +#define maximum_signed_value_of_type(a) \ + (INTMAX_MAX >> (bitsizeof(intmax_t) - bitsizeof(a))) + +/* + * Signed integer overflow is undefined in C, so here's a helper macro + * to detect if the sum of two integers will overflow. + * + * Requires: a >= 0, typeof(a) equals typeof(b) + */ +#define signed_add_overflows(a, b) \ + ((b) > maximum_signed_value_of_type(a) - (a)) + #ifdef __GNUC__ #define TYPEOF(x) (__typeof__(x)) #else -- cgit v1.2.3 From 6db2103f92cf6c5caeeddec0bfd5f57f94e81d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 4 Oct 2010 19:28:27 +0200 Subject: Documentation/git-clone: describe --mirror more verbosely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some people in #linux-rt noticed that describing what "--mirror" option does with "it mirrors" is way insufficient. Cc: Steven Rostedt Cc: Darren 'Some People' Hart Cc: Michael J Gruber Signed-off-by: Uwe Kleine-König Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index dc7d3d17b1..ab7293351d 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -128,7 +128,12 @@ objects from the source repository into a pack in the cloned repository. configuration variables are created. --mirror:: - Set up a mirror of the remote repository. This implies `--bare`. + Set up a mirror of the source repository. This implies `--bare`. + Compared to `--bare`, `--mirror` not only maps local branches of the + source to local branches of the target, it maps all refs (including + remote branches, notes etc.) and sets up a refspec configuration such + that all these refs are overwritten by a `git remote update` in the + target repository. --origin :: -o :: -- cgit v1.2.3