Closed vmiklos closed 1 year ago
@tyru could you please review this? I used to have a separate checkout just to have this plugin working and today I realized that if I work with the upstream hash, then I can use it from my normal checkout as well. :-) Thanks.
@tyru could you please comment on this? Thanks!
@tyru could you please review this? Thanks!
@tyru does this look good to you? Thanks:-)
@tyru ping, could you please review this? Thanks!
@tyru can I help somehow to get this in? Thanks.
@tyru friendly ping :-)
Giving up on this for now, just le me know if you want me to re-open this. Thanks.
I regularly hit 404 errors on GitHub with OpenGithubFile because I have some local commits around, which are not yet pushed anywhere.
The benefit of linking to commits is that line references work later (when the code gets changed on a branch), so that's wanted. At the same time, some worflows mean that you typically have small local commits, so even if the line numbers work give correct results, the opened link doesn't work, as it tries to look up a local hash, not the upstream hash.
Fix the problem by adding a new 'always_use_upstream_commit_hash' option (disabled by default), so in case it's known that the line numbers will work in practice (consider a large codebase, and only a few, small local commits), then this way we can get working URLs.
This is disabled by default, since in case there are many large commits and the inspected part of the file is different locally vs upstream, then this will give garbage results, so it's not safe in general.