Skip to content

test: add tests for symlinks in gix-blame - #2906

Merged
Sebastian Thiel (Byron) merged 2 commits into
GitoxideLabs:mainfrom
cruessler:add-gix-blame-tests-with-symlinks
Aug 13, 2026
Merged

test: add tests for symlinks in gix-blame#2906
Sebastian Thiel (Byron) merged 2 commits into
GitoxideLabs:mainfrom
cruessler:add-gix-blame-tests-with-symlinks

Conversation

@cruessler

Copy link
Copy Markdown
Contributor

This PR adds dedicated tests for symlinks in gix-blame. None of the tests required any code changes to make them pass. This is based on a TODO mentioned in this comment.

I think the TODO comment can potentially be removed. We might also want to change it to highlight the fact that we force set_resource to treat symlinks as blobs by unconditionally passing EntryKind::Blob. As far as I can tell at least, set_resource does not check on its own whether an object is a symlink, but trusts its caller.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7047944e4d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

Comment thread gix-blame/tests/fixtures/make_blame_symlinks_repo.sh
@Byron
Sebastian Thiel (Byron) force-pushed the add-gix-blame-tests-with-symlinks branch from 7047944 to 31a98ed Compare August 13, 2026 03:28
@Byron

Copy link
Copy Markdown
Member

Thanks a lot! It's good to see that this works, but also still a little bit surprising.

So in the interest of time, I asked Codex, so maybe there is something you can additionally poke at. In the worst case, it's more coverage. That's also why I left the comment for now.


Is there anything that you can imagine that won't work with @function.rs (767:767)?

TreeDiffChange discards both entry modes, then blob_changes() labels both resources as regular blobs. Git applies user diff drivers only to regular files, not symlinks. Consequently, gix may treat the link target as binary or converted data and assign blame differently.

The best additional regression test would be:

  • Mark one changing symlink path as -diff.
  • Create it pointing to one target.
  • Change its stored target.
  • Compare blame with Git.

File↔symlink transitions under such attributes should also be tested because each side requires a different mode. The proper eventual fix is to preserve source/destination modes in TreeDiffChange and pass their actual EntryKind into blob_changes().

@Byron
Sebastian Thiel (Byron) merged commit 0b94ca6 into GitoxideLabs:main Aug 13, 2026
32 checks passed
@cruessler

Copy link
Copy Markdown
Contributor Author

Thanks for the context! I’ve put it onto my list of things that I want to have a look at. 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants