6 ms·
ProTip: Hit the y key on any GitHub page with source code. It'll instantly expand the URL to its canonical form, e.g. https://github.com/sass/libsass/blob/mas
by joliss 12y ago
ProTip: Hit the y key on any GitHub page with source code.
It'll instantly expand the URL to its canonical form, e.g.
https://github.com/sass/libsass/blob/master/parser.cpp#L29-L36 https://github.com/sass/libsass/blob/master/parser.cpp#L29-L...
to
https://github.com/sass/libsass/blob/fca1f75a14fe5336c7b1a4b38c69bda7fece714f/parser.cpp#L29-L36 https://github.com/sass/libsass/blob/fca1f75a14fe5336c7b1a4b...
which stays valid indefinitely (unless the commit is deleted from the repo).
P.S. Hit the ? key for more keyboard awesomeness. :)
- yuchi 12y agoThis is huge.
- mapleoin 12y agoYeah, that's what he said in the post.
- Anderkent 12y agoNot what he said in the title though. Should be "don't link to non-canonical urls on github", line numbers are irrelevant.
- lamby 12y agoWe're meant to read more than the title nowadays?
- kbenson 12y agoLike the original comment, my original thought was that it was probably something to do with people referring to line numbers on HEAD. A less link-bait title that confirmed this would have allowed me to easily skip this this article which, for my purposes, was useless.
- Alupis 12y agoThis seems glaringly obvious. If you statically link to a specific line number, and if your source code changes, then your static link may not point to the same code... duh?
- nullsoldier 12y agoI actually feel that the post isn't even just about people who don't know that linking to a line number in a changing file will result in incorrect information later. I think it's more that when people link to code, they think it doesn't matter, so it's not something they actively care about. So they don't take the extra time to link to the actual commit since it's not a thing they care about. I feel the authors real value in their article is a call for people to care about correcting their links for programmers in the future. The article would be better served to say, "Why you should care about linking in time to your GIT repo"
- kmike84 12y agoThanks! It was a pain. Especially if you've moved from Bitbucket where "stable" links to line numbers are default.
- enesunal 12y agoAnother reason to love github, thanks.
- tieTYT 12y agoWhy doesn't the URL look how it would look if you hit y by default? Seems like that would be what you usually want. When I send someone a link, it's because I want them to see what I'm looking at.
- derefr 12y agoWhen I paste a link from A (which I control) into B (which I control) , I want to be able to change A and have people who click on the link from B get the new A, not the old A. It's the same reason you ideally want to specify depedencies by branch, not by tag.