Skip to content

Commit 4c00c85

Browse files
committed
Sync with 1.7.7.4
2 parents 418c9b1 + bd5bce7 commit 4c00c85

File tree

5 files changed

+81
-49
lines changed

5 files changed

+81
-49
lines changed

Documentation/RelNotes/1.7.7.4.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Git v1.7.7.4 Release Notes
2+
==========================
3+
4+
Fixes since v1.7.7.3
5+
--------------------
6+
7+
* A few header dependencies were missing from the Makefile.
8+
9+
* Some newer parts of the code used C99 __VA_ARGS__ while we still
10+
try to cater to older compilers.
11+
12+
* "git name-rev --all" tried to name all _objects_, naturally failing to
13+
describe many blobs and trees, instead of showing only commits as
14+
advertised in its documentation.

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ LIB_H += compat/win32/syslog.h
518518
LIB_H += compat/win32/poll.h
519519
LIB_H += compat/win32/dirent.h
520520
LIB_H += connected.h
521+
LIB_H += convert.h
521522
LIB_H += csum-file.h
522523
LIB_H += decorate.h
523524
LIB_H += delta.h
@@ -2009,13 +2010,13 @@ builtin/branch.o builtin/checkout.o builtin/clone.o builtin/reset.o branch.o tra
20092010
builtin/bundle.o bundle.o transport.o: bundle.h
20102011
builtin/bisect--helper.o builtin/rev-list.o bisect.o: bisect.h
20112012
builtin/clone.o builtin/fetch-pack.o transport.o: fetch-pack.h
2012-
builtin/grep.o builtin/pack-objects.o transport-helper.o: thread-utils.h
2013+
builtin/grep.o builtin/pack-objects.o transport-helper.o thread-utils.o: thread-utils.h
20132014
builtin/send-pack.o transport.o: send-pack.h
20142015
builtin/log.o builtin/shortlog.o: shortlog.h
20152016
builtin/prune.o builtin/reflog.o reachable.o: reachable.h
20162017
builtin/commit.o builtin/revert.o wt-status.o: wt-status.h
20172018
builtin/tar-tree.o archive-tar.o: tar.h
2018-
connect.o transport.o http-backend.o: url.h
2019+
connect.o transport.o url.o http-backend.o: url.h
20192020
http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
20202021
http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h url.h
20212022

builtin/name-rev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
291291
max = get_max_object_index();
292292
for (i = 0; i < max; i++) {
293293
struct object *obj = get_indexed_object(i);
294-
if (!obj)
294+
if (!obj || obj->type != OBJ_COMMIT)
295295
continue;
296296
show_name(obj, NULL,
297297
always, allow_undefined, data.name_only);

mailmap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ static void add_mapping(struct string_list *map,
7070
} else {
7171
/* create mailmap entry */
7272
struct string_list_item *item = string_list_insert_at_index(map, index, old_email);
73-
item->util = xmalloc(sizeof(struct mailmap_entry));
74-
memset(item->util, 0, sizeof(struct mailmap_entry));
73+
item->util = xcalloc(1, sizeof(struct mailmap_entry));
7574
((struct mailmap_entry *)item->util)->namemap.strdup_strings = 1;
7675
}
7776
me = (struct mailmap_entry *)map->items[index].util;
@@ -88,7 +87,7 @@ static void add_mapping(struct string_list *map,
8887
me->email = xstrdup(new_email);
8988
}
9089
} else {
91-
struct mailmap_info *mi = xmalloc(sizeof(struct mailmap_info));
90+
struct mailmap_info *mi = xcalloc(1, sizeof(struct mailmap_info));
9291
debug_mm("mailmap: adding (complex) entry for %s at index %d\n", old_email, index);
9392
if (new_name)
9493
mi->name = xstrdup(new_name);

notes-merge.c

Lines changed: 61 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ void init_notes_merge_options(struct notes_merge_options *o)
2121
o->verbosity = NOTES_MERGE_VERBOSITY_DEFAULT;
2222
}
2323

