rscherf / GitLink

Open your Sublime Text files on GitHub, Bitbucket, Gitlab or Codebase
http://ryan.sc
35 stars 25 forks source link

Add argument to choose revision type #29

Closed joseramonc closed 1 year ago

joseramonc commented 2 years ago

Hey! I added the configuration as described in #28. Opted to go back to the old default (branch), however not sure if this would be expected. However, we can easily change to the current default commithash. Let me know your thoughts.

rscherf commented 2 years ago

Hey @joseramonc. I'm not all that opinionated on this, but I know @guilhermeleobas worked on the previous PR which was the old default. Perhaps you two could discuss for an optimal solution?

braver commented 2 years ago

Direct linking to a commit hash was completely unexpected to me, and the first thing I immediately wanted to change about this package. If I'm on a detached head, sure, but normally I think in terms of branches, not individual commit hashes. So, yeah, to me the old default was the right default.

michaelblyons commented 2 years ago

Direct linking to a commit hash was completely unexpected to me,

I am conflicted: Using commit hash is The Way ™️ to unambiguously link someone to exactly what you're seeing.

But most of the time, I'm working on stuff that hasn't been pushed and I want to link a coworker to the lines that relate to their problem. I'm not thrilled about pushing my messy work to remote, just to link someone to some other part of the codebase that I'm not working on. I guess I could stash, detach HEAD and link them.

Also, if you're on a branch that has no remote configured, GitLink can't decide what remote to use and just logs an error. I thought the package was broken.

rscherf commented 2 years ago

So it sounds like consensus for those that have responded is that it should be the branch, and not commithash, as this PR implements. Is that correct? If so, I will merge it. Speak now or forever live on your own fork!

danilokleber commented 1 year ago

I guess you can merge it as the solution provides a way to choose what better suits the user.