summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97b03c3)
raw | patch | inline | side by side (parent: 97b03c3)
author | Johan Herland <johan@herland.net> | |
Thu, 3 Jun 2010 23:17:37 +0000 (01:17 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 6 Jun 2010 17:16:37 +0000 (10:16 -0700) |
When using --ancestry-path together with history simplification (typically
triggered by path limiting), history simplification would get in the way of
--ancestry-path by prematurely removing the parent links between commits on
which the ancestry path calculations are made.
This patch disables this history simplification when --ancestry-path is
enabled. This is similar to what e.g. --full-history already does.
The patch also includes a simple testcase verifying that --ancestry-path
works together with path limiting.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
triggered by path limiting), history simplification would get in the way of
--ancestry-path by prematurely removing the parent links between commits on
which the ancestry path calculations are made.
This patch disables this history simplification when --ancestry-path is
enabled. This is similar to what e.g. --full-history already does.
The patch also includes a simple testcase verifying that --ancestry-path
works together with path limiting.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c | patch | blob | history | |
t/t6019-rev-list-ancestry-path.sh | patch | blob | history |
diff --git a/revision.c b/revision.c
index eb6f849cef2455b69a77b3ef6bc04cf57cbd4a69..96d7fa7f143b8680fe638e1ea69f4ec172fcedad 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -1190,6 +1190,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->first_parent_only = 1;
} else if (!strcmp(arg, "--ancestry-path")) {
revs->ancestry_path = 1;
+ revs->simplify_history = 0;
revs->limited = 1;
} else if (!strcmp(arg, "-g") || !strcmp(arg, "--walk-reflogs")) {
init_reflog_walk(&revs->reflog_info);
index 0230724ca5c00648992e228c248b5942234ab054..76410293b34ecede219445e09b1eccb8175ee115 100755 (executable)
#
# D..M == E F G H I J K L M
# --ancestry-path D..M == E F H I J L M
+#
+# D..M -- M.t == M
+# --ancestry-path D..M -- M.t == M
. ./test-lib.sh
test_cmp expect actual
'
+test_expect_success 'rev-list D..M -- M.t' '
+ echo M >expect &&
+ git rev-list --format=%s D..M -- M.t |
+ sed -e "/^commit /d" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'rev-list --ancestry-patch D..M -- M.t' '
+ echo M >expect &&
+ git rev-list --ancestry-path --format=%s D..M -- M.t |
+ sed -e "/^commit /d" >actual &&
+ test_cmp expect actual
+'
+
test_done