24-
#define OUTPUT(o, v, ...) \
25-
do { \
26-
if ((o)->verbosity >= (v)) { \
27-
printf(__VA_ARGS__); \
28-
puts(""); \
29-
} \
30-
} while (0)
31-
3224
static int path_to_sha1(const char *path, unsigned char *sha1)
3325
{
3426
char hex_sha1[40];
@@ -392,21 +384,26 @@ static int merge_one_change_manual(struct notes_merge_options *o,
392384

393385
strbuf_addf(&(o->commit_msg), "\t%s\n", sha1_to_hex(p->obj));
394386

395-
OUTPUT(o, 2, "Auto-merging notes for %s", sha1_to_hex(p->obj));
387+
if (o->verbosity >= 2)
388+
printf("Auto-merging notes for %s\n", sha1_to_hex(p->obj));
396389
check_notes_merge_worktree(o);
397390
if (is_null_sha1(p->local)) {
398391
/* D/F conflict, checkout p->remote */
399392
assert(!is_null_sha1(p->remote));
400-
OUTPUT(o, 1, "CONFLICT (delete/modify): Notes for object %s "
401-
"deleted in %s and modified in %s. Version from %s "
402-
"left in tree.", sha1_to_hex(p->obj), lref, rref, rref);
393+
if (o->verbosity >= 1)
394+
printf("CONFLICT (delete/modify): Notes for object %s "
395+
"deleted in %s and modified in %s. Version from %s "
396+
"left in tree.\n",
397+
sha1_to_hex(p->obj), lref, rref, rref);
403398
write_note_to_worktree(p->obj, p->remote);
404399
} else if (is_null_sha1(p->remote)) {
405400
/* D/F conflict, checkout p->local */
406401
assert(!is_null_sha1(p->local));
407-
OUTPUT(o, 1, "CONFLICT (delete/modify): Notes for object %s "
408-
"deleted in %s and modified in %s. Version from %s "
409-
"left in tree.", sha1_to_hex(p->obj), rref, lref, lref);
402+
if (o->verbosity >= 1)
403+
printf("CONFLICT (delete/modify): Notes for object %s "
404+
"deleted in %s and modified in %s. Version from %s "
405+
"left in tree.\n",
406+
sha1_to_hex(p->obj), rref, lref, lref);
410407
write_note_to_worktree(p->obj, p->local);
411408
} else {
412409
/* "regular" conflict, checkout result of ll_merge() */
@@ -415,8 +412,9 @@ static int merge_one_change_manual(struct notes_merge_options *o,
415412
reason = "add/add";
416413
assert(!is_null_sha1(p->local));
417414
assert(!is_null_sha1(p->remote));
418-
OUTPUT(o, 1, "CONFLICT (%s): Merge conflict in notes for "
419-
"object %s", reason, sha1_to_hex(p->obj));
415+
if (o->verbosity >= 1)
416+
printf("CONFLICT (%s): Merge conflict in notes for "
417+
"object %s\n", reason, sha1_to_hex(p->obj));
420418
ll_merge_in_worktree(o, p);
421419
}
422420

@@ -438,24 +436,30 @@ static int merge_one_change(struct notes_merge_options *o,
438436
case NOTES_MERGE_RESOLVE_MANUAL:
439437
return merge_one_change_manual(o, p, t);
440438
case NOTES_MERGE_RESOLVE_OURS:
441-
OUTPUT(o, 2, "Using local notes for %s", sha1_to_hex(p->obj));
439+
if (o->verbosity >= 2)
440+
printf("Using local notes for %s\n",
441+
sha1_to_hex(p->obj));
442442
/* nothing to do */
443443
return 0;
444444
case NOTES_MERGE_RESOLVE_THEIRS:
445-
OUTPUT(o, 2, "Using remote notes for %s", sha1_to_hex(p->obj));
445+
if (o->verbosity >= 2)
446+
printf("Using remote notes for %s\n",
447+
sha1_to_hex(p->obj));
446448
if (add_note(t, p->obj, p->remote, combine_notes_overwrite))
447449
die("BUG: combine_notes_overwrite failed");
448450
return 0;
449451
case NOTES_MERGE_RESOLVE_UNION:
450-
OUTPUT(o, 2, "Concatenating local and remote notes for %s",
451-
sha1_to_hex(p->obj));
452+
if (o->verbosity >= 2)
453+
printf("Concatenating local and remote notes for %s\n",
454+
sha1_to_hex(p->obj));
452455
if (add_note(t, p->obj, p->remote, combine_notes_concatenate))
453456
die("failed to concatenate notes "
454457
"(combine_notes_concatenate)");
455458
return 0;
456459
case NOTES_MERGE_RESOLVE_CAT_SORT_UNIQ:
457-
OUTPUT(o, 2, "Concatenating unique lines in local and remote "
458-
"notes for %s", sha1_to_hex(p->obj));
460+
if (o->verbosity >= 2)
461+
printf("Concatenating unique lines in local and remote "
462+
"notes for %s\n", sha1_to_hex(p->obj));
459463
if (add_note(t, p->obj, p->remote, combine_notes_cat_sort_uniq))
460464
die("failed to concatenate notes "
461465
"(combine_notes_cat_sort_uniq)");
@@ -518,8 +522,9 @@ static int merge_from_diffs(struct notes_merge_options *o,
518522
conflicts = merge_changes(o, changes, &num_changes, t);
519523
free(changes);
520524

521-
OUTPUT(o, 4, "Merge result: %i unmerged notes and a %s notes tree",
522-
conflicts, t->dirty ? "dirty" : "clean");
525+
if (o->verbosity >= 4)
526+
printf("Merge result: %i unmerged notes and a %s notes tree\n",
527+
conflicts, t->dirty ? "dirty" : "clean");
523528

524529
return conflicts ? -1 : 1;
525530
}
@@ -617,33 +622,40 @@ int notes_merge(struct notes_merge_options *o,
617622
if (!bases) {
618623
base_sha1 = null_sha1;
619624
base_tree_sha1 = EMPTY_TREE_SHA1_BIN;
620-
OUTPUT(o, 4, "No merge base found; doing history-less merge");
625+
if (o->verbosity >= 4)
626+
printf("No merge base found; doing history-less merge\n");
621627
} else if (!bases->next) {
622628
base_sha1 = bases->item->object.sha1;
623629
base_tree_sha1 = bases->item->tree->object.sha1;
624-
OUTPUT(o, 4, "One merge base found (%.7s)",
625-
sha1_to_hex(base_sha1));
630+
if (o->verbosity >= 4)
631+
printf("One merge base found (%.7s)\n",
632+
sha1_to_hex(base_sha1));
626633
} else {
627634
/* TODO: How to handle multiple merge-bases? */
628635
base_sha1 = bases->item->object.sha1;
629636
base_tree_sha1 = bases->item->tree->object.sha1;
630-
OUTPUT(o, 3, "Multiple merge bases found. Using the first "
631-
"(%.7s)", sha1_to_hex(base_sha1));
637+
if (o->verbosity >= 3)
638+
printf("Multiple merge bases found. Using the first "
639+
"(%.7s)\n", sha1_to_hex(base_sha1));
632640
}
633641

634-
OUTPUT(o, 4, "Merging remote commit %.7s into local commit %.7s with "
635-
"merge-base %.7s", sha1_to_hex(remote->object.sha1),
636-
sha1_to_hex(local->object.sha1), sha1_to_hex(base_sha1));
642+
if (o->verbosity >= 4)
643+
printf("Merging remote commit %.7s into local commit %.7s with "
644+
"merge-base %.7s\n", sha1_to_hex(remote->object.sha1),
645+
sha1_to_hex(local->object.sha1),
646+
sha1_to_hex(base_sha1));
637647

638648
if (!hashcmp(remote->object.sha1, base_sha1)) {
639649
/* Already merged; result == local commit */
640-
OUTPUT(o, 2, "Already up-to-date!");
650+
if (o->verbosity >= 2)
651+
printf("Already up-to-date!\n");
641652
hashcpy(result_sha1, local->object.sha1);
642653
goto found_result;
643654
}
644655
if (!hashcmp(local->object.sha1, base_sha1)) {
645656
/* Fast-forward; result == remote commit */
646-
OUTPUT(o, 2, "Fast-forward");
657+
if (o->verbosity >= 2)
658+
printf("Fast-forward\n");
647659
hashcpy(result_sha1, remote->object.sha1);
648660
goto found_result;
649661
}
@@ -685,8 +697,9 @@ int notes_merge_commit(struct notes_merge_options *o,
685697
int path_len = strlen(path), i;
686698
const char *msg = strstr(partial_commit->buffer, "\n\n");
687699

688-
OUTPUT(o, 3, "Committing notes in notes merge worktree at %.*s",
689-
path_len - 1, path);
700+
if (o->verbosity >= 3)
701+
printf("Committing notes in notes merge worktree at %.*s\n",
702+
path_len - 1, path);
690703

691704
if (!msg || msg[2] == '\0')
692705
die("partial notes commit has empty message");
@@ -701,7 +714,9 @@ int notes_merge_commit(struct notes_merge_options *o,
701714
unsigned char obj_sha1[20], blob_sha1[20];
702715

703716
if (ent->len - path_len != 40 || get_sha1_hex(relpath, obj_sha1)) {
704-
OUTPUT(o, 3, "Skipping non-SHA1 entry '%s'", ent->name);
717+
if (o->verbosity >= 3)
718+
printf("Skipping non-SHA1 entry '%s'\n",
719+
ent->name);
705720
continue;
706721
}
707722

@@ -713,14 +728,16 @@ int notes_merge_commit(struct notes_merge_options *o,
713728
if (add_note(partial_tree, obj_sha1, blob_sha1, NULL))
714729
die("Failed to add resolved note '%s' to notes tree",
715730
ent->name);
716-
OUTPUT(o, 4, "Added resolved note for object %s: %s",
717-
sha1_to_hex(obj_sha1), sha1_to_hex(blob_sha1));
731+
if (o->verbosity >= 4)
732+
printf("Added resolved note for object %s: %s\n",
733+
sha1_to_hex(obj_sha1), sha1_to_hex(blob_sha1));
718734
}
719735

720736
create_notes_commit(partial_tree, partial_commit->parents, msg,
721737
result_sha1);
722-
OUTPUT(o, 4, "Finalized notes merge commit: %s",
723-
sha1_to_hex(result_sha1));
738+
if (o->verbosity >= 4)
739+
printf("Finalized notes merge commit: %s\n",
740+
sha1_to_hex(result_sha1));
724741
free(path);
725742
return 0;
726743
}
@@ -732,7 +749,8 @@ int notes_merge_abort(struct notes_merge_options *o)
732749
int ret;
733750

734751
strbuf_addstr(&buf, git_path(NOTES_MERGE_WORKTREE));
735-
OUTPUT(o, 3, "Removing notes merge worktree at %s", buf.buf);
752+
if (o->verbosity >= 3)
753+
printf("Removing notes merge worktree at %s\n", buf.buf);
736754
ret = remove_dir_recursively(&buf, 0);
737755
strbuf_release(&buf);
738756
return ret;

0 commit comments

Comments
 (0)