summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-14 00:55:32 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-14 00:55:32 -0700
commit611d8139e4e0a78797a0821074fc94a4f8d74b7b (patch)
tree992e3bebcce5faf2dc81e3dd7b6df84ade69b477
parent568d2cde9b9fe0fc6b3202c7987b13289cb1a4a0 (diff)
parent8419d2ee9ba8b375186a5c1019df8dfbce610aba (diff)
downloadgit-611d8139e4e0a78797a0821074fc94a4f8d74b7b.tar.gz
Merge branch 'maint'
* maint: git-format-patch --in-reply-to: accept <message@id> with angle brackets git-add -u: do not barf on type changes Remove duplicate note about removing commits with git-filter-branch git-clone: improve error message if curl program is missing or not executable hooks--update: Explicitly check for all zeros for a deleted ref.
-rw-r--r--Documentation/git-filter-branch.txt5
-rw-r--r--builtin-add.c1
-rw-r--r--builtin-log.c31
-rwxr-xr-xgit-clone.sh6
-rw-r--r--templates/hooks--update2
5 files changed, 37 insertions, 8 deletions
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 29bb8cec0c..c878ed395e 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:
--------------------------
diff --git a/builtin-add.c b/builtin-add.c
index 105a9f0e1f..9847b7e019 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:
diff --git a/builtin-log.c b/builtin-log.c
index fa81c25920..c6cc3aef52 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];
diff --git a/git-clone.sh b/git-clone.sh
index 18003ab4b3..5e582fe247 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 () {
diff --git a/templates/hooks--update b/templates/hooks--update
index 9d3795c6d0..d8c76264be 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)