-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Allow configuring prefix for referencing Issue and PRs #9088
Comments
I think it's doable, but I wouldn't make it freely configurable. I'd chose one alternate symbol set and let the user chose between them either for issues or PRs. |
Note: I'd have a three level setting in |
I think the hash sign is quite general accepted as reference for issues. The only thing I want to add is the ability to specify if reference to an issue or pr. So I am not sure there really is a need to change what symbol to use for referencing, or if a setting is needed... Something I was positively surprised of was that Gitea already supports referring to issues in other organizations and repositories (in the format In combination with specifying repo it would be |
You're right, currently there's no way of referencing a PR in the same repo. But you've also made me just realize that the cross-repo references are completely broken when they are in or refer to a repo with external issue tracker because the repo.metas() are always taken from the repository of the rendered content. 😢 Anyway, we can allow |
I'm trying to complete this table, can you help me?
The latest section if for issues with alphanumeric format (I guess some external tracker uses that). |
I just looked in a bit on alphanumeric a bit and I don't think they work as you specified, they seem to be without hash (see regex). You have typo on row 6 (wrong repo) |
You're right. I forgot. I wrote that myself. 😋 |
I think we should have
Also I think it would be neat to support this:
But maybe that is problematic if someone fork the repo.... ? |
I don't think forks are problematic as they don't migrate issues/PRs.
The thing is that too many options will become a burden, because it limits what you can write without creating a reference (you cannot choose if the reference is created or not). References will be seen in the referenced issue/PR as a comment and can't be deleted (they will be formatted with strike through if removed). |
I don't understand why it doesn't conform to current syntax, it would still support both Regarding At least I think the style should be the same for internal and cross-references, so either
|
You've got an extra |
Sorry, that shouldn't be there. Only if you want to specify it's an PR reference you need the extra slash, so |
That's what I find hacky. But perhaps it's the best we can do. How do you feel about |
I prefer having it before, partly because Maybe the alphanumeric style should be left out from this, at last for now? It would limit that you can't refer to an alphanumeric issue on another repo, but you can still refer to both PRs and numeric issues. I'm afraid it would add to many clashes with normal written text. |
Looking at some other systems..
My opinion would be to either go for GitLab way ( Would people expect this to be localized, so instead of |
Currently it doesn't support cross-references, so it's OK for me. The problem is that once we decide for one format we won't be able to change it in the future, so we must be aware of the choices we make.
I'm not against
|
If we use a symbol I would suggest using exclamation mark as GitLab, no need to reinvent the wheel and easier for people switching to Gitea. I think we can also consider the Bitbucket way:
|
I didn't know about GitLab. The Bitbucket way seems very difficult to implement correctly. So, this?:
The last section is for repositories with external trackers that use alphanumeric format. |
So, I'm working on this based in the table above. Let's see how other people like it. 😄 |
With the localization in mind, I think the exclamation mark is the way to go. The feature will be slightly breaking. However I don't think it is common to have !1234 used for something else in markdown/text, so that might not be a problem. However there are other places where # should be replaced with !. What I can think of now is when you do Squash and Merge on a PR, then the PR number is written by default in the heading. This should be replaced ( |
Good catch. If the PR I'm working on is accepted, then what we can do is to automatically use the |
For consistency I think it would be good to have a setting to always use ! instead of # in that case. Because you might start a repository without external tracker and then switch, which would make the old commits incorrect. Also you might have different repos where only one is with external tracker then it makes sense to always use ! for PRs. |
Mmm.... I'm not so sure about that. The fact that different repos have different needs makes it so an |
You are probably right app.ini is not suitable for such setting. If needed it can maybe be repo pr unit setting. But that can be discussed once we have the possibility to use ! for pr reference 😄 |
Description
Currently hash (#) is used to reference both PRs and issues. As issues and PRs uses the same number series per repository in Gitea this is not a problem. But if you use external issue tracker all references will refer to the external site, and it is not possible to refer a PR (except with the full url).
My suggestion is to allow configuring the prefix for references issues and PRs (independently) so it is possible to distinguish them. So in addition to the default (#) you can use e.g.
Maybe anything can be allowed, but there should be some recommendation on suitable prefixes to not clash with other uses (e.g. '@' would be unsuitable).
The configuration could be made in app.ini (for site default) and per repo in settings.
Do you think this would be doable? Any comments?
The text was updated successfully, but these errors were encountered: