Skip to content

[Feature Request] Add option for symlink compare scheme #221

@luochen1990

Description

@luochen1990

Currently, when using icdiff -r for comparison, if there are symbolic links within subdirectories, it recursively follows these symbolic links to compare the files and subdirectories they point to. I would like an option to control this behavior—specifically, to choose whether to compare only the symbolic links themselves when encountered, or to follow the symbolic links and compare the contents of the files they point to.

To illustrate the necessity of this mode, let's consider a more specific scenario: when two symbolic links actually point to different files, but their contents are identical, should we consider them as the same or different?

Here is the reproduction method:

cd ~
mkdir a
mkdir b
echo "xxx" > test-a.txt
echo "xxx" > test-b.txt
ln -s ~/test-a.txt a/test.txt
ln -s ~/test-b.txt b/test.txt
icdiff -r a/ b/

Currently, under the existing strategy, icdiff -r treats two symbolic links pointing to different locations but with identical file contents as being the same rather than showing a difference, which often goes against intuition.

Related: https:github.com//issues/177

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions