Skip to content

Comments

Add support for git-style symlinks#188

Open
abaj8494 wants to merge 1 commit intoamake:masterfrom
abaj8494:symlink-support
Open

Add support for git-style symlinks#188
abaj8494 wants to merge 1 commit intoamake:masterfrom
abaj8494:symlink-support

Conversation

@abaj8494
Copy link

Transclusion wasn't working for paths like [[file:img/achilles.jpg]] where img is a symlink managed by GitHub (stored as a text file containing the target path).

This adds a fallback in resolveRelative that walks path components individually and follows these portable symlink files when encountered.

When resolving relative paths (e.g., for transclusion), handle the case
where intermediate path components are git "portable symlinks" - small
text files containing the target path rather than actual filesystem
symlinks. This enables proper path resolution in repositories that use
git's core.symlinks=false setting.

The implementation:
- Wraps normal path resolution in try-catch
- On failure, falls back to symlink-aware traversal
- Detects git symlinks by checking file size (<1KB) and contents
- Follows symlink targets during directory traversal
@amake
Copy link
Owner

amake commented Jan 26, 2026

Can you describe your use case a bit more?

You're right that git will store a symlink as a text file, but after checkout that should turn back into a symlink in the worktree that would, in theory, already be resolvable with current mechanisms. What app on your phone is allowing you to check out a git repository but is leaving symlinks in git's internal representation?

@abaj8494
Copy link
Author

I am using GitSync from the Play Store

@amake
Copy link
Owner

amake commented Jan 26, 2026

I don't think it makes a lot of sense to make Orgro understand something git-specific. It sounds like GitSync should be making actual symlinks. Have you tried discussing it with them? It looks like they accept discussions and bug reports:

https://github.com/ViscousPot/GitSync/

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