diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-09 21:33:16 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-09 21:33:16 (GMT) |
commit | 4ab4a6dfb414230bb3e13ba65a1aa2606c6102f3 (patch) | |
tree | b82e5312a7b54dcd85139b243ff688b7da737ab4 /revision.h | |
parent | 24703ead4b9391cbe71ce9978cbffdd6c3ecbaec (diff) | |
parent | 838f9a15667cfefa9e645c26627ce81ce7599915 (diff) | |
download | git-4ab4a6dfb414230bb3e13ba65a1aa2606c6102f3.zip git-4ab4a6dfb414230bb3e13ba65a1aa2606c6102f3.tar.gz git-4ab4a6dfb414230bb3e13ba65a1aa2606c6102f3.tar.bz2 |
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
Diffstat (limited to 'revision.h')
-rw-r--r-- | revision.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -25,6 +25,7 @@ struct rev_info; struct log_info; struct string_list; +struct saved_parents; struct rev_cmdline_info { unsigned int nr; @@ -187,6 +188,9 @@ struct rev_info { /* line level range that we are chasing */ struct decoration line_log_data; + + /* copies of the parent lists, for --full-diff display */ + struct saved_parents *saved_parents_slab; }; #define REV_TREE_SAME 0 @@ -273,4 +277,20 @@ typedef enum rewrite_result (*rewrite_parent_fn_t)(struct rev_info *revs, struct extern int rewrite_parents(struct rev_info *revs, struct commit *commit, rewrite_parent_fn_t rewrite_parent); + +/* + * Save a copy of the parent list, and return the saved copy. This is + * used by the log machinery to retrieve the original parents when + * commit->parents has been modified by history simpification. + * + * You may only call save_parents() once per commit (this is checked + * for non-root commits). + * + * get_saved_parents() will transparently return commit->parents if + * history simplification is off. + */ +extern void save_parents(struct rev_info *revs, struct commit *commit); +extern struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit); +extern void free_saved_parents(struct rev_info *revs); + #endif |