Skip to content

[feature request] Support links at commit #8

@raghavan-arvind

Description

@raghavan-arvind

If I have a certain commit checked out locally, I would like for this plugin to copy/open the link at that commit, if possible.

Two cases:

  1. The commit checked out locally is a branch which exists in the remote, v1.2.x
  2. The commit checked out locally does not exist in remote

In case 1), my proposal would be we attempt to generate link using the correct branch name, .../v1.2.x/... for readability when sending links, instead of the full commit. Find a solution which generalizes to handle main/master elegantly.

For case 2), proposal is we take merge-base between the current commit and main/master, and generate the link with this commit .../<commit>/.... Still possible for the link to point to an invalid range, but then it is on the user to ensure the code they are referencing is unchanged between the closest reference point in origin / their HEAD.

Any thoughts/concerns? If not, I can work on a PR for this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions