-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Incorrect Commit Hash Linking #7273
Comments
It'd also do it to deadbee feedbee dadbeef acefeed acebeef and so on... |
I guess the problem is how to detect whether these are valid short shas. I wonder if when rendering the comment GitHub is checking if the codes are valid short shas eg de9b398 should be a valid short sha but I suspect that de9b398d isn't |
What we really need is a way of telling Gitea not to process some of these things it auto processes. Personally I'd be a fan of a preceding \ but I don't know how easy that would be to implement |
Github does check if they are actual commits or not, which I think is the only real solution to this -- though that probably means some sort of DB lookup when rendering matches. Not sure if that is possible/reasonable within the current way of doing things? I know there has been an effort to avoid that. These are really a problem with blocks of existing text, and having to always edit anything that matches a pattern and actually modify the contents so it doesn't generate a link doesn't seem like a solution. |
Another workaround idea would be to only check for commit hashes in issue threads and not in regular markdown files in the repository–operating on the theory that it's less likely you'll be referring to a commit hash in your markdown files. Of course, that could be changing behavior that someone may be relying on? |
That would just trade one problem for another (and original problem would still exist in issues). Checking that the hash exists would need to be the final solution for this I think |
Yes agree, and that is the downside of auto linking in the first place :( Most people probably don't want to modify their content as it would look strange in any other context (a text file that now has a bunch of Though I think that is separate, as most of these issues are about creating links where there shouldn't be any (and pointing to a non existent commit/issue) rather than trying to disable it when it would otherwise be wanted. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
This seems to be fixed on the running build of try.gitea.io (Gitea Version: 1.10.0+dev-199-g9f58187f1)! |
Description
Gitea is linking the Croatian word for alphabet (abeceda) to a non-existent commit hash in Markdown files. For example, see https://try.gitea.io/jag3773/testing/src/branch/master/README.md . The links therein point at https://try.gitea.io/jag3773/testing/commit/abeceda .
Screenshots
The text was updated successfully, but these errors were encountered: