What's with these seemingly-broken files within source-code listings? #122433
-
Select Topic AreaQuestion BodyI've found source-code listings (nothing to do with anything that I've made) that show files/folders that seem invalid, meaning that they merely show an arrow pointing to a name and then an '@' followed by a hex-address, and when clicked on, they take you to a "404" webpage error page. So what's up with these entries? What do they mean and is there some secret to getting them to work as originally designed, meaning to open them up somehow? A specific great example of this issue is found throughout THIS particular webpage source-code directory listing on github: https://github.com/termux/termux-x11/tree/master/app/src/main/cpp I've tried to search for things that might discuss this but had no luck finding anything relavent. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Those are not simple files/folders, but submodules. You can read more about submodules here, but basically you can think of them as a "repository inside a repository". They point to the URL that they should be cloned from, and also the commit that they should be set to (this is the The Interestingly, the submodules that seem to 404 are not hosted on GitHub (many of these submodules point to repos on GitLab). When accessing them, you're not linked to the GitLab repo, but a similarly named GitHub repo, it seems. These 404 because they don't actually exist on GitHub, only on their original host. I'm not sure about the exact reason why, but my guess is that GitHub intentionally tries to "clean" the URLs and convert them to GitHub URLs to prevent users from accidentally accessing an external, untrusted site. It looks like GitHub recognizes this a bit, because clicking on the submodules that link to non-existent GitHub repos doesn't do anything for me. I have to explicitly open the link in a new tab, so I believe that the default click behavior is getting prevented. |
Beta Was this translation helpful? Give feedback.
-
Thank you! That is some really helpful information that, being relatively
new to GitHub, I couldn't seem to find anything about via simply trying to
figure out some way to search for it. :)
…On Mon, May 6, 2024, 7:28 AM Spenser Black ***@***.***> wrote:
Those are not simple files/folders, but submodules. You can read more
about submodules here
<https://git-scm.com/book/en/v2/Git-Tools-Submodules>, but basically you
can think of them as a "repository inside a repository". They point to the
URL that they should be cloned from, and also the commit that they should
be set to (this is the @ SHA you're seeing).
The .gitmodules file will list all submodules. Here's termux-x11's
.gitmodules
<https://github.com/termux/termux-x11/blob/5489f7c8726855cd55729660c2867139aa2a5a74/.gitmodules>
.
Interestingly, the submodules that seem to 404 are *not* hosted on GitHub
(many of these submodules point to repos on GitLab). When clicking on them,
you're *not* linked to the GitLab repo, but a similarly named GitHub
repo, it seems. These 404 because they don't actually exist on GitHub, only
on their original host. I'm not sure about the exact reason why, but my
guess is that GitHub intentionally tries to "clean" the URLs and convert
them to GitHub URLs to prevent users from accidentally accessing an
external, untrusted site.
It looks like GitHub recognizes this a bit, because clicking on the
submodules that link to non-existent GitHub repos doesn't do anything for
me. I have to explicitly open the link in a new tab, so I believe that the
default click behavior is getting prevented.
—
Reply to this email directly, view it on GitHub
<#122433 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7DZFW6EA2QU3XE2RWIX6JDZA6HRJAVCNFSM6AAAAABHH6PECGVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGMZQGEYTA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Those are not simple files/folders, but submodules. You can read more about submodules here, but basically you can think of them as a "repository inside a repository". They point to the URL that they should be cloned from, and also the commit that they should be set to (this is the
@ SHA
you're seeing).The
.gitmodules
file will list all submodules. Here's termux-x11's.gitmodules
.Interestingly, the submodules that seem to 404 are not hosted on GitHub (many of these submodules point to repos on GitLab). When accessing them, you're not linked to the GitLab repo, but a similarly named GitHub repo, it seems. These 404 because they don't actually exist on GitHub, only on their original host.…