Commit aaacd64
committed
blame: consult diff process for no-hunk detection
When a diff process is configured via diff.<driver>.process,
consult it during blame's per-commit diffing. If the process
returns no hunks for a commit's changes to a file, treat the
commit as having no changes, causing blame to attribute lines
to earlier commits.
The consultation happens at the pass_blame_to_parent() callsite
using diff_process_fill_hunks(), matching how builtin_diff() in
diff.c uses the same function. A new diff_hunks_xpp() variant
accepts a pre-populated xpparam_t so callers can pass external
hunks, while the existing diff_hunks() retains its original
signature and behavior. The copy-detection callsite is
unaffected since it does not use the diff process.
The subprocess is long-running (one startup cost amortized
across the blame traversal), but each commit in the file's
history incurs a round-trip to the tool.
Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>1 parent 9225ca2 commit aaacd64
2 files changed
Lines changed: 32 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
317 | | - | |
318 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
319 | 322 | | |
320 | | - | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
324 | | - | |
325 | 326 | | |
326 | 327 | | |
327 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
| |||
1943 | 1953 | | |
1944 | 1954 | | |
1945 | 1955 | | |
| 1956 | + | |
1946 | 1957 | | |
1947 | 1958 | | |
1948 | 1959 | | |
| |||
1961 | 1972 | | |
1962 | 1973 | | |
1963 | 1974 | | |
1964 | | - | |
1965 | | - | |
1966 | | - | |
1967 | | - | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
1968 | 1990 | | |
1969 | 1991 | | |
1970 | 1992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | 450 | | |
466 | 451 | | |
467 | 452 | | |
| |||
566 | 551 | | |
567 | 552 | | |
568 | 553 | | |
| 554 | + | |
569 | 555 | | |
0 commit comments