Merge branch 'rs/line-log-until' into master

"git log -Lx,y:path --before=date" lost track of where the range
should be because it didn't take the changes made by the youngest
commits that are omitted from the output into account.

* rs/line-log-until:
  revision: disable min_age optimization with line-log
This commit is contained in:
Junio C Hamano
2020-07-09 14:00:42 -07:00
2 changed files with 10 additions and 1 deletions

View File

@ -1410,7 +1410,8 @@ static int limit_list(struct rev_info *revs)
continue; continue;
break; break;
} }
if (revs->min_age != -1 && (commit->date > revs->min_age)) if (revs->min_age != -1 && (commit->date > revs->min_age) &&
!revs->line_level_traverse)
continue; continue;
date = commit->date; date = commit->date;
p = &commit_list_insert(commit, p)->next; p = &commit_list_insert(commit, p)->next;

View File

@ -240,10 +240,12 @@ test_expect_success 'setup for checking line-log and parent oids' '
EOF EOF
git add file.c && git add file.c &&
test_tick && test_tick &&
first_tick=$test_tick &&
git commit -m "Add func1() and func2() in file.c" && git commit -m "Add func1() and func2() in file.c" &&
echo 1 >other-file && echo 1 >other-file &&
git add other-file && git add other-file &&
test_tick &&
git commit -m "Add other-file" && git commit -m "Add other-file" &&
sed -e "s/F1/F1 + 1/" file.c >tmp && sed -e "s/F1/F1 + 1/" file.c >tmp &&
@ -283,4 +285,10 @@ test_expect_success 'parent oids with parent rewriting' '
test_cmp expect actual test_cmp expect actual
' '
test_expect_success 'line-log with --before' '
echo $root_oid >expect &&
git log --format=%h --no-patch -L:func2:file.c --before=$first_tick >actual &&
test_cmp expect actual
'
test_done test_done