Thread (1 message) 1 message, 1 author, 2016-06-15

Re: difftool -d symlinks, under what conditions

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:22

John Keeping [off-list ref] writes:
quoted
Does it even have to be conditional?  What is the situation when you
do not want symbolic links?
When you're not comparing the working tree.
OK, so what you want is essentially:

 * If you see 0{40} in "diff --raw", you *know* you are showing the working tree
   file on the RHS, and you want to symlink, so that the edit made
   by the user will be reflected back to theh working tree copy.
 
 * If your working tree file match what is in the index, you won't
   see 0{40} but you still want to symlink, for the same reason.

 * If you are comparing two trees, and especially if your RHS is not
   HEAD, you will send everything to a temporary without
   symlinks. Any edit made by the user will be lost.

If that is the case, perhaps the safest way to go may be to write
the object out when you see non 0{40}, compare it with the working
tree version and then turn that into symlink?  That way, you not
only cover the second bullet point, but also cover half of the third
one where the user may find a bug in the RHS, update it in difftool.

I am assuming that you are write-protecting the non-symlink files in
the temporary tree (i.e. those that do not match the working tree)
to prevent users from accidentally modifying something there is no
place to save back to.

Hrm?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help