You need to sign in or sign up before continuing.
Markdown links to files that don't exist on main branch jet
When linking project-files via GithubFlavoredMarkdown there is a problem with files that don't exist on the main-brach jet, for example, when its still in a merge-request. Linking this file from a discussion in the MR will create a link to the file on the master -> HTTP404.
This is inkonvenient in discussions on a MR.
I used the Example from the docs:
repository file references | [README](doc/README.md)
I can figure out two possible solutions:
- Links in a MR could point to the associated branch instead
- This has the disadvantage that you can't link files on the main branch -> in my opinion this is not acceptable (but there might be a workaround?!)
- The ability to specify the revision/branch in file links.
- This would be more complicated to implement I think but offers a lot more power
- Examples:
-
[README](doc/README.md@9ba12248)
- Link revision -
[README](doc/README.md!123)
- Link MR (might be to special for a general solution) -
[README](doc/README.md*my-branch)
- Link Branch (*
could be any suitable delim...)
-
- (Maybe a mixture of 1&2?!)
Appending the Revision to the link would also keep backwards compatibility, when links fall back to the latest revision on the main branch if there is no revision information in the link.
Edited by Jacob Fricke