From c32da692de332d3c9a0b283066e3786af00f4931 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 12 Sep 2007 23:36:03 +0200 Subject: hooks--update: Explicitly check for all zeros for a deleted ref. The previous check caused the hook to reject as unannotated any tag whose SHA1 starts with a zero. Signed-off-by: Alexandre Julliard Signed-off-by: Junio C Hamano diff --git a/templates/hooks--update b/templates/hooks--update index 9d3795c..d8c7626 100644 --- a/templates/hooks--update +++ b/templates/hooks--update @@ -42,7 +42,7 @@ fi # --- Check types # if $newrev is 0000...0000, it's a commit to delete a branch -if [ -z "${newrev##0*}" ]; then +if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then newrev_type=commit else newrev_type=$(git-cat-file -t $newrev) -- cgit v0.10.2-6-g49f6 From f28dd4774d4723e8251817e910dbdc5507282113 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Thu, 13 Sep 2007 11:36:22 +0000 Subject: git-clone: improve error message if curl program is missing or not executable If the curl program is not available (or not executable), and git clone is started to clone a repository through http, this is the output Initialized empty Git repository in /tmp/puppet/.git/ /usr/bin/git-clone: line 37: curl: command not found Cannot get remote repository information. Perhaps git-update-server-info needs to be run there? This patch improves the error message by checking the return code when running curl to exit immediately if it's 126 or 127; the error output now is Initialized empty Git repository in /tmp/puppet/.git/ /usr/bin/git-clone: line 37: curl: command not found Adrian Bridgett noticed this and reported through http://bugs.debian.org/440976 Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano diff --git a/git-clone.sh b/git-clone.sh index 18003ab..5e582fe 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -34,7 +34,11 @@ fi http_fetch () { # $1 = Remote, $2 = Local - curl -nsfL $curl_extra_args "$1" >"$2" + curl -nsfL $curl_extra_args "$1" >"$2" || + case $? in + 126|127) exit ;; + *) return $? ;; + esac } clone_dumb_http () { -- cgit v0.10.2-6-g49f6 From f5de79956b2abeb0f45b338428d39ce089002b66 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Thu, 13 Sep 2007 17:57:56 +0200 Subject: Remove duplicate note about removing commits with git-filter-branch A duplicate of an already existing section in the documentation of git-filter-branch was added in commit f95eef15f2f8a336b9a42749f5458c841a5a5d63. This patch removes that redundant section. Signed-off-by: Ulrik Sverdrup Signed-off-by: Junio C Hamano diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 29bb8ce..c878ed3 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -220,11 +220,6 @@ git filter-branch --commit-filter ' fi' HEAD ------------------------------------------------------------------------------ -Note that the changes introduced by the commits, and not reverted by -subsequent commits, will still be in the rewritten branch. If you want -to throw out _changes_ together with the commits, you should use the -interactive mode of gitlink:git-rebase[1]. - The function 'skip_commits' is defined as follows: -------------------------- -- cgit v0.10.2-6-g49f6 From 767c98a5929b02152c8904a09f1eabbf8d386395 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 14 Sep 2007 00:45:29 -0700 Subject: git-add -u: do not barf on type changes Signed-off-by: Junio C Hamano diff --git a/builtin-add.c b/builtin-add.c index 105a9f0..9847b7e 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -98,6 +98,7 @@ static void update_callback(struct diff_queue_struct *q, die("unexpacted diff status %c", p->status); case DIFF_STATUS_UNMERGED: case DIFF_STATUS_MODIFIED: + case DIFF_STATUS_TYPE_CHANGED: add_file_to_cache(path, verbose); break; case DIFF_STATUS_DELETED: -- cgit v0.10.2-6-g49f6 From 8419d2ee9ba8b375186a5c1019df8dfbce610aba Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 13 Sep 2007 22:30:45 -0700 Subject: git-format-patch --in-reply-to: accept with angle brackets This will allow RFC-literate users to say: format-patch --in-reply-to='' without forcing them to strip the surrounding angle brackets like this: format-patch --in-reply-to='message.id@site.name' We accept both forms, and the latter gets necessary < and > around it as before. Signed-off-by: Junio C Hamano diff --git a/builtin-log.c b/builtin-log.c index fa81c25..c6cc3ae 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -437,6 +437,34 @@ static void gen_message_id(char *dest, unsigned int length, char *base) (int)(email_end - email_start - 1), email_start + 1); } +static const char *clean_message_id(const char *msg_id) +{ + char ch; + const char *a, *z, *m; + char *n; + size_t len; + + m = msg_id; + while ((ch = *m) && (isspace(ch) || (ch == '<'))) + m++; + a = m; + z = NULL; + while ((ch = *m)) { + if (!isspace(ch) && (ch != '>')) + z = m; + m++; + } + if (!z) + die("insane in-reply-to: %s", msg_id); + if (++z == m) + return a; + len = z - a; + n = xmalloc(len + 1); + memcpy(n, a, len); + n[len] = 0; + return n; +} + int cmd_format_patch(int argc, const char **argv, const char *prefix) { struct commit *commit; @@ -625,7 +653,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (numbered) rev.total = total + start_number - 1; rev.add_signoff = add_signoff; - rev.ref_message_id = in_reply_to; + if (in_reply_to) + rev.ref_message_id = clean_message_id(in_reply_to); while (0 <= --nr) { int shown; commit = list[nr]; -- cgit v0.10.2-6-g49f6