Miklos Vajna
304812ed33
log: improve --follow following renames for non-linear history
...
Have a repo with a subtree merge, do a 'git log --follow prefix/test.c',
the output only contains history in the outer repo, not commits that
were merged via a subtree merge.
What happens is that 'git log --follow' stores the followed path only in
opt->diffopt.pathspec, so in case the commit history is non-linear, and
multiple parents have renames to the followed path, then the end result
isn't really defined: the first commit that happens to be visited in one
of the parents update opt->diffopt.pathspec, and from that point, only
that updated path is visited.
Fix the problem by introducing a commit -> path map
(follow_pathspec_slab) that stores what will be a path to follow when
visiting that parent. At the top of log_tree_commit(), if the slab has
an entry for this commit, we replace opt->diffopt.pathspec with a path
from this entry, so the correct path is followed, even if an unrelated
sub-tree changed the path to be followed to something else. After
log_tree_diff() runs, we record each parent's path in the slab. As a
result, the walk order doesn't matter, which was exactly the source of
problems previously.
This helps with subtree merges (rename happens inside the merge commit),
but also fixes the general case when the rename happens in the history
of parents, not in the merge commit itself.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2026-06-22 05:45:09 -07:00
..
2026-06-22 05:45:09 -07:00
2025-11-06 09:58:56 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:03 -07:00
2026-06-21 16:41:38 -07:00
2026-06-15 07:42:00 -07:00
2025-01-21 12:56:10 -08:00
2026-05-25 20:05:44 +09:00
2025-07-07 13:45:00 -07:00
2026-01-09 06:15:31 -08:00
2026-04-27 14:50:54 +09:00
2025-03-01 10:26:15 -08:00
2025-04-16 07:30:30 -07:00
2026-05-11 10:05:54 +09:00
2026-06-17 11:10:11 -07:00
2026-06-02 18:13:12 +09:00
2025-01-21 12:56:06 -08:00
2025-11-17 09:31:59 -08:00
2026-03-10 06:17:59 -07:00
2026-05-16 22:21:37 +09:00
2025-06-18 13:53:34 -07:00
2026-06-11 04:31:19 -07:00
2023-05-05 14:28:03 -07:00
2024-07-23 11:02:52 -07:00
2025-01-21 12:56:06 -08:00
2026-06-16 09:01:03 -07:00
2025-04-16 07:30:29 -07:00
2026-02-05 21:14:05 -08:00
2026-05-25 20:05:44 +09:00
2026-05-25 20:05:44 +09:00
2026-01-12 06:55:41 -08:00
2024-12-07 07:52:13 +09:00
2026-02-06 09:43:26 -08:00
2026-05-25 20:05:44 +09:00
2025-01-21 12:56:06 -08:00
2026-05-25 20:05:44 +09:00
2025-01-21 12:56:06 -08:00
2026-04-08 11:13:52 -07:00
2026-05-24 18:41:06 +09:00
2025-01-21 12:56:06 -08:00
2026-05-25 20:05:44 +09:00
2026-01-09 06:15:53 -08:00
2025-05-05 10:48:07 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-04-15 20:42:08 -07:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2026-04-29 21:46:03 +09:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-02-25 11:54:17 -08:00
2025-06-01 17:20:16 -07:00
2026-05-08 10:22:33 +09:00
2025-01-21 12:56:06 -08:00
2025-11-14 08:56:35 -08:00
2026-06-11 12:08:17 -07:00
2025-10-14 13:40:54 -07:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-05-12 09:25:26 -07:00
2026-04-06 09:38:19 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-03 08:17:47 -08:00
2025-01-21 12:56:06 -08:00
2025-05-22 14:20:11 -07:00
2026-04-06 09:38:18 -07:00
2025-07-09 16:08:29 -07:00
2026-03-26 12:42:57 -07:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:37 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-25 14:22:02 -07:00
2025-01-21 12:56:06 -08:00
2026-06-05 22:44:36 +09:00
2026-06-05 22:27:24 +09:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2026-04-15 08:44:33 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2026-05-25 20:05:44 +09:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-04-27 22:20:57 +09:00
2026-05-22 09:36:20 +09:00
2025-02-14 17:53:49 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2026-05-25 20:05:45 +09:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-09-10 13:34:58 -07:00
2025-01-21 12:56:06 -08:00
2026-03-16 15:04:37 -07:00
2026-01-20 14:13:04 -08:00
2026-04-28 09:46:26 +09:00
2026-05-13 10:25:52 +09:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-10 09:28:48 -08:00
2025-01-21 12:56:06 -08:00
2026-02-07 17:04:26 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-10 12:51:46 -07:00
2025-07-14 11:19:28 -07:00
2025-01-21 12:56:06 -08:00
2025-05-27 07:51:01 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-05-20 11:31:13 +09:00
2025-04-14 14:43:52 -07:00
2025-01-21 12:56:06 -08:00
2025-05-27 15:31:08 -07:00
2025-08-11 14:16:03 -07:00
2026-05-24 18:41:07 +09:00
2025-01-21 12:56:06 -08:00
2025-09-19 10:02:56 -07:00
2026-02-17 10:49:51 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-14 17:04:37 +09:00
2026-05-04 10:11:17 +09:00
2025-01-21 12:56:06 -08:00
2026-05-31 10:00:39 +09:00
2025-08-11 14:16:04 -07:00
2026-03-06 13:02:20 -08:00
2025-05-20 11:43:36 -07:00
2025-08-06 07:36:30 -07:00
2025-10-02 12:26:12 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-21 11:33:10 +09:00
2026-05-20 11:31:14 +09:00
2026-05-08 10:22:33 +09:00
2026-04-01 21:34:25 -07:00
2026-03-16 10:48:14 -07:00
2025-01-21 12:56:06 -08:00
2026-04-16 21:22:01 -07:00
2026-01-06 08:10:14 +09:00
2026-05-19 09:57:45 +09:00
2025-01-21 12:56:06 -08:00
2025-10-22 11:38:58 -07:00
2025-01-21 12:56:06 -08:00
2025-04-14 14:43:52 -07:00
2026-03-12 10:56:05 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-04-06 09:38:19 -07:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2026-02-05 21:14:05 -08:00
2026-06-08 00:21:35 +09:00
2025-12-21 11:33:10 +09:00
2026-04-29 21:46:02 +09:00
2025-12-21 11:33:10 +09:00
2025-05-27 15:31:05 -07:00
2026-02-05 21:14:05 -08:00
2026-05-13 10:25:52 +09:00
2026-04-29 21:46:03 +09:00
2025-01-21 12:56:06 -08:00
2025-10-28 10:29:09 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2026-01-23 13:34:35 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2026-05-06 09:48:29 +09:00
2026-04-06 09:57:07 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-04-07 14:39:27 -07:00
2025-01-21 12:56:06 -08:00
2025-09-17 13:47:24 -07:00
2026-02-09 12:09:10 -08:00
2025-05-12 09:25:26 -07:00
2026-03-16 10:48:14 -07:00
2026-04-15 08:43:33 -07:00
2025-11-04 09:25:51 -08:00
2025-01-21 12:56:06 -08:00
2025-10-15 10:29:35 -07:00
2026-04-06 09:57:07 -07:00
2025-12-03 00:17:07 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-01-16 12:40:27 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-05-13 10:25:52 +09:00
2026-02-07 17:41:03 -08:00
2026-02-24 11:16:33 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-03-16 21:00:44 -07:00
2026-05-13 10:25:52 +09:00
2025-10-14 13:40:53 -07:00
2025-01-21 12:56:06 -08:00
2026-04-16 21:22:01 -07:00
2025-01-21 12:56:06 -08:00
2026-05-12 10:36:18 +09:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-11-06 09:45:38 -08:00
2026-03-02 21:35:05 -08:00
2026-05-11 10:05:53 +09:00
2025-07-14 11:19:22 -07:00
2025-03-05 07:25:11 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:03 -07:00
2025-01-21 12:56:06 -08:00
2026-04-06 09:57:07 -07:00
2025-03-10 09:58:06 -07:00
2025-08-11 14:16:03 -07:00
2025-01-21 12:56:06 -08:00
2026-04-13 11:50:06 -07:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-07-07 13:45:00 -07:00
2026-05-29 14:06:21 +09:00
2025-08-11 14:16:03 -07:00
2025-08-11 14:16:04 -07:00
2026-01-21 08:26:00 -08:00
2025-01-21 12:56:06 -08:00
2025-12-05 14:49:56 +09:00
2023-05-10 10:23:29 -07:00
2025-11-19 15:00:42 -08:00
2025-05-27 07:51:00 -07:00
2026-05-21 12:06:48 +09:00
2026-02-13 13:39:26 -08:00
2025-06-25 14:07:35 -07:00
2025-01-21 12:56:06 -08:00
2025-09-19 10:02:56 -07:00
2026-03-23 13:06:58 -07:00
2025-10-05 16:10:53 -07:00
2025-11-24 10:55:48 -08:00
2025-01-21 12:56:06 -08:00
2026-04-08 07:18:56 -07:00
2026-02-10 12:27:07 -08:00
2025-07-07 13:45:00 -07:00
2026-06-16 09:01:02 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-16 09:42:44 +09:00
2025-01-21 12:56:06 -08:00
2025-12-19 21:51:01 +09:00
2026-06-15 07:42:00 -07:00
2025-03-10 09:58:06 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:42 -08:00
2025-01-21 12:56:06 -08:00
2026-04-06 09:57:07 -07:00