combine-diff: honor relative paths consistently
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 2 repliesIn review
- v11 patch 1 replySuperseded
Changes in v2 from the cover letter
* Use relative_path() for parent names outside the prefix while keeping ordinary diff's literal-prefix behavior for matching names.
* Preserve /dev/null, skip all boundary separators, and wrap long lines.
* Add cross-directory rename tests and the separate fast-scan fix.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | combine-diff: honor --relative when printing pathscombine-diff.c t/ t/ | +212 | 0 replies | |
| 2/2 | combine-diff: filter the fast scan by the relative prefixcombine-diff.c t/ | +39 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Junio C Hamano |
|---|---|
| 1/2 | Helped-by |
| 2/2 | Helped-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] combine-diff: honor relative paths consistently
Hi Junio,
Thanks for the review. I checked the path handling and reproduced the cross-directory rename case you described.
With plain -M, the outside source is filtered before rename detection. With --follow, though, Git searches for renames with an unfiltered tree comparison, so an outside parent name can reach the combined output. The revised patch prints there/file as ../there/file when the prefix is here/. All displayed names then use the same base. The tests cover both discovery paths, including raw and NUL-separated output.
The index rejects repeated separators, but tree entry parsing does not enforce the same check. The helper now skips all separators at the prefix boundary, so it does not rely on there being only one. Explicit prefix arguments stay literal, matching ordinary diff's filtering behavior. I also wrapped the added C lines to fit the coding guidelines.
While checking the two discovery paths, I found that the fast multi-tree scan bypasses the relative-prefix filter entirely. Patch 2 fixes that separately and adds tests for outside paths and repeated separators in an explicit prefix.
Changes since v1:
* Use relative_path() for parent names outside the prefix while keeping ordinary diff's literal-prefix behavior for matching names.
* Preserve /dev/null, skip all boundary separators, and wrap long lines.
* Add cross-directory rename tests and the separate fast-scan fix.
The developer build with SANITIZE=leak succeeds. The affected suites pass all 77 normal tests with SHA-1 and SHA-256. A separate run with LSAN_OPTIONS=detect_leaks=1 also passes without a leak report. The existing three-parent coalescing failure in t4038 remains an expected failure.
Muhammed Dilshad A (2):
combine-diff: honor --relative when printing paths
combine-diff: filter the fast scan by the relative prefix
combine-diff.c | 70 ++++++++++++++++++--- t/t4038-diff-combined.sh | 130 +++++++++++++++++++++++++++++++++++++++ t/t4045-diff-relative.sh | 62 ++++++++++++++++++- 3 files changed, 251 insertions(+), 11 deletions(-)
base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
Signature · 1 line
2.55.0