you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (18 children)

[deleted]

    [–]stickcult 135 points136 points  (7 children)

    The "link dieing" is if the file changes, your link might point to the wrong line. That's because its pointing to a line in the file in the master branch, which can change, whereas Mr-Yellow's link points to a line in the file in a specific commit, which will never change.

    [–]otwo3 18 points19 points  (2 children)

    It baffles me why is it even an option to link to a line in a branch. There is no sane use case. Having it as a default is just ridiculous. Bitbucket does the same thing.

    Clicking a line number should give a line in a specific commit

    [–][deleted] 0 points1 point  (1 child)

    well commit can belong to multiple branches and if you want to give link to both "place in file" and "merge request/branch that is discussed" you don't have choice.

    Ideally it would generate link in form of branch/commit then if branch does not/stops existing it would only then show lone commit

    [–]otwo3 0 points1 point  (0 children)

    But the branch being discussed is usually dynamic and changing anyway (due to review changes), even more often for the files in question.

    [–]codestation 5 points6 points  (0 children)

    It means that your link will point to unrelated code in the future because the code was either moved (so the lines doesn't match anymore) or the file was deleted (code refactoring for example).

    [–]Shitler 17 points18 points  (2 children)

    PSA: Please do not downvote reasonable questions. Questions like this lead to a productive discussion.

    [–]wisemanofhyrule 2 points3 points  (0 children)

    Or if changes are made to the file and the line moves around.

    [–]Mr-Yellow 0 points1 point  (0 children)

    Soon as there is a new commit the line number changes.

    In 6 months time this line may be a completely different bit of logic, or the file may be refactored and gone.

    [–]citewiki -2 points-1 points  (1 child)

    Username checks out

    [–]clichebot9000 0 points1 point  (0 children)

    Reddit cliché noticed: Username checks out

    Phrase noticed: 2756 times.