GitLink icon indicating copy to clipboard operation
GitLink copied to clipboard

Feature Request : force link on default branch

Open mfillon opened this issue 1 year ago • 1 comments

Hey, thanks for this great plugin which helps a lot.

I often edit the generated link cause most of the time I want the URL to be as simple as possible and not include a commit hash or a specific branch name, so I replace the commit hash with my default branch name (main, dev, ...).

Would it be possible to either have a global config like "Generate link on default branch" or to have an extra menu option "Copy link with default branch"?

I realise that there's a risk the generated URL will be a 404 if the file doesn't exist on default branch or that the line nb will not reference the expected one.

mfillon avatar Jul 10 '23 09:07 mfillon

@ben-gibson maybe this feature may be included in the configuration like


Generate the URL using (in order of availability):

  • [ ] commit hash
  • [ ] current branch
  • [ ] default repo branch
  • [ ] custom branch name

So user can combine any of these options, like I prefer to use current branch (don't need commit hash) and if it does not exist in remote - default repo branch so I select 1 and 3. @mfillon always needs default branch so they would select only 3 etc. Hope my idea is clear enough. WDYT?

remarkov avatar Mar 14 '24 16:03 remarkov