GitLink icon indicating copy to clipboard operation
GitLink copied to clipboard

Add argument to choose revision type

Open joseramonc opened this issue 2 years ago • 4 comments

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.

joseramonc avatar Mar 30 '22 06:03 joseramonc

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?

rscherf avatar Mar 31 '22 14:03 rscherf

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.

braver avatar Aug 23 '22 06:08 braver

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.

michaelblyons avatar Aug 25 '22 18:08 michaelblyons

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!

rscherf avatar Aug 28 '22 22:08 rscherf

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

danilokleber avatar Mar 21 '23 14:03 danilokleber