-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Follow file symlinks in the UI to their target #28835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Only problem at the moment is that `git.TreeEntry` does not store the full path of the entry, only the actual filename without directory.
Trivia: If we merge this, we are even ahead of GitHub in terms of behavior as GitHub still shows the |
Could you add a test for |
And the test promptly caught a bug.
However, I have no idea how to implement |
As expected, it doesn't 😒 |
After reading the code, I have some new ideas, maybe more simple to do: backend does nothing, but let frontend navigate. For example:
Otherwise, if we really would like to resolve the link in backend, I guess it needs some big refactoring to make things clear. |
@wxiaoguang the problem with the frontend approach is that the frontend cannot recursively resolve links ( |
For me, I would like to see the direct link target on the UI, instead of recursively resolving the links ahead. For example: suppose there is a link If an end user would like to follow, the frontend approach could also work: use a href like |
But what is it you want to achieve when you click on a (symlinked) file? |
I updated the previous comment, a "/bar?follow_symlink=1" trick could work IMO. |
Are you working on this at the moment? |
Description
Previously, when you clicked on a symlink, a document was opened that only displayed
<target>
.While this follows git's behavior of implementing symlinks, it is not user-friendly for users using the web UI to access a file.
Now, symlinks are resolved when you click on them, either until a file has been found or until we know that the link is dead.
When the link cannot be accessed, we fall back to the current behavior of showing the document containing the target.
Before
Screenshots
After
Obscurities
While implementing it, I noticed two weird things:
TreeEntry.getName()
of the normal version should behave likeTreeEntry.getName()
of the gogit versionOpen Questions
For now, it uses the link target to give the user an idea of where clicking on the link will lead.