]> source.dussan.org Git - gitea.git/log
gitea.git
18 months agoFix pagination on `/notifications/watching` (#23564)
silverwind [Tue, 21 Mar 2023 01:07:14 +0000 (02:07 +0100)]
Fix pagination on `/notifications/watching` (#23564)

The `q` parameter was not rendered in pagination links because
`context.Pagination:AddParam` checks for existance of the parameter in
`ctx.Data` where it was absent. Added the parameter there to fix it.

18 months agoFix `.locale.Tr` function not found in delete modal (#23468)
delvh [Tue, 21 Mar 2023 00:41:57 +0000 (01:41 +0100)]
Fix `.locale.Tr` function not found in delete modal (#23468)

Caught by @wxiaoguang in
https://github.com/go-gitea/gitea/pull/23337#issuecomment-1467317742.

Additionally, there were three instances that have the same content as `templates/base/deletion_modal_actions.tmpl` but that are not intended to delete something.
Instead of renaming the template above, these instances were simply re-hard-coded again.
Renaming/improving the template above is left for future PRs.

18 months agofix submodule is nil panic (#23588)
来自村里的小螃蟹 [Mon, 20 Mar 2023 22:26:01 +0000 (06:26 +0800)]
fix submodule is nil panic (#23588)

#23587
submodule path is nil
It is panic a nil error

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
18 months ago`Publish Review` buttons should indicate why they are disabled (#23598)
Punit Inani [Mon, 20 Mar 2023 21:54:23 +0000 (03:24 +0530)]
`Publish Review` buttons should indicate why they are disabled (#23598)

Adding tooltip on "Approve" and "Review Changes" buttons. is try to do
by them self on their PR.
Resolves https://github.com/go-gitea/gitea/issues/23547
`Approve` tootip text :- "Pull request authors can’t approve their own
pull request"
`Request Changes` tooltip text:- "Pull request authors can’t request
changes on their own pull request"

Before

https://user-images.githubusercontent.com/115237/225984020-306c048f-cb9b-4dee-8929-1c74c331518b.png

After
<img width="841" alt="image"
src="https://user-images.githubusercontent.com/80308335/226445845-b5f6f6c9-f0dc-4934-a282-3b8be06417a8.png">

18 months agoImprove template error reporting (#23396)
zeripath [Mon, 20 Mar 2023 20:56:48 +0000 (20:56 +0000)]
Improve template error reporting (#23396)

There are multiple duplicate reports of errors during template rendering
due to broken custom templates.

Unfortunately the error returned here is somewhat difficult for users to
understand and it doesn't return the context of the error.

This PR attempts to parse the error returned by the template renderer to
add in some further context including the filename of the template AND
the preceding lines within that template file.

Ref #23274

---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
18 months agoPolyfill the window.customElements (#23592)
wxiaoguang [Mon, 20 Mar 2023 15:17:56 +0000 (23:17 +0800)]
Polyfill the window.customElements (#23592)

Related: #23590

Reference:
https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs

It seems that there are some users using old browsers, so the
`window.customElements` need polyfill.

The Custom Elements would help a lot for Gitea's UI problems, including:

* `<span class="js-pretty-number">`
* `<time data-format>`

So it's worth get polyfill.

---------

Co-authored-by: delvh <dev.lh@web.de>
18 months agoAdd CHANGELOG for 1.19.0 (#23583)
delvh [Mon, 20 Mar 2023 07:42:23 +0000 (08:42 +0100)]
Add CHANGELOG for 1.19.0 (#23583)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
18 months agoDisplay the version of runner in the runner list (#23490)
sillyguodong [Mon, 20 Mar 2023 02:19:40 +0000 (10:19 +0800)]
Display the version of runner in the runner list (#23490)

Close: #23489

### Change
1. Add version column to action_runner table.
2. Read the runner version from the request header, and update it in DB.
3. Display version in runner list

### Screenshot

![image](https://user-images.githubusercontent.com/33891828/225220990-98bc0158-4403-4e6c-9805-31bbbc65a802.png)

18 months agoAdd `.patch` to `attachment.ALLOWED_TYPES` (#23580)
silverwind [Sun, 19 Mar 2023 19:58:43 +0000 (20:58 +0100)]
Add `.patch` to `attachment.ALLOWED_TYPES` (#23580)

18 months agoSort Python package descriptors by version to mimic PyPI format (#23550)
Samuel FORESTIER [Sun, 19 Mar 2023 14:19:37 +0000 (14:19 +0000)]
Sort Python package descriptors by version to mimic PyPI format (#23550)

---

Hi, very naive and **untested** first time ever Go code, feel free to
reject/edit this as needed.
(PyPI actually performs "naive" string comparison too)

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
18 months agoUse `project.IconName` instead of repeated unreadable `if-else` chains (#23538)
yp05327 [Sun, 19 Mar 2023 12:44:48 +0000 (21:44 +0900)]
Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538)

The project type will be changed in
https://github.com/go-gitea/gitea/pull/23353, so the old fix
https://github.com/go-gitea/gitea/pull/23325 will not work as well.

And I also found that there were some problems in the old fix....

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
18 months agoMatch api migration behavior to web behavior (#23552)
Andrew Tomaka [Sun, 19 Mar 2023 06:29:14 +0000 (02:29 -0400)]
Match api migration behavior to web behavior (#23552)

When attempting to migrate a repository via the API endpoint comments
are always included. This can create a problem if your source repository
has issues or pull requests but you do not want to import them into
Gitea that displays as something like:

> Error 500: We were unable to perform the request due to server-side
problems. 'comment references non existent IssueIndex 4

There are only two ways to resolve this:
1. Migrate using the web interface
2. Migrate using the API including at issues or pull requests.

This PR matches the behavior of the API migration router to the web
migration router.

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix dropdown icon misalignment when using fomantic icon (#23558)
wxiaoguang [Sun, 19 Mar 2023 02:24:26 +0000 (10:24 +0800)]
Fix dropdown icon misalignment when using fomantic icon (#23558)

There are still many dropdowns using fomantic icon. For example: new
issue with issue template.

Avoid polluting the fomantic styles.

Before:

![image](https://user-images.githubusercontent.com/2114189/226101609-fa64178d-fed0-4541-bea2-72a250cb74db.png)

After:

![image](https://user-images.githubusercontent.com/2114189/226101603-9507b275-fc5b-4a55-870d-db8c4486d80a.png)

19 months agoEnable color for consistency checks diffs (#23563)
silverwind [Sun, 19 Mar 2023 01:47:47 +0000 (02:47 +0100)]
Enable color for consistency checks diffs (#23563)

Drone can display terminal colors, so force-enable it to make diffs more
readable on it.

Co-authored-by: delvh <leon@kske.dev>
19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 19 Mar 2023 00:16:17 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoFix sticky header in diff view (#23554)
silverwind [Sat, 18 Mar 2023 22:51:00 +0000 (23:51 +0100)]
Fix sticky header in diff view (#23554)

Ressurection of #23549.

Fix regression https://github.com/go-gitea/gitea/pull/23513#issuecomment-1474356817 from #23271.
The previous sticky CSS did assume the content is always 2 rows, but since that PR, it's single-row above 993px width.
Adjust the sticky offset to match and add a small tweak that hides content behind the `border-radius`.

Single row:
<img width="1264" alt="Screenshot 2023-03-17 at 21 33 05"
src="https://user-images.githubusercontent.com/115237/226034050-a04b131d-fd3f-45c0-bc72-413738a59825.png">

Double row:
<img width="1243" alt="Screenshot 2023-03-17 at 21 32 53"
src="https://user-images.githubusercontent.com/115237/226034163-2f1c6aa9-fc72-432f-bc46-9a7119da8677.png">

19 months agoFix some broken css (#23560)
wxiaoguang [Sat, 18 Mar 2023 21:53:12 +0000 (05:53 +0800)]
Fix some broken css (#23560)

1. The "close" inside "modal" are likely broken for long time
    * There is no var called `--body-color`
    * There is no `fullscreen modal`
* The `.ui.modal > .close.inside` doesn't seem to match most icons. It
only matches a few like "fork-repo-modal" or "adopt repo". Other places
are just buggy code copied again and again.
2. Convert the legacy `&:hover` LESS syntax to CSS syntax

19 months agoFix JS error on compare page (#23551)
silverwind [Sat, 18 Mar 2023 21:08:38 +0000 (22:08 +0100)]
Fix JS error on compare page (#23551)

Fix regression from #23271.
This code apparently runs on the compare page where there is no review button so check for existance of both button and content.

<img width="1226" alt="Screenshot 2023-03-17 at 21 42 47"
src="https://user-images.githubusercontent.com/115237/226040001-ec097edd-d926-4c80-9962-526f9b7eff19.png">

Fixes #23562

19 months agoUpgrade to npm lockfile v3 and explicitely set it (#23561)
silverwind [Sat, 18 Mar 2023 18:38:10 +0000 (19:38 +0100)]
Upgrade to npm lockfile v3 and explicitely set it (#23561)

`npm@8` which comes with node 16 will by default write lockfile v2
`npm@9` which comes with recent versions of node 18 and above will write
lockfile v3

To avoid incorrect lockfile v2 generation on npm v8, force npm to write
lockfile v3, so no matter which npm version the user has installed, the
same lockfile format will be generated.

References:
-
https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json#lockfileversion
- https://nodejs.org/en/download/releases

Co-authored-by: delvh <leon@kske.dev>
19 months agoFix long name ui issues and label ui issue (#23541)
Hester Gong [Sat, 18 Mar 2023 16:07:59 +0000 (00:07 +0800)]
Fix long name ui issues and label ui issue  (#23541)

This PR fixes some ui problems as mentioned in the two issues below.
1. Long file path has no word break

## Before
<img width="1357" alt="截屏2023-03-17 17 49 43"
src="https://user-images.githubusercontent.com/17645053/225873491-27c7bf9a-d5d5-4065-9e4a-ff228e935abf.png">

## After
<img width="1248" alt="截屏2023-03-17 17 51 22"
src="https://user-images.githubusercontent.com/17645053/225873562-93b87af7-9c83-43f8-aa0d-36a9174d25ac.png">
on mobile
<img width="408" alt="截屏2023-03-17 17 51 15"
src="https://user-images.githubusercontent.com/17645053/225873554-1b8c8999-1dfc-4251-a7fc-20ecd3444cb0.png">

2. Texts in labels
## Before
<img width="1219" alt="截屏2023-03-17 17 49 24"
src="https://user-images.githubusercontent.com/17645053/225873369-812b1b52-c104-4e32-988f-c3e55ad2f844.png">

## After
<img width="1259" alt="截屏2023-03-17 17 51 31"
src="https://user-images.githubusercontent.com/17645053/225873317-9717fd2c-e9e1-4a00-a27d-6bdc5933c3ca.png">
with two labels
<img width="1258" alt="截屏2023-03-17 17 51 53"
src="https://user-images.githubusercontent.com/17645053/225873323-13198192-71de-472d-8e78-6fd86ddba3d9.png">
In explore and star pages
<img width="896" alt="截屏2023-03-17 18 25 00"
src="https://user-images.githubusercontent.com/17645053/225878962-9e26e3aa-cff0-451c-9133-19f4ad1507a4.png">

<img width="913" alt="截屏2023-03-17 18 25 09"
src="https://user-images.githubusercontent.com/17645053/225878967-6adaa414-136e-43c2-87d0-7e46a0da112e.png">

3. Long name repository on creating new fork page
## Before
<img width="919" alt="截屏2023-03-17 17 50 01"
src="https://user-images.githubusercontent.com/17645053/225873723-5c4ea137-3b51-4074-a458-ef442e330ddf.png">

## After
<img width="907" alt="截屏2023-03-17 17 50 37"
src="https://user-images.githubusercontent.com/17645053/225873772-fc4a52c3-49c6-4ca6-903d-a13707f2a98b.png">

<img width="383" alt="截屏2023-03-17 17 50 48"
src="https://user-images.githubusercontent.com/17645053/225873779-6de1dfde-5c05-4ae9-89e1-85c25b3a1682.png">

Closes #23535
Closes #23534

19 months agoRemove worker-loader (#23548)
silverwind [Sat, 18 Mar 2023 04:36:32 +0000 (05:36 +0100)]
Remove worker-loader (#23548)

[`worker-loader`](https://github.com/webpack-contrib/worker-loader) is
deprecated since webpack 5 which can load workers without it now, so
remove it. I think it was already dysfunctional because the regex does
not match our current worker scripts:

```
web_src/js/features/eventsource.sharedworker.js
web_src/js/features/serviceworker.js
web_src/js/serviceworker.js
```

I did confirm that eventsource worker still loads via simple
`console.log` inside the script.

Co-authored-by: delvh <leon@kske.dev>
19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 18 Mar 2023 00:16:14 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoReturn `repository` in npm package metadata endpoint (#23539)
Zettat123 [Fri, 17 Mar 2023 18:39:19 +0000 (02:39 +0800)]
Return `repository` in npm package metadata endpoint (#23539)

Close #23444

Add `Repository` to npm package `Metadata` struct so the `repository` in
`package.json` can be stored and be returned in the endpoint.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agoFix diff detail buttons wrapping, use tippy for review box (#23271)
silverwind [Fri, 17 Mar 2023 17:24:00 +0000 (18:24 +0100)]
Fix diff detail buttons wrapping, use tippy for review box (#23271)

Fix visual regression introduced by
https://github.com/go-gitea/gitea/pull/22986.

Before:
<img width="1277" alt="image"
src="https://user-images.githubusercontent.com/115237/222792814-d70c2173-0c7c-4db2-8839-95be63cdc8ee.png">
<img width="649" alt="image"
src="https://user-images.githubusercontent.com/115237/222792989-9b1f5e12-becd-40cc-b02c-e9f59a8e72a4.png">

After:
<img width="1274" alt="image"
src="https://user-images.githubusercontent.com/115237/222792769-e7a9702f-4b6a-46c4-9385-da103ed4dff0.png">
<img width="565" alt="image"
src="https://user-images.githubusercontent.com/115237/222793084-6de6482b-11dc-4d38-b514-15884d20e140.png">

19 months agoDo not store user projects as organization projects (#23353)
yp05327 [Fri, 17 Mar 2023 13:07:23 +0000 (22:07 +0900)]
Do not store user projects as organization projects (#23353)

A part of https://github.com/go-gitea/gitea/pull/22865

At first, I think we do not need 3 ProjectTypes, as we can check user
type, but it seems that it is not database friendly.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
19 months agoImrove scroll behavior to hash issuecomment(scroll position, auto expand if file...
Hester Gong [Fri, 17 Mar 2023 10:24:18 +0000 (18:24 +0800)]
Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513)

Close #23466

Right now on pull request "files Changed" tab, if a file is viewed, when
the comments' links are visited, the comment will not be shown as the
file is folded after viewed. This PR is to improve the behavior, to make
the comment seen even the related file is folded, like on github.

And right now scroll position will be remembered and hence it won’t
scroll to hashed comment after refreshing, this PR also adjust the
scroll position remembering behavior: When there is hash comment in url,
do not remember the scroll position.

Before:

https://user-images.githubusercontent.com/17645053/225512079-6cf79581-9346-44cf-95d6-06919642e6a8.mov

After:

https://user-images.githubusercontent.com/17645053/225523753-3f6728f2-977b-4ed0-a65c-63dcef2ace80.mov

Update - long comment's behavior after using `scrollTop ` (Comment div
scroll to the position which is 30px below the diff header, or 30px
below top on conversation tab):

https://user-images.githubusercontent.com/17645053/225614460-0602c1a6-229c-41f4-84d2-334e78251486.mov

19 months agoIncrease horizontal page padding (#23507)
silverwind [Fri, 17 Mar 2023 06:23:23 +0000 (07:23 +0100)]
Increase horizontal page padding (#23507)

Add a bit more empty space on left and right side of page content for a
more pleasant viewing experience. Also tweaked the mobile navbar to
match.

Before:
<img width="1276" alt="Screenshot 2023-03-16 at 00 58 23"
src="https://user-images.githubusercontent.com/115237/225473942-f544106f-1b61-456a-99fb-3ba136cabc8d.png">

After:
<img width="1270" alt="Screenshot 2023-03-16 at 00 58 37"
src="https://user-images.githubusercontent.com/115237/225473959-8b555359-a08d-48e1-9476-2710aabb1166.png">

Mobile Navbar:
<img width="673" alt="Screenshot 2023-03-16 at 01 05 12"
src="https://user-images.githubusercontent.com/115237/225473966-adccef2b-4d34-44ed-8c75-d4ca46d96cf3.png">

19 months agoUpdate JS dependencies, Require Node.js 16 (#23528)
silverwind [Fri, 17 Mar 2023 05:45:45 +0000 (06:45 +0100)]
Update JS dependencies, Require Node.js 16 (#23528)

- Update all JS dependencies
- Require Node.js 16 as dictated by `esbuild-loader`
- Regenerate SVG
- Adapt to `esbuild-loader` breaking changes
- Minor refactor in `webpack.config.js`
- Tested build, monaco and swagger-ui

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoUse octicon-verified for gpg signatures (#23529)
silverwind [Fri, 17 Mar 2023 05:12:40 +0000 (06:12 +0100)]
Use octicon-verified for gpg signatures (#23529)

Before:
<img width="292" alt="Screenshot 2023-03-16 at 23 40 47"
src="https://user-images.githubusercontent.com/115237/225768871-43e11ced-e340-4c88-b756-25f9f7076fd2.png">
<img width="288" alt="Screenshot 2023-03-16 at 23 51 05"
src="https://user-images.githubusercontent.com/115237/225770071-b51f3ed6-ef14-421b-a5bc-6a26e808d404.png">

After:
<img width="291" alt="Screenshot 2023-03-16 at 23 40 37"
src="https://user-images.githubusercontent.com/115237/225768864-ea4956c7-8c57-4148-9d89-c818991a7538.png">
<img width="281" alt="image"
src="https://user-images.githubusercontent.com/115237/225769978-0b9c6c52-9a13-4c23-b13e-8a8a692abf43.png">

19 months agoRemove stars in dashboard repo list (#23530)
yp05327 [Fri, 17 Mar 2023 04:43:58 +0000 (13:43 +0900)]
Remove stars in dashboard repo list (#23530)

Discussion is here: https://github.com/go-gitea/gitea/pull/22816

19 months agoUse `<nav>` instead of `<div>` in the global navbar (#23125)
delvh [Fri, 17 Mar 2023 03:52:44 +0000 (04:52 +0100)]
Use `<nav>` instead of `<div>` in the global navbar (#23125)

Furthermore improved/deleted some comments in the template.
The appearance did not change.

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem...
wxiaoguang [Fri, 17 Mar 2023 03:08:05 +0000 (11:08 +0800)]
Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450)

This PR is extracted from #23346 to address some unclear (I don't
understand) code-belonging concerns.

This PR needs to be backported, otherwise the `aria.js` is too buggy in
some cases. Since there would be two minor conflicts, I will do the
backport manually.

Before: the `aria.js` is still buggy in some cases.

After: tested with AppleVoice, Android TalkBack

* Fix incorrect dropdown init code
* Fix incorrect role element (the menu role should be on the `$menu`
element, but not on the `$focusable`)
* Fix the focus-show-click-hide problem on mobile. Now the language menu
works as expected
* Fix incorrect dropdown template function setting
* Clarify the logic in aria.js
* Hide item's tippy after menu gets hidden
* Fix incorrect tippy `setProps` after `destroy`
* Fix UI lag problem when page gets redirected during menu hiding
animation with screen reader
* Improve comments
* Implement the layout proposed by #19861

<details>

https://github.com/go-gitea/gitea/blob/d74a7efb60f94a4b8e6e5f65332f94f1be31b761/web_src/js/features/aria.md?plain=1#L38-L47

</details>

19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 17 Mar 2023 00:16:11 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoMake time tooltips interactive (#23526)
silverwind [Thu, 16 Mar 2023 20:40:56 +0000 (21:40 +0100)]
Make time tooltips interactive (#23526)

Fixes https://codeberg.org/forgejo/forgejo/issues/511

<img width="379" alt="Screenshot 2023-03-16 at 20 23 10"
src="https://user-images.githubusercontent.com/115237/225731294-4c6e4f44-bdcc-4c8c-86e2-49f7c03b377d.png">

19 months agoUpdate mini-css-extract-plugin, remove postcss (#23520)
silverwind [Thu, 16 Mar 2023 19:06:53 +0000 (20:06 +0100)]
Update mini-css-extract-plugin, remove postcss (#23520)

Follow-up and proper fix for
https://github.com/go-gitea/gitea/pull/23504

Update to
[mini-css-extract-plugin@2.7.4](https://github.com/webpack-contrib/mini-css-extract-plugin/releases/tag/v2.7.4)
which fixes our specific issue described in
https://github.com/webpack-contrib/css-loader/issues/1503 and which
allows us to again drop the postcss dependency.

Backport of this is not necessary as I have included it in
https://github.com/go-gitea/gitea/pull/23508.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoFix review comment context menu clipped bug (#23523)
wxiaoguang [Thu, 16 Mar 2023 18:25:04 +0000 (02:25 +0800)]
Fix review comment context menu clipped bug (#23523)

This is another regression of #22959 (the first regression has been
fixed by the Image Diff fix)

Close #23517

This is a quick fix. Luckily, there is no "dropdown menu" for image/csv
view, so we could only add the "overflow-x: scroll" to the image/csv
view.

After fix:

![image](https://user-images.githubusercontent.com/2114189/225643575-9e964b4f-5543-4a69-86c2-2ffc8e40d9a6.png)

![image](https://user-images.githubusercontent.com/2114189/225643670-f0e575d0-f4af-41f4-b023-2d9ddb6462e9.png)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agoAdd absent repounits to create/edit repo API (#23500)
James Cleverley-Prance [Thu, 16 Mar 2023 17:30:42 +0000 (17:30 +0000)]
Add absent repounits to create/edit repo API (#23500)

Adds the ability to enable/disable Actions, Packages and Releases from
the API, via the Edit and Get Repository API endpoints.

19 months agoFix tags sort by creation time (descending) on branch/tag dropdowns (#23491)
Hester Gong [Thu, 16 Mar 2023 17:01:10 +0000 (01:01 +0800)]
Fix tags sort by creation time (descending) on branch/tag dropdowns  (#23491)

This PR fixes the tags sort issue mentioned in #23432
The tags on dropdown shoud be sorted in descending order of time but are
not. Because when getting tags, it execeutes `git tag sort
--sort=-taggerdate`. Git supports two types of tags: lightweight and
annotated, and `git tag sort --sort=-taggerdate` dosen't work with
lightweight tags, which will not give correct result. This PR add
`GetTagNamesByRepoID ` to get tags from the database so the tags are
sorted.

Also adapt this change to the droplist when comparing branches.

Dropdown places:

<img width="369" alt="截屏2023-03-15 14 25 39"
src="https://user-images.githubusercontent.com/17645053/225224506-65a72e50-4c11-41d7-8187-a7e9c7dab2cb.png">

<img width="675" alt="截屏2023-03-15 14 25 27"
src="https://user-images.githubusercontent.com/17645053/225224526-65ce8008-340c-43f6-aa65-b6bd9e1a1bf1.png">

19 months agoAllow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463)
Hester Gong [Thu, 16 Mar 2023 16:32:25 +0000 (00:32 +0800)]
Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463)

This PR adds the ability to search both fullname and username for
assignees, reviewers and author search boxes when the config
[`DEFAULT_SHOW_FULL_NAME`](https://github.com/go-gitea/gitea/blob/6ff5400af91aefb02cbc7dd59f6be23cc2bf7865/custom/conf/app.example.ini#L1238)
in `app.ini` is set to `true`. Which is originally raised
[here](https://projects.blender.org/infrastructure/blender-projects-platform/issues/14)
And if `DEFAULT_SHOW_FULL_NAME` is set to `false`(default value), these
search boxes will only show username.

Example:
When `DEFAULT_SHOW_FULL_NAME = true`

<img width="1220" alt="截屏2023-03-14 14 28 06"
src="https://user-images.githubusercontent.com/17645053/224914546-80ef2837-ab72-4d66-9f00-6eb77ed4baaa.png">

When `DEFAULT_SHOW_FULL_NAME = false` (default value)

<img width="1243" alt="截屏2023-03-14 14 29 37"
src="https://user-images.githubusercontent.com/17645053/224914798-f69ec8a2-0929-4330-827c-3e30188f9b47.png">

The specific search boxes that adapts these changes include:
1. Author, Assignee search boxes in pull requests tab and issues tab in
repository
<img width="1283" alt="截屏2023-03-14 14 35 01"
src="https://user-images.githubusercontent.com/17645053/224916250-8e452525-71d6-4b48-bf1c-bf7a176abaaa.png">

2. Assigee and Author on milestones issue page (Added missing search box
for author here)
<img width="1261" alt="截屏2023-03-14 14 38 20"
src="https://user-images.githubusercontent.com/17645053/224916569-d3105619-7824-4bb8-a6d0-1a600eaa9963.png">

3. Assignee on issues and PR Sidebar, Reviewer on PR Sidebar
<img width="976" alt="截屏2023-03-14 14 41 06"
src="https://user-images.githubusercontent.com/17645053/224917431-c45d821e-9660-4f58-a196-5979a0bb64ce.png">

<img width="1027" alt="截屏2023-03-14 14 41 58"
src="https://user-images.githubusercontent.com/17645053/224917290-ad4dbc52-0c20-45c4-9fce-9dcd59ad7d47.png">

4. Assignee when creating new issue
<img width="961" alt="截屏2023-03-14 14 44 33"
src="https://user-images.githubusercontent.com/17645053/224917694-34bee5a7-e975-4f37-8862-56ebc2556808.png">

5. Whitelisted users for pushing, Whitelisted users for merging and
Whitelisted reviewers in Protected branch settings
<img width="920" alt="截屏2023-03-14 14 48 56"
src="https://user-images.githubusercontent.com/17645053/224918551-9b46b44e-b075-4895-8d33-1aafc7d3c8e5.png">
<img width="901" alt="截屏2023-03-14 14 49 02"
src="https://user-images.githubusercontent.com/17645053/224918584-efa66f23-a593-4e26-a3eb-bb1fbc5516ae.png">
<img width="944" alt="截屏2023-03-14 14 49 21"
src="https://user-images.githubusercontent.com/17645053/224918591-be60455d-0513-4f66-84f6-b5e1bc40ff91.png">

6.  "Allowed users" in tags settings
<img width="935" alt="截屏2023-03-14 14 50 11"
src="https://user-images.githubusercontent.com/17645053/224918701-797699aa-c7e5-4290-b3fe-27dcead1c6c7.png">

19 months agoHandle files starting with colons in WalkGitLog (#22935)
Kirill Bolashev [Thu, 16 Mar 2023 16:03:04 +0000 (18:03 +0200)]
Handle files starting with colons in WalkGitLog (#22935)

Currently gitea shows no commit information for files starting with a
colon.

[I set up a minimal repro repository that reproduces this error once
it's migrated on gitea](https://github.com/kbolashev/colon-test)

<img width="1209" alt="image"
src="https://user-images.githubusercontent.com/111061261/219326625-0e6d3a86-8b58-4d67-bc24-8a78963f36b9.png">

This is happening because the filenames piped to the `git log` command
are written as is, and it doesn't work when you have a colon at the
start of the filename, and you need to escape it.

You can test it locally,  if you do
```
mkdir repo
git init
touch :file
git add . && git commit -m "Add file with colon"
git log -- :file
```
git log returns nothing. However, if you do `git log -- "\:file"`, it
will show the commit with the file change.

This PR escapes the starting colons in paths in the `LogNameStatusRepo`
function, making gitea return commit info about the file with the bad
filename.

<img width="1209" alt="image"
src="https://user-images.githubusercontent.com/111061261/219328299-46451246-4006-45e3-89b1-c244635ded23.png">

This error shows up only with files starting with colon, anywhere else
in filename is ok. Dashes at the beginning also seem to be working.
I don't know gitea internals well enough to know where else this error
can pop up, so I'm keeping this PR small as suggested by your
contributor guide

19 months agoChange `Close` to either `Close issue` or `Close pull request` (#23506)
Yarden Shoham [Thu, 16 Mar 2023 15:11:31 +0000 (17:11 +0200)]
Change `Close` to either `Close issue` or `Close pull request` (#23506)

Following [a discord
discussion](https://discord.com/channels/322538954119184384/977026554909581334/1085560443919147138),
the close button in the issue comment box is more descriptive.

# Before
For both issue and pull request

![image](https://user-images.githubusercontent.com/20454870/225449237-20c3a036-4b0f-40ab-b2f9-e72eff213165.png)

# After
## Issue

![image](https://user-images.githubusercontent.com/20454870/225550855-aa138ee5-e620-4f8c-b17b-91281677ecab.png)

## Pull request

![image](https://user-images.githubusercontent.com/20454870/225550750-4dd0906d-39a9-4678-9aee-e97e5e8c302d.png)

---------

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
19 months agoUpdate act (#23512)
Jason Song [Thu, 16 Mar 2023 10:09:11 +0000 (18:09 +0800)]
Update act (#23512)

Update replace:
```diff
- replace github.com/nektos/act => gitea.com/gitea/act v0.234.2-0.20230131074955-e46ede1b1744
+ replace github.com/nektos/act => gitea.com/gitea/act v0.243.1
```

Update require:
```diff
- github.com/nektos/act v0.0.0
+ github.com/nektos/act v0.2.43
```

Actually, `v0.2.43` doesn't work, it will be replaced by `gitea/act`, so
it's OK to put any version here. But `gitea/act` is based on
`nektos/act`, so keeping the right upstream version will make security
dependabot help.

BTW, the [security
report](https://github.com/go-gitea/gitea/security/dependabot/20) is
false positive, we don't use the artifact server in act, see #22738.

19 months agoMove pidfile creation from setting to web cmd package (#23285)
Lunny Xiao [Thu, 16 Mar 2023 07:22:54 +0000 (15:22 +0800)]
Move pidfile creation from setting to web cmd package (#23285)

Creating pid file should not belong to setting package and only web
command needs that. So this PR moves pidfile creation from setting
package to web command package to keep setting package more readable.

I marked this as `break` because the PIDFile path moved. For those who
have used the pid build argument, it has to be changed.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 16 Mar 2023 00:16:23 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoReplace `repo.namedBlob` by `git.TreeEntry`. (#22898)
Nick [Wed, 15 Mar 2023 21:51:39 +0000 (17:51 -0400)]
Replace `repo.namedBlob` by `git.TreeEntry`. (#22898)

`namedBlob` turned out to be a poor imitation of a `TreeEntry`. Using
the latter directly shortens this code.

This partially undoes https://github.com/go-gitea/gitea/pull/23152/,
which I found a merge conflict with, and also expands the test it added
to cover the subtle README-in-a-subfolder case.

19 months agoFix theme-auto loading (#23504)
silverwind [Wed, 15 Mar 2023 21:15:12 +0000 (22:15 +0100)]
Fix theme-auto loading (#23504)

Fix regression from https://github.com/go-gitea/gitea/pull/23481.

The conditional on the CSS import was being stripped away by webpack's
`css-loader`, resulting in the dark theme always loading. The old syntax
with `@import` nested inside `@media` also did not work as `css-loader`
(rightfully) ignores such non-standard `@import` syntax that was
previously supported by Less.

Unfortunately, we have to re-introduce postcss to the CSS pipeline to
fix this and I loaded only the minimal plugins to make it work.

There is one variant of the fix that does work without postcss, which is
to exclude the file from transpilation but I did not consider it as it
would have meant the `@import` was being done without a version suffix
in the URL, which would have caused cache issue.

Related: https://github.com/webpack-contrib/css-loader/issues/1503

---------

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoUpdate path to docs theme file (#23502)
techknowlogick [Wed, 15 Mar 2023 20:59:29 +0000 (16:59 -0400)]
Update path to docs theme file (#23502)

The branch name for the theme was updated to main

19 months agoUse arm image for arm runner (#23503)
techknowlogick [Wed, 15 Mar 2023 20:56:02 +0000 (16:56 -0400)]
Use arm image for arm runner (#23503)

19 months agoAdd login name and source id for admin user searching API (#23376)
Lunny Xiao [Wed, 15 Mar 2023 11:53:01 +0000 (19:53 +0800)]
Add login name and source id for admin user searching API (#23376)

As title.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoFix missed migration in #22235 (#23482)
Lunny Xiao [Wed, 15 Mar 2023 09:33:10 +0000 (17:33 +0800)]
Fix missed migration in #22235 (#23482)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
19 months agoDisable sending email after push a commit to a closed PR (#23462)
sillyguodong [Wed, 15 Mar 2023 06:42:21 +0000 (14:42 +0800)]
Disable sending email after push a commit to a closed PR (#23462)

Close #23440
Cause by #23189
In #23189, we should insert a comment record into db when pushing a
commit to the PR, even if the PR is closed.
But should skip sending any notification in this case.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoBump webpack from 5.75.0 to 5.76.0 (#23484)
dependabot[bot] [Wed, 15 Mar 2023 03:37:59 +0000 (23:37 -0400)]
Bump webpack from 5.75.0 to 5.76.0 (#23484)

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to
5.76.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/webpack/webpack/releases">webpack's
releases</a>.</em></p>
<blockquote>
<h2>v5.76.0</h2>
<h2>Bugfixes</h2>
<ul>
<li>Avoid cross-realm object access by <a
href="https://github.com/Jack-Works"><code>@​Jack-Works</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16500">webpack/webpack#16500</a></li>
<li>Improve hash performance via conditional initialization by <a
href="https://github.com/lvivski"><code>@​lvivski</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16491">webpack/webpack#16491</a></li>
<li>Serialize <code>generatedCode</code> info to fix bug in asset module
cache restoration by <a
href="https://github.com/ryanwilsonperkin"><code>@​ryanwilsonperkin</code></a>
in <a
href="https://redirect.github.com/webpack/webpack/pull/16703">webpack/webpack#16703</a></li>
<li>Improve performance of <code>hashRegExp</code> lookup by <a
href="https://github.com/ryanwilsonperkin"><code>@​ryanwilsonperkin</code></a>
in <a
href="https://redirect.github.com/webpack/webpack/pull/16759">webpack/webpack#16759</a></li>
</ul>
<h2>Features</h2>
<ul>
<li>add <code>target</code> to <code>LoaderContext</code> type by <a
href="https://github.com/askoufis"><code>@​askoufis</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16781">webpack/webpack#16781</a></li>
</ul>
<h2>Security</h2>
<ul>
<li><a
href="https://github.com/advisories/GHSA-3rfm-jhwj-7488">CVE-2022-37603</a>
fixed by <a
href="https://github.com/akhilgkrishnan"><code>@​akhilgkrishnan</code></a>
in <a
href="https://redirect.github.com/webpack/webpack/pull/16446">webpack/webpack#16446</a></li>
</ul>
<h2>Repo Changes</h2>
<ul>
<li>Fix HTML5 logo in README by <a
href="https://github.com/jakebailey"><code>@​jakebailey</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16614">webpack/webpack#16614</a></li>
<li>Replace TypeScript logo in README by <a
href="https://github.com/jakebailey"><code>@​jakebailey</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16613">webpack/webpack#16613</a></li>
<li>Update actions/cache dependencies by <a
href="https://github.com/piwysocki"><code>@​piwysocki</code></a> in <a
href="https://redirect.github.com/webpack/webpack/pull/16493">webpack/webpack#16493</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/Jack-Works"><code>@​Jack-Works</code></a> made
their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16500">webpack/webpack#16500</a></li>
<li><a href="https://github.com/lvivski"><code>@​lvivski</code></a> made
their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16491">webpack/webpack#16491</a></li>
<li><a
href="https://github.com/jakebailey"><code>@​jakebailey</code></a> made
their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16614">webpack/webpack#16614</a></li>
<li><a
href="https://github.com/akhilgkrishnan"><code>@​akhilgkrishnan</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16446">webpack/webpack#16446</a></li>
<li><a
href="https://github.com/ryanwilsonperkin"><code>@​ryanwilsonperkin</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16703">webpack/webpack#16703</a></li>
<li><a href="https://github.com/piwysocki"><code>@​piwysocki</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16493">webpack/webpack#16493</a></li>
<li><a href="https://github.com/askoufis"><code>@​askoufis</code></a>
made their first contribution in <a
href="https://redirect.github.com/webpack/webpack/pull/16781">webpack/webpack#16781</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0">https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/webpack/webpack/commit/97b1718720c33f1b17302a74c5284b01e02ec001"><code>97b1718</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16781">#16781</a>
from askoufis/loader-context-target-type</li>
<li><a
href="https://github.com/webpack/webpack/commit/b84efe6224b276bf72e4c5e2f4e76acddfaeef07"><code>b84efe6</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16759">#16759</a>
from ryanwilsonperkin/real-content-hash-regex-perf</li>
<li><a
href="https://github.com/webpack/webpack/commit/c98e9e001441b165c7ed4845700839730b505833"><code>c98e9e0</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16493">#16493</a>
from piwysocki/patch-1</li>
<li><a
href="https://github.com/webpack/webpack/commit/5f34acfbc074da6cc09f48944d7f2b4273ffb3f8"><code>5f34acf</code></a>
feat: Add <code>target</code> to <code>LoaderContext</code> type</li>
<li><a
href="https://github.com/webpack/webpack/commit/b7fc4d876deb958d7ee81ecc00a312e39a354a44"><code>b7fc4d8</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16703">#16703</a>
from ryanwilsonperkin/ryanwilsonperkin/fix-16160</li>
<li><a
href="https://github.com/webpack/webpack/commit/63ea82da4d4e4242b6a6285fc937f0684f264fe8"><code>63ea82d</code></a>
Merge branch 'webpack:main' into patch-1</li>
<li><a
href="https://github.com/webpack/webpack/commit/4ba225225b1348c8776ca5b5fe53468519413bc0"><code>4ba2252</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16446">#16446</a>
from akhilgkrishnan/patch-1</li>
<li><a
href="https://github.com/webpack/webpack/commit/1acd6350be3d74d4ac70b64cbbc60f27724b618b"><code>1acd635</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16613">#16613</a>
from jakebailey/ts-logo</li>
<li><a
href="https://github.com/webpack/webpack/commit/302eb37fe19ed7ca60eaf895aca4f9da9dfd7931"><code>302eb37</code></a>
Merge pull request <a
href="https://redirect.github.com/webpack/webpack/issues/16614">#16614</a>
from jakebailey/html5-logo</li>
<li><a
href="https://github.com/webpack/webpack/commit/cfdb1dfe59b33bf7441b8a8e4fc58d75e4f54cee"><code>cfdb1df</code></a>
Improve performance of hashRegExp lookup</li>
<li>Additional commits viewable in <a
href="https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~evilebottnawi">evilebottnawi</a>, a new
releaser for webpack since your current version.</p>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.75.0&new-version=5.76.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the
default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as
the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as
the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the
default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/go-gitea/gitea/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
19 months agoReplace Less with CSS (#23481)
silverwind [Wed, 15 Mar 2023 02:20:19 +0000 (03:20 +0100)]
Replace Less with CSS (#23481)

Ran most of the Less files through the Less compiler and Prettier and
then followed up with a round of manual fixes.

The Less compiler had unfortunately stripped all `//` style comments
that I had to restore (It did preserve `/* */` comments). Other fixes
include duplicate selector removal which were revealed after the
transpilation and which weren't caught by stylelint before but now are.

Fixes: https://github.com/go-gitea/gitea/issues/15565
19 months agoFix 'View File' button in code search (#23478)
silverwind [Wed, 15 Mar 2023 02:19:27 +0000 (03:19 +0100)]
Fix 'View File' button in code search (#23478)

- Right-align 'View File' button
- Add 'role' attribute to button link

Before:
<img width="1148" alt="Screenshot 2023-03-14 at 22 02 16"
src="https://user-images.githubusercontent.com/115237/225135954-f06153ec-c222-441e-98ba-0177afff3a7a.png">

After:
<img width="1150" alt="Screenshot 2023-03-14 at 22 02 33"
src="https://user-images.githubusercontent.com/115237/225135966-323cb695-05ef-4b83-a8ef-05f2b1887090.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoUse `gitea/test_env` image instead of `golang` (#23455)
silverwind [Wed, 15 Mar 2023 01:53:14 +0000 (02:53 +0100)]
Use `gitea/test_env` image instead of `golang` (#23455)

The `safe.directory` setting was not executed for pull requests, which
made subsequent `deps-backend` target fail at `go mod download`. To fix
it, split thep and perform the git config unconditionally.

Example: https://drone.gitea.io/go-gitea/gitea/69477/4/3

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoSkip DB tests duplicate runs on push to branches (#23476)
techknowlogick [Wed, 15 Mar 2023 01:46:13 +0000 (21:46 -0400)]
Skip DB tests duplicate runs on push to branches (#23476)

This skips all testing-* pipelines on push to main or release/*
branches. This decreases the total build time on those, as in theory
they should already be run for PRs before merging.

Fixes https://github.com/go-gitea/gitea/issues/22011

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoUpdate app.example.ini (#23480)
Jordan Cech [Wed, 15 Mar 2023 00:39:36 +0000 (18:39 -0600)]
Update app.example.ini (#23480)

19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 15 Mar 2023 00:17:03 +0000 (00:17 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoFix due date being wrong on issue list (#23475)
Yarden Shoham [Tue, 14 Mar 2023 20:55:49 +0000 (22:55 +0200)]
Fix due date being wrong on issue list (#23475)

Exactly like #22302 but in the issue list page

19 months agotest_env: hardcode major go version in use (#23464)
techknowlogick [Tue, 14 Mar 2023 20:09:01 +0000 (16:09 -0400)]
test_env: hardcode major go version in use (#23464)

hardcode the version of test_env we use in docker, so that we can use
different major versions of golang between versions of Gitea

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
19 months agoPush option bonus for PTC docs (#23473)
John Olheiser [Tue, 14 Mar 2023 17:12:27 +0000 (12:12 -0500)]
Push option bonus for PTC docs (#23473)

Follow-up for #23458

I could have suggested this on the original PR, but I thought there
would be more to add. Hadn't noticed the push options docs already had
nearly the same shell command. 😅

Signed-off-by: jolheiser <john.olheiser@gmail.com>
19 months agoLint Markdown pass
techknowlogick [Tue, 14 Mar 2023 16:53:02 +0000 (12:53 -0400)]
Lint Markdown pass

19 months agoPush to create docs (#23458)
techknowlogick [Tue, 14 Mar 2023 16:37:11 +0000 (12:37 -0400)]
Push to create docs (#23458)

This PR adds user friendly documentation on how to use push to create
feature

19 months agoConvert GitHub event on actions and fix some pull_request events. (#23037)
Lunny Xiao [Tue, 14 Mar 2023 12:50:51 +0000 (20:50 +0800)]
Convert GitHub event on actions and fix some pull_request events. (#23037)

Follow #22680

Partially Fix #22958, on pull_request, `opened`, `reopened`,
`synchronize` supported, `edited` hasn't been supported yet because
Gitea doesn't trigger that events.

---------

Co-authored-by: yp05327 <576951401@qq.com>
19 months agoRemove wrongly added column on migration test fixtures (#23456)
Lunny Xiao [Tue, 14 Mar 2023 11:49:59 +0000 (19:49 +0800)]
Remove wrongly added column on migration test fixtures (#23456)

Fix https://drone.gitea.io/go-gitea/gitea/69418/3/8
Migration fixtures are in `models/migrations/fixtures`, every folder
will be used only by the test with the same name.
For `Test_DeleteOrphanedIssueLabels`, the fixture should keep consistent
as the database structure at that time. So the newly added `exclusive`
is not right. Just revert the change in
https://github.com/go-gitea/gitea/pull/22585/files#diff-f8db9cbbaa10bf7b27eb726884454db821a4b4f8cb9a0d50435555908761bbcb

19 months agoRefactor branch/tag selector to Vue SFC (#23421)
wxiaoguang [Tue, 14 Mar 2023 09:51:20 +0000 (17:51 +0800)]
Refactor branch/tag selector to Vue SFC (#23421)

Follow #23394

There were many bad smells in old code. This PR only moves the code into
Vue SFC, doesn't touch the unrelated logic.

update: after
https://github.com/go-gitea/gitea/pull/23421/commits/5f23218c851e12132f538a404c946bbf6ff38e62
, there should be no usage of the vue-rumtime-compiler anymore
(hopefully), so I think this PR could close #19851

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoadd admin API email endpoints (#22792)
techknowlogick [Tue, 14 Mar 2023 07:54:40 +0000 (03:54 -0400)]
add admin API email endpoints (#22792)

add email endpoint to admin API to ensure API parity with admin
dashboard.

19 months agoadd user rename endpoint to admin api (#22789)
techknowlogick [Tue, 14 Mar 2023 07:45:21 +0000 (03:45 -0400)]
add user rename endpoint to admin api (#22789)

this is a simple endpoint that adds the ability to rename users to the
admin API.

Note: this is not in a mergeable state. It would be better if this was
handled by a PATCH/POST to the /api/v1/admin/users/{username} endpoint
and the username is modified.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
19 months agoAdd workflow error notification in ui (#23404)
yp05327 [Tue, 14 Mar 2023 07:27:03 +0000 (16:27 +0900)]
Add workflow error notification in ui (#23404)

![image](https://user-images.githubusercontent.com/18380374/224237847-07a30029-32d4-4af7-a36e-e55f0ed899aa.png)

![image](https://user-images.githubusercontent.com/18380374/224239309-a96120e1-5eec-41c0-89aa-9cf63d1df30c.png)

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoMake branches list page operations remember current page (#23420)
wxiaoguang [Tue, 14 Mar 2023 05:11:38 +0000 (13:11 +0800)]
Make branches list page operations remember current page (#23420)

Close #23411

Always pass "page" query parameter to backend, and make backend respect
it.

The `ctx.FormInt("limit")` is never used, so removed.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agofix markdown lint issue (#23457)
techknowlogick [Tue, 14 Mar 2023 04:10:01 +0000 (00:10 -0400)]
fix markdown lint issue (#23457)

CI is failing with the following:
```
docs/content/doc/features/localization.zh-cn.md:16 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "# 本地化"]
docs/content/doc/features/localization.zh-cn.md:23 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## 支持的语言"]
```

This fixes that error

19 months agoRefactor dashboard repo list to Vue SFC (#23405)
wxiaoguang [Tue, 14 Mar 2023 04:09:06 +0000 (12:09 +0800)]
Refactor dashboard repo list to Vue SFC (#23405)

Similar to #23394

The dashboard repo list mixes jQuery/Fomantic UI/Vue together, it's very
diffcult to maintain and causes unfixable a11y problems.

This PR uses two steps to refactor the repo list:

1. move `data-` attributes to JS object and use Vue data as much as
possible
https://github.com/go-gitea/gitea/pull/23405/commits/d3adc0dcacf7de87b9819277e6598ac3993bbfa3
2. move the code into a Vue SFC
https://github.com/go-gitea/gitea/pull/23405/commits/7ebe55df6e67adfd272a4bf0a96ad6688edf661f

Total: +516 −585

Screenshots:

<details>

![image](https://user-images.githubusercontent.com/2114189/224271457-a23e05be-d7d3-4247-a803-f0ee30c36f44.png)

![image](https://user-images.githubusercontent.com/2114189/224271504-76fbd3da-4d7a-4725-b0d1-fbff83caac63.png)

![image](https://user-images.githubusercontent.com/2114189/224271845-f007cadf-6c49-46bd-a65c-a3fc75bdba3b.png)

</details>

---------

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoUpdate localization.zh-cn.md (#23448)
LeenHawk [Tue, 14 Mar 2023 03:38:20 +0000 (11:38 +0800)]
Update localization.zh-cn.md (#23448)

As title.

19 months agoConvert `<div class="button">` to `<button class="button">` (#23337)
delvh [Tue, 14 Mar 2023 03:34:09 +0000 (04:34 +0100)]
Convert `<div class="button">` to `<button class="button">` (#23337)

This improves a lot of accessibility shortcomings.
Every possible instance of `<div class="button">` matching the command
`ag '<[^ab].*?class=.*?[" ]button[ "]' templates/ | grep -v 'dropdown'`
has been converted when possible.
divs with the `dropdown` class and their children were omitted as
1. more analysis must be conducted whether the dropdowns still work as
intended when they are a `button` instead of a `div`.
2. most dropdowns have `div`s as children. The HTML standard disallows
`div`s inside `button`s.
3. When a dropdown child that's part of the displayed text content is
converted to a `button`, the dropdown can be focused twice

Further changes include that all "gitea-managed" buttons with JS code
received an `e.preventDefault()` so that they don't accidentally submit
an underlying form, which would execute instead of cancel the action.
Lastly, some minor issues were fixed as well during the refactoring.

## Future improvements

As mentioned in
https://github.com/go-gitea/gitea/pull/23337#discussion_r1127277391,
`<a>`s without `href` attribute are not focusable.
They should later on be converted to `<button>`s.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 14 Mar 2023 00:16:09 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoAdd package registry architecture overview (#23445)
KN4CK3R [Mon, 13 Mar 2023 22:15:09 +0000 (23:15 +0100)]
Add package registry architecture overview (#23445)

As announced in #22810 I added a readme file to help understanding how
the package registry archictecture works and how the go packages are
related.

19 months agoHandle missing `README` in create repos API (#23387)
Zettat123 [Mon, 13 Mar 2023 21:55:30 +0000 (05:55 +0800)]
Handle missing `README` in create repos API (#23387)

Close #22934

In `/user/repos` API (and other APIs related to creating repos), user
can specify a readme template for auto init. At present, if the
specified template does not exist, a `500` will be returned . This PR
improved the logic and will return a `400` instead of `500`.

19 months agoFix missing commit status in PR which from forked repo (#23351)
sillyguodong [Mon, 13 Mar 2023 21:05:19 +0000 (05:05 +0800)]
Fix missing commit status in PR which from forked repo (#23351)

close: #23347

### Reference and Inference
According to Github REST API
[doc](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#list-commit-statuses-for-a-reference):
1. The `Drone CI` that can create some commit status by
[API](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status)
is enabled in `go-gitea/gitea`. So I tried to call the API to get a
commit status list of a PR which is commited to upstream
repo(`go-gitea/gitea`). As a result, the API returned a array of commit
status.

![image](https://user-images.githubusercontent.com/33891828/223913371-313d047a-5e2e-484c-b13e-dcd38748703e.png)
2. Then I tried to call the API to get commit status list of the
reference which of the `SHA` is the same as step 1 in the repo which is
forked from `go-gitea/gitea`. But I got a empty array.

![image](https://user-images.githubusercontent.com/33891828/223930827-17a64d3c-f466-4980-897c-77fe386c4d3b.png)

So, I believe it that:
1. The commit status is not shared between upstream repo and forked
repo.
2. The coomit status is bound to a repo that performs actions. (Gitea's
logic is the same)

### Cause
During debugging, I found it that commit status are not stored in the DB
as expected.
So, I located the following code:

https://github.com/go-gitea/gitea/blob/8cadd51bf295e6ff36ac36efed68cc5de34c9382/services/actions/commit_status.go#L18-L26
When I create a PR, the type of `event` is `pull request`, not `push`.
So the code return function directly.

### Screenshot

![image](https://user-images.githubusercontent.com/33891828/223939339-dadf539c-1fdd-40c4-96e9-2e4fa733f531.png)

![image](https://user-images.githubusercontent.com/33891828/223939519-edb02bf0-2478-4ea5-9366-be85468f02db.png)

![image](https://user-images.githubusercontent.com/33891828/223939557-ec6f1375-5536-400e-8987-fb7d2fd452fa.png)

### Other
In this PR, I also fix the problem of missing icon which represents
running in PRs list.

![image](https://user-images.githubusercontent.com/33891828/223939898-2a0339e4-713f-4c7b-9d99-2250a43f3457.png)

![image](https://user-images.githubusercontent.com/33891828/223939979-037a975f-5ced-480c-bac7-0ee00ebfff4b.png)

19 months agoAdd Swift package registry (#22404)
KN4CK3R [Mon, 13 Mar 2023 20:28:39 +0000 (21:28 +0100)]
Add Swift package registry (#22404)

This PR adds a [Swift](https://www.swift.org/) package registry.

![grafik](https://user-images.githubusercontent.com/1666336/211842523-07521cbd-8fb6-400f-820c-ee8048b05ae8.png)

19 months agoPurge API comment (#23451)
John Olheiser [Mon, 13 Mar 2023 19:41:38 +0000 (14:41 -0500)]
Purge API comment (#23451)

This PR just adds the `purge` query parameter to the swagger docs for
admin user delete.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
19 months agoUse context for `RepositoryList.LoadAttributes` (#23435)
yp05327 [Mon, 13 Mar 2023 11:31:41 +0000 (20:31 +0900)]
Use context for `RepositoryList.LoadAttributes` (#23435)

19 months agoadd path prefix to ObjectStorage.Iterator (#23332)
FuXiaoHei [Mon, 13 Mar 2023 10:23:51 +0000 (18:23 +0800)]
add path prefix to ObjectStorage.Iterator (#23332)

Support to iterator subdirectory in ObjectStorage for
ObjectStorage.Iterator method.

It's required for https://github.com/go-gitea/gitea/pull/22738 to make
artifact files cleanable.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoSupport reflogs (#22451)
Philip Peterson [Mon, 13 Mar 2023 07:51:07 +0000 (00:51 -0700)]
Support reflogs (#22451)

This PR adds support for reflogs on all repositories. It does this by
adding a global configuration entry.

Implements #14865

---------

Signed-off-by: Philip Peterson <philip.c.peterson@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoFix actions frontend bugs (pagination, long name alignment) and small simplify (...
Hester Gong [Mon, 13 Mar 2023 05:31:06 +0000 (13:31 +0800)]
Fix actions frontend bugs (pagination, long name alignment) and small simplify (#23370)

1 Right now on actions page, the action list will not be aligned if
commit message is long. In this PR, the changes are:
- The branch tag is moved to bottom row
- Width percentage is given to make them aligned
- Show "..." if commit is longer than two lines.
- Align the status icon with the commit message with baseline

 Before:
<img width="1068" alt="截屏2023-03-08 12 23 22"
src="https://user-images.githubusercontent.com/17645053/223628534-6b9472cb-29f5-40a3-9714-c5152553049e.png">

 After:
<img width="756" alt="截屏2023-03-08 13 34 28"
src="https://user-images.githubusercontent.com/17645053/223628571-da94698b-0e0a-43e3-ae82-34d8c780e5ba.png">

2 Right now the actions list's pagination is not working properly
because Param is not passed to pagination template, in this PR Param
Strings are passed to the pager

Before:
<img width="1176" alt="截屏2023-03-08 12 23 50"
src="https://user-images.githubusercontent.com/17645053/223629207-8b67ce74-2342-4259-bc81-036e37752716.png">

After:
<img width="1343" alt="截屏2023-03-08 13 11 54"
src="https://user-images.githubusercontent.com/17645053/223629321-4f538f8a-45dc-4d6f-ae60-2c82680ae3e7.png">

3 A small simplify in `RepoActionView.vue` .

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoScoped label display and documentation tweaks (#23430)
Brecht Van Lommel [Mon, 13 Mar 2023 00:46:13 +0000 (01:46 +0100)]
Scoped label display and documentation tweaks (#23430)

* Fix scoped label left and right part breaking across lines.
* Remove slanted divider in scoped label display, make it straight.
After using this for a while, this feels more visually noisy than
helpful.
* Reduce contrast between scope and item to reduce probability of
unreadable text on background.
* Change documentation to remove mention of non-exclusive scoped labels.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
19 months agoDeduplicate template code for label selection menu (#23431)
Brecht Van Lommel [Sun, 12 Mar 2023 20:39:56 +0000 (21:39 +0100)]
Deduplicate template code for label selection menu (#23431)

19 months agoShow edit/close/delete button on organization wide repositories (#23388)
yp05327 [Sun, 12 Mar 2023 13:36:47 +0000 (22:36 +0900)]
Show edit/close/delete button on organization wide repositories (#23388)

A part of https://github.com/go-gitea/gitea/pull/22865

19 months agoSync the class change of Edit Column Button to JS code (#23400)
yp05327 [Sun, 12 Mar 2023 11:09:20 +0000 (20:09 +0900)]
Sync the class change of Edit Column Button to JS code (#23400)

In #22767, we changed the class of `Edit Column` button from `red` to
`primary`
But `red` is used to find this button in js.....

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
19 months agoPreserve file size when creating attachments (#23406)
Peter [Sun, 12 Mar 2023 07:48:07 +0000 (08:48 +0100)]
Preserve file size when creating attachments (#23406)

When creating attachments (issue, release, repo) the file size (being
part of the multipart file header) is passed through the chain of
creating an attachment to ensure the MinIO client can stream the file
directly instead of having to read it to memory completely at first.

Fixes #23393

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 12 Mar 2023 00:16:02 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoUse buildkit for docker builds (#23415)
techknowlogick [Sat, 11 Mar 2023 21:08:56 +0000 (16:08 -0500)]
Use buildkit for docker builds (#23415)

This switches Docker builds to use build kit which is less prone to
error than legacy docker-in-docker building. It also switches back to
using the upstream docker image again now that it has been updated to a
version that supports alpine 3.14+

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
19 months agoRefactor branch/tag selector dropdown (first step) (#23394)
wxiaoguang [Sat, 11 Mar 2023 10:47:09 +0000 (18:47 +0800)]
Refactor branch/tag selector dropdown (first step) (#23394)

Follow:
* #23345

The branch/tag selector dropdown mixes jQuery/Fomantic UI/Vue together,
it's very diffcult to maintain and causes unfixable a11y problems. It
also causes problems like #19851 #21314 #21952

This PR is the first step for the refactoring, move `data-` attributes
to JS object and use Vue data as much as possible.

The old selector `'.choose.reference .dropdown'` was also wrong, it hits
`<div class="choose reference"><svg class="dropdown icon">` and would
cause undefined behaviors.

I have done some quick tests and it works. After this PR gets merged, I
will move the code into a Vue SFC in next PR.

![image](https://user-images.githubusercontent.com/2114189/224099638-378a8a86-0865-47d1-bcba-f972506374c7.png)

![image](https://user-images.githubusercontent.com/2114189/224099690-70276cf5-b1e4-404a-b0c6-582448abf40e.png)

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 11 Mar 2023 00:15:59 +0000 (00:15 +0000)]
[skip ci] Updated translations via Crowdin

19 months agoHide target selector if tag exists when creating new release (#23171)
Zettat123 [Fri, 10 Mar 2023 16:42:38 +0000 (00:42 +0800)]
Hide target selector if tag exists when creating new release (#23171)

Close #22649.

|status|screenshot|
|-|-|
|empty tag name|<img
src="https://user-images.githubusercontent.com/15528715/221490165-fd3abd2e-6dc5-4562-bece-d1d6a305479e.png"
width="300px"/>|
|new tag|<img
src="https://user-images.githubusercontent.com/15528715/221490450-49b2a48e-b206-49f4-bd79-34b1ea64156f.png"
width="300px"/>|
|existing tag|<img
src="https://user-images.githubusercontent.com/15528715/221490301-4d1879dd-4947-4abc-9b9a-e77be1806981.png"
width="300px"/>|

19 months agoParse external request id from request headers, and print it in access log (#22906)
sillyguodong [Fri, 10 Mar 2023 15:54:32 +0000 (23:54 +0800)]
Parse external request id from request headers, and print it in access log (#22906)

Close: #22890.

---
### Configure in .ini file:
```ini
[log]
REQUEST_ID_HEADERS = X-Request-ID, X-Trace-Id
```

### Params in Request Header
```
X-Trace-ID: trace-id-1q2w3e4r
```

![image](https://user-images.githubusercontent.com/33891828/218665296-8fd19a0f-ada6-4236-8bdb-f99201c703e8.png)

### Log output:

![image](https://user-images.githubusercontent.com/33891828/218665225-cc242a57-4ffc-449a-a1f6-f45ded0ead60.png)

19 months agoAdd missing tabs to org projects page (#22705)
yp05327 [Fri, 10 Mar 2023 15:18:20 +0000 (00:18 +0900)]
Add missing tabs to org projects page (#22705)

Fixes https://github.com/go-gitea/gitea/issues/22676

Context Data `IsOrganizationMember` and `IsOrganizationOwner` is used to
control the visibility of `people` and `team` tab.

https://github.com/go-gitea/gitea/blob/2871ea08096cba15546f357d0ec473734ee9d8be/templates/org/menu.tmpl#L19-L40

And because of the reuse of user projects page, User Context is changed
to Organization Context. But the value of `IsOrganizationMember` and
`IsOrganizationOwner` are not being given.

I reused func `HandleOrgAssignment` to add them to the ctx, but may have
some unnecessary variables, idk whether it is ok.

I found there is a missing `PageIsViewProjects` at create project page.

19 months agoAdd user webhooks (#21563)
KN4CK3R [Fri, 10 Mar 2023 14:28:32 +0000 (15:28 +0100)]
Add user webhooks (#21563)

Currently we can add webhooks for organizations but not for users. This
PR adds the latter. You can access it from the current users settings.

![grafik](https://user-images.githubusercontent.com/1666336/197391408-15dfdc23-b476-4d0c-82f7-9bc9b065988f.png)

19 months agoHandle OpenID discovery URL errors a little nicer when creating/editing sources ...
zeripath [Fri, 10 Mar 2023 06:14:43 +0000 (06:14 +0000)]
Handle OpenID discovery URL errors a little nicer when creating/editing sources (#23397)

When there is an error creating a new openIDConnect authentication
source try to handle the error a little better.

Close #23283

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoSplit CI pipelines (#23385)
John Olheiser [Fri, 10 Mar 2023 06:13:17 +0000 (00:13 -0600)]
Split CI pipelines (#23385)

- This PR attempts to split our various DB tests into separate
pipelines.
- It splits up some of the extra feature-related tests rather than
having most of them in the MySQL test.
- It disables the race detector for some of the pipelines as well, as it
can cause slower runs and is mostly redundant when the pipelines just
swap DBs.
- It builds without SQLite support for any of the non-SQLite pipelines.
- It moves the e2e test to using SQLite rather than PG (partially
because I moved the minio tests to PG and that mucked up the test
config, and partially because it avoids another running service)
- It splits up the `go mod download` task in the Makefile from the tool
installation, as the tools are only needed in the compliance pipeline.
(Arguably even some of the tools aren't needed there, but that could be
a follow-up PR)
- SQLite is now the only arm64 pipeline, moving PG back to amd64 which
can leverage autoscaler

Should resolve #22010 - one thing that wasn't changed here but is
mentioned in that issue, unit tests are needed in the same pipeline as
an integration test in order to form a complete coverage report (at
least as far as I could tell), so for now it remains in a pipeline with
a DB integration test.

Please let me know if I've inadvertently changed something that was how
it was on purpose.

---

I will say sometimes it's hard to pin down the average time, as a
pipeline could be waiting for a runner for X minutes and that brings the
total up by X minutes as well, but overall this does seem to be faster
on average.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
19 months agoImprove squash merge commit author and co-author with private emails (#22977)
Brecht Van Lommel [Fri, 10 Mar 2023 03:17:04 +0000 (04:17 +0100)]
Improve squash merge commit author and co-author with private emails (#22977)

When emails addresses are private, squash merges always use
`@noreply.localhost` for the author of the squash commit. And the author
is redundantly added as a co-author in the commit message.

Also without private mails, the redundant co-author is possible when
committing with a signature that's different than the user full name and
primary email.

Now try to find a commit by the same user in the list of commits, and
prefer the signature from that over one constructed from the account
settings.