Skip to content

Commit 611d813

Browse files
committed
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.
2 parents 568d2cd + 8419d2e commit 611d813

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

Documentation/git-filter-branch.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ git filter-branch --commit-filter '
220220
fi' HEAD
221221
------------------------------------------------------------------------------
222222

223-
Note that the changes introduced by the commits, and not reverted by
224-
subsequent commits, will still be in the rewritten branch. If you want
225-
to throw out _changes_ together with the commits, you should use the
226-
interactive mode of gitlink:git-rebase[1].
227-
228223
The function 'skip_commits' is defined as follows:
229224

230225
--------------------------

builtin-add.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static void update_callback(struct diff_queue_struct *q,
9898
die("unexpacted diff status %c", p->status);
9999
case DIFF_STATUS_UNMERGED:
100100
case DIFF_STATUS_MODIFIED:
101+
case DIFF_STATUS_TYPE_CHANGED:
101102
add_file_to_cache(path, verbose);
102103
break;
103104
case DIFF_STATUS_DELETED:

builtin-log.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,34 @@ static void gen_message_id(char *dest, unsigned int length, char *base)
437437
(int)(email_end - email_start - 1), email_start + 1);
438438
}
439439

440+
static const char *clean_message_id(const char *msg_id)
441+
{
442+
char ch;
443+
const char *a, *z, *m;
444+
char *n;
445+
size_t len;
446+
447+
m = msg_id;
448+
while ((ch = *m) && (isspace(ch) || (ch == '<')))
449+
m++;
450+
a = m;
451+
z = NULL;
452+
while ((ch = *m)) {
453+
if (!isspace(ch) && (ch != '>'))
454+
z = m;
455+
m++;
456+
}
457+
if (!z)
458+
die("insane in-reply-to: %s", msg_id);
459+
if (++z == m)
460+
return a;
461+
len = z - a;
462+
n = xmalloc(len + 1);
463+
memcpy(n, a, len);
464+
n[len] = 0;
465+
return n;
466+
}
467+
440468
int cmd_format_patch(int argc, const char **argv, const char *prefix)
441469
{
442470
struct commit *commit;
@@ -625,7 +653,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
625653
if (numbered)
626654
rev.total = total + start_number - 1;
627655
rev.add_signoff = add_signoff;
628-
rev.ref_message_id = in_reply_to;
656+
if (in_reply_to)
657+
rev.ref_message_id = clean_message_id(in_reply_to);
629658
while (0 <= --nr) {
630659
int shown;
631660
commit = list[nr];

git-clone.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ fi
3434

3535
http_fetch () {
3636
# $1 = Remote, $2 = Local
37-
curl -nsfL $curl_extra_args "$1" >"$2"
37+
curl -nsfL $curl_extra_args "$1" >"$2" ||
38+
case $? in
39+
126|127) exit ;;
40+
*) return $? ;;
41+
esac
3842
}
3943

4044
clone_dumb_http () {

templates/hooks--update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fi
4242

4343
# --- Check types
4444
# if $newrev is 0000...0000, it's a commit to delete a branch
45-
if [ -z "${newrev##0*}" ]; then
45+
if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
4646
newrev_type=commit
4747
else
4848
newrev_type=$(git-cat-file -t $newrev)

0 commit comments

Comments
 (0)