sshaw / git-link

Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location
399 stars 74 forks source link

Added git-link-latest-commit #31

Closed calebmeyer closed 8 years ago

calebmeyer commented 8 years ago

Rationale: My code review workflow where I work requires that we provide a link to a single commit for each change we make. That means you make the change, commit it, push it up to your dev branch, and then add a link of the commit to the code review.

I couldn't find anywhere in magit that automatically displays the hash of the latest commit. This function allows me to simply get a link to the latest commit copied to my kill-ring (and therefore my system clipboard).

Implementation: I tried to follow exactly the conventions already established. The only change from git-link-commit is that we use the (git-link-last-commit) to get the commit hash.

sshaw commented 8 years ago

Hi @calebmeyer, thanks for the pull request and sorry it to so long to reply.

Can't one already achieve what you've described by setting the git-link-use-commit option to t?

Support for Git Time Machine has also been added.

Let me know if these suffice.

calebmeyer commented 8 years ago

Yeah, those will work. Thanks!