Merge branch 'jc/numstat' into next

* jc/numstat:
  diff --numstat: show binary with '-' to match "apply --numstat"
  shortlog: fix segfault on empty authorname
  shortlog: remove "[PATCH]" prefix from shortlog output
  Make sure the empty tree exists when needed in merge-recursive.
  Don't use memcpy when source and dest. buffers may overlap
  no need to install manpages as executable
This commit is contained in:
Junio C Hamano
2006-12-11 14:56:30 -08:00
5 changed files with 18 additions and 8 deletions

View File

@@ -56,8 +56,8 @@ man7: $(DOC_MAN7)
install: man
$(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
$(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1dir)
$(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7dir)
$(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
$(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
#

View File

@@ -188,18 +188,25 @@ static void read_from_stdin(struct path_list *list)
bob = buffer + strlen(buffer);
else {
offset = 8;
if (isspace(bob[-1]))
while (buffer + offset < bob &&
isspace(bob[-1]))
bob--;
}
while (fgets(buffer2, sizeof(buffer2), stdin) &&
buffer2[0] != '\n')
; /* chomp input */
if (fgets(buffer2, sizeof(buffer2), stdin))
if (fgets(buffer2, sizeof(buffer2), stdin)) {
int l2 = strlen(buffer2);
int i;
for (i = 0; i < l2; i++)
if (!isspace(buffer2[i]))
break;
insert_author_oneline(list,
buffer + offset,
bob - buffer - offset,
buffer2, strlen(buffer2));
buffer2 + i, l2 - i);
}
}
}
}

5
diff.c
View File

@@ -816,7 +816,10 @@ static void show_numstat(struct diffstat_t* data, struct diff_options *options)
for (i = 0; i < data->nr; i++) {
struct diffstat_file *file = data->files[i];
printf("%d\t%d\t", file->added, file->deleted);
if (file->is_binary)
printf("-\t-\t");
else
printf("%d\t%d\t", file->added, file->deleted);
if (options->line_termination &&
quote_c_style(file->name, NULL, NULL, 0))
quote_c_style(file->name, NULL, stdout, 0);

View File

@@ -96,7 +96,7 @@ static void flush(void)
if (output_fd >= 0)
write_or_die(output_fd, input_buffer, input_offset);
SHA1_Update(&input_ctx, input_buffer, input_offset);
memcpy(input_buffer, input_buffer + input_offset, input_len);
memmove(input_buffer, input_buffer + input_offset, input_len);
input_offset = 0;
}
}

View File

@@ -1222,7 +1222,7 @@ static int merge(struct commit *h1,
tree->object.parsed = 1;
tree->object.type = OBJ_TREE;
hash_sha1_file(NULL, 0, tree_type, tree->object.sha1);
write_sha1_file(NULL, 0, tree_type, tree->object.sha1);
merged_common_ancestors = make_virtual_commit(tree, "ancestor");
}