Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : force link on default branch #307

Open
mfillon opened this issue Jul 10, 2023 · 1 comment
Open

Feature Request : force link on default branch #307

mfillon opened this issue Jul 10, 2023 · 1 comment

Comments

@mfillon
Copy link

mfillon commented Jul 10, 2023

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.

@remarkov
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants