From dc49308450eac06a66f136b6c49e193bef25a168 Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Wed, 2 Jul 2008 10:13:35 -0400 Subject: [PATCH 1/5] Documentation: Point to gitcli(7) from git(1) Signed-off-by: Brian Gernhardt Signed-off-by: Junio C Hamano --- Documentation/git.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index bb33c40876..57a3a84be1 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -593,7 +593,7 @@ SEE ALSO linkgit:gittutorial[7], linkgit:gittutorial-2[7], linkgit:giteveryday[7], linkgit:gitcvs-migration[7], linkgit:gitglossary[7], linkgit:gitcore-tutorial[7], -link:user-manual.html[The Git User's Manual] +linkgit:gitcli[7], link:user-manual.html[The Git User's Manual] GIT --- From 8cb560fc470ee0d94e188d4e9deb14b0c8ac7a91 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 2 Jul 2008 18:06:56 +0100 Subject: [PATCH 2/5] git fetch-pack: do not complain about "no common commits" in an empty repo If the repo is empty, it is obvious that there are no common commits when fetching from _anywhere_. So there is no use in saying it in that case, and it can even be annoying. Therefore suppress the message unilaterally if the repository is empty prior to the fetch. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin-fetch-pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index f4dbcf069e..2175c6d0d6 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -309,7 +309,8 @@ done: } flushes--; } - return retval; + /* it is no error to fetch into a completely empty repo */ + return count ? retval : 0; } static struct commit_list *complete; From 14d4642e2a472ba4c06e10a3f5623d944b869314 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 3 Jul 2008 02:32:45 +0000 Subject: [PATCH 3/5] Fix describe --tags --long so it does not segfault If we match a lightweight (non-annotated tag) as the name to output and --long was requested we do not have a tag, nor do we have a tagged object to display. Instead we must use the object we were passed as input for the long format display. Reported-by: Mark Burton Backtraced-by: Mikael Magnusson Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- builtin-describe.c | 2 +- t/t6120-describe.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin-describe.c b/builtin-describe.c index 3da99c1d06..e515f9ca9b 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -204,7 +204,7 @@ static void describe(const char *arg, int last_one) */ display_name(n); if (longformat) - show_suffix(0, n->tag->tagged->sha1); + show_suffix(0, n->tag ? n->tag->tagged->sha1 : sha1); printf("\n"); return; } diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index c6be2597f7..2fb672c3b4 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -139,4 +139,6 @@ check_describe "test1-lightweight-*" --tags --match="test1-*" check_describe "test2-lightweight-*" --tags --match="test2-*" +check_describe "test2-lightweight-*" --long --tags --match="test2-*" HEAD^ + test_done From 6cbf8b00fb27f5f55f1a5645ba60c451cb090fc1 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Thu, 3 Jul 2008 00:11:31 +0200 Subject: [PATCH 4/5] git-send-email: Do not attempt to STARTTLS more than once With the previous TLS patch, send-email would attempt to STARTTLS at the beginning of every mail, despite reusing the last connection. We simply skip further encryption checks after successful TLS initiation. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- git-send-email.perl | 1 + 1 file changed, 1 insertion(+) diff --git a/git-send-email.perl b/git-send-email.perl index a047b016e3..3564419e81 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -772,6 +772,7 @@ X-Mailer: git-send-email $gitversion if ($smtp->code == 220) { $smtp = Net::SMTP::SSL->start_SSL($smtp) or die "STARTTLS failed! ".$smtp->message; + $smtp_encryption = ''; } else { die "Server does not support STARTTLS! ".$smtp->message; } From 6991357513bf8bfbb71a4675e271b386cc273476 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 3 Jul 2008 00:25:23 -0700 Subject: [PATCH 5/5] fast-export --export-marks: fix off by one error The export_marks() function iterated over a (potentially sparsely populated) hashtable, but it accessed it starting from offset 1 and one element beyond the end. Noticed by SungHyun Nam. Signed-off-by: Junio C Hamano --- builtin-fast-export.c | 10 +++++----- decorate.c | 5 +---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/builtin-fast-export.c b/builtin-fast-export.c index 45786ef1b7..170b82e6ef 100644 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -379,19 +379,19 @@ static void export_marks(char *file) if (!f) error("Unable to open marks file %s for writing", file); - for (i = 0; i < idnums.size; ++i) { - deco++; - if (deco && deco->base && deco->base->type == 1) { + for (i = 0; i < idnums.size; i++) { + if (deco->base && deco->base->type == 1) { mark = ptr_to_mark(deco->decoration); fprintf(f, ":%u %s\n", mark, sha1_to_hex(deco->base->sha1)); } + deco++; } if (ferror(f) || fclose(f)) error("Unable to write marks file %s.", file); } -static void import_marks(char * input_file) +static void import_marks(char *input_file) { char line[512]; FILE *f = fopen(input_file, "r"); @@ -407,7 +407,7 @@ static void import_marks(char * input_file) line_end = strchr(line, '\n'); if (line[0] != ':' || !line_end) die("corrupt mark line: %s", line); - *line_end = 0; + *line_end = '\0'; mark = strtoumax(line + 1, &mark_end, 10); if (!mark || mark_end == line + 1 diff --git a/decorate.c b/decorate.c index 23f6b0040f..d9668d2ef9 100644 --- a/decorate.c +++ b/decorate.c @@ -37,10 +37,7 @@ static void grow_decoration(struct decoration *n) { int i; int old_size = n->size; - struct object_decoration *old_hash; - - old_size = n->size; - old_hash = n->hash; + struct object_decoration *old_hash = n->hash; n->size = (old_size + 1000) * 3 / 2; n->hash = xcalloc(n->size, sizeof(struct object_decoration));