Merge branch 'tr/log-full-diff-keep-true-parents'

Output from "git log --full-diff -- <pathspec>" looked strange,
because comparison was done with the previous ancestor that touched
the specified <pathspec>, causing the patches for paths outside the
pathspec to show more than the single commit has changed.

Tweak "git reflog -p" for the same reason using the same mechanism.

* tr/log-full-diff-keep-true-parents:
  log: use true parents for diff when walking reflogs
  log: use true parents for diff even when rewriting
This commit is contained in:
Junio C Hamano
2013-09-09 14:33:16 -07:00
8 changed files with 134 additions and 3 deletions

View File

@@ -377,6 +377,22 @@ unsigned commit_list_count(const struct commit_list *l)
return c;
}
struct commit_list *copy_commit_list(struct commit_list *list)
{
struct commit_list *head = NULL;
struct commit_list **pp = &head;
while (list) {
struct commit_list *new;
new = xmalloc(sizeof(struct commit_list));
new->item = list->item;
new->next = NULL;
*pp = new;
pp = &new->next;
list = list->next;
}
return head;
}
void free_commit_list(struct commit_list *list)
{
while (list) {