Hacker News new | ask | show | jobs
by tirpen 1855 days ago
> Basic features, like getting a permalink to a line of code, take 3-4 clicks in GitLab, when it's just 1 in GitHub

That doesn't seem right.

In Gitlab: Right click the line number, choose Copy Link in the context menu. Two clicks.

In Github: Click the line, click the three dots, then click "Copy permalink". Three clicks. Alternatively, click the line, click the URL bar (or press F6 or ^L) copy the link. Still Three clicks.

What's the one-click method in GitHub I'm missing?

1 comments

What's different is you get functionally different links. GitLab aliases to the branch name, not the commit hash. So it isn't really a "permanent" link to a line of code. It's whatever happens to be on line N in file X on branch Y at time T, whenever you open the link. This is inconvenient when I might find an old link in an engineering Slack thread, referencing something now much different since the file was amended over time. In fact, the file may not even exist anymore.

GitHub, by default, includes the commit hash. So the line of code will be the same at any point in the future: the file, at that line number, with that commit hash, is immutable (unless developers force push history rewrites, but you get my broader point).

To do this in GitLab, click the permalink button before copying the line.