summaryrefslogtreecommitdiff
path: root/revision.h
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2013-03-28 16:47:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-28 17:29:10 (GMT)
commitc7edcae06ed90ec0567179a78d7d1170e610c042 (patch)
treea92f6dca1bc4e9b3309d9491e15d379ac6b3b535 /revision.h
parent25ed3412f86b136efb17689b6712d9e546cac388 (diff)
downloadgit-c7edcae06ed90ec0567179a78d7d1170e610c042.zip
git-c7edcae06ed90ec0567179a78d7d1170e610c042.tar.gz
git-c7edcae06ed90ec0567179a78d7d1170e610c042.tar.bz2
Export rewrite_parents() for 'log -L'
The function rewrite_one is used to rewrite a single parent of the current commit, and is used by rewrite_parents to rewrite all the parents. Decouple the dependence between them by making rewrite_one a callback function that is passed to rewrite_parents. Then export rewrite_parents for reuse by the line history browser. We will use this function in line-log.c. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
-rw-r--r--revision.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/revision.h b/revision.h
index 5da09ee..640110d 100644
--- a/revision.h
+++ b/revision.h
@@ -241,4 +241,14 @@ enum commit_action {
extern enum commit_action get_commit_action(struct rev_info *revs, struct commit *commit);
extern enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit);
+enum rewrite_result {
+ rewrite_one_ok,
+ rewrite_one_noparents,
+ rewrite_one_error
+};
+
+typedef enum rewrite_result (*rewrite_parent_fn_t)(struct rev_info *revs, struct commit **pp);
+
+extern int rewrite_parents(struct rev_info *revs, struct commit *commit,
+ rewrite_parent_fn_t rewrite_parent);
#endif