Skip to content

diff-lib relative-path cleanups

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2diff-lib: drop stale comment about advancing o->posdiff-lib.c+1 -30 replies
2/2diff-lib: skip paths outside prefix in oneway_diff()diff-lib.c+5 -05 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] diff-lib relative-path cleanups
Quoted 9 lines · Junio C Hamano
Quoted 6 lines · Jeff King

A diff using --relative ignores entries outside the current directory. This results in a segfault when we try to process an unmerged entry that's outside of our prefix, since we end up with a NULL diff_filepair and use it without checking that it's valid.
...
+cc Junio, as you may have some wisdom on that further exploration.

Quoted 3 lines

Will take a look at the history myself, but I would probably not have much wisdom on a change from 2011. I often do not even remember what I ate for breakfast yesterday ;-).

I have the same problem. ;)

Looks like you reviewed the patch in question already. Here's what I uncovered by digging into the history. I don't think it should have any functional difference (and even the "avoid unnecessary work" in patch 2 is probably not very much work in practice), but it might be worth doing.

This would go on top (even though patch 2 makes the original fix here unnecessary, I'd rather have both in place).

[1/2]: diff-lib: drop stale comment about advancing o->pos [2/2]: diff-lib: skip paths outside prefix in oneway_diff()

 diff-lib.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

-Peff