Adam Majer
d68a613ba8
Add support for sha256 repositories ( #23894 )
...
Currently only SHA1 repositories are supported by Gitea. This adds
support for alternate SHA256 with the additional aim of easier support
for additional hash types in the future.
Fixes : #13794
Limited by: https://github.com/go-git/go-git/issues/899
Depend on: #28138
<img width="776" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/5448c9a7-608e-4341-a149-5dd0069c9447 ">
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
10 months ago
Nanguan Lin
da50be7360
Replace 'userxx' with 'orgxx' in all test files when the user type is org ( #27052 )
...
Currently 'userxx' and 'orgxx' are both used as username in test files
when the user type is org, which is confusing. This PR replaces all
'userxx' with 'orgxx' when the user type is org(`user.type==1`).
Some non-trivial changes
1. Rename `user3` dir to `org3` in `tests/git-repositories-meta`
2. Change `end` in `issue reference` because 'org3' is one char shorter
than 'user3'
![ksnip_20230913-112819](https://github.com/go-gitea/gitea/assets/70063547/442988c5-4cf4-49b8-aa01-4dd6bf0ca954 )
3. Change the search result number of `user/repo2` because
`user3/repo21` can't be searched now
![ksnip_20230913-112931](https://github.com/go-gitea/gitea/assets/70063547/d9ebeba4-479f-4110-9a85-825efbc981fd )
4. Change the first org name getting from API because the result is
ordered by alphabet asc and now `org 17` is before `org25`
![JW8U7NIO(J$H
_YCRB36H)T](https://github.com/go-gitea/gitea/assets/70063547/f55a685c-cf24-40e5-a87f-3a2327319548 )
![)KFD411O4I8RB5ZOH7E0
Z3](https://github.com/go-gitea/gitea/assets/70063547/a0dc3299-249c-46f6-91cb-d15d4ee88dd5 )
Other modifications are just find all and replace all.
Unit tests with SQLite are all passed.
---------
Co-authored-by: caicandong <1290147055@qq.com>
1 year ago
wxiaoguang
36dc11869d
Use correct captured group range when parsing cross-reference ( #22672 )
...
Fixes #22666 (Replace #22668 )
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: zeripath <art27@cantab.net>
2 years ago
KN4CK3R
d0d257b243
Add support for commit cross references ( #22645 )
...
Fixes #22628
This PR adds cross references for commits by using the format
`owner/repo@commit` . References are rendered like
[go-gitea/lgtm@6fe88302](#dummy).
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
flynnnnnnnnnn
e81ccc406b
Implement FSFE REUSE for golang files ( #21840 )
...
Change all license headers to comply with REUSE specification.
Fix #16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2 years ago
wxiaoguang
0614ae1c44
Remove unnecessary misspell ignore pattern ( #21475 )
...
It doesn't make sense to ignore the pattern again and again.
2 years ago
6543
54e9ee37a7
format with gofumpt ( #18184 )
...
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
3 years ago
luzpaz
e0296b6a6d
Fix various documentation, user-facing, and source comment typos ( #16367 )
...
* Fix various doc, user-facing, and source comment typos
Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby`
3 years ago
Steven
2e0f315617
Respect default merge message syntax when parsing item references ( #15772 )
...
* Respect merge message structure for parsing item references
Signed-off-by: JustusBunsi <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago
a1012112796
34df4e5df5
Add mentionable teams to tributeValues and change team mention rules to gh's style ( #13198 )
...
* Add mentionable teams to tributeValues
Signed-off-by: a1012112796 <1012112796@qq.com>
* Apply suggestions from code review
Co-authored-by: silverwind <me@silverwind.io>
* Change team mention rules to gh's style
* use org's avator as team avator in ui
Signed-off-by: a1012112796 <1012112796@qq.com>
* Update modules/markup/html.go
* Update models/issue.go
Co-authored-by: Lauris BH <lauris@nix.lv>
* Update models/issue.go
* fix a small nit and update test code
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
4 years ago
zeripath
77e5081a2e
Fix panic bug in handling multiple references in commit ( #13486 )
...
* Fix panic bug in handling multiple references in commit
The issue lay in determining the position of matches on a second run round
a commit message in FindAllIssueReferences.
Fix #13483
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Extract function and make testable
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix the comment
Signed-off-by: Andrew Thornton <art27@cantab.net>
* cleaning up the comments a bit more
Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago
Lauris BH
e710a34981
Add spent time to referenced issue in commit message ( #12220 )
4 years ago
guillep2k
131baa26be
Accept punctuation after simple+cross repository issue references ( #10091 )
...
* Support references ending in , . and ;
* Accept :;, in simple refs; fix 2+ consecutive refs
* Include cross-repository references
* Add ?!, fix spacing problem
5 years ago
zeripath
27757714d0
Change markdown rendering from blackfriday to goldmark ( #9533 )
...
* Move to goldmark
Markdown rendering moved from blackfriday to the goldmark.
Multiple subtle changes required to the goldmark extensions to keep
current rendering and defaults.
Can go further with goldmark linkify and have this work within markdown
rendering making the link processor unnecessary.
Need to think about how to go about allowing extensions - at present it
seems that these would be hard to do without recompilation.
* linter fixes
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
guillep2k
6a90c7e3dd
Alternate syntax for cross references ( #9116 )
...
* Add support for local vs. remote xrefs
* Add doc for references
* Docs: fix cases not currently supported
* One more doc fix
* Doc: mentions for teams and orgs
* Change !num ref concept, no change in functionality
* Fix test
* Improve table of issue reference types
* Fix paragraph mark
5 years ago
guillep2k
bb04fb55d7
Enable punctuations ending mentions ( #8889 )
...
* Enable punctuations ending mentions
* Improve tests
5 years ago
guillep2k
f9944c0e69
Configurable close and reopen keywords for PRs ( #8120 )
...
* Add settings for CloseKeywords and ReopenKeywords
* Fix and improve tests
* Use sync.Once() for initialization
* Fix unintended exported function
5 years ago
guillep2k
15809d81f7
Rewrite reference processing code in preparation for opening/closing from comment references ( #8261 )
...
* Add a markdown stripper for mentions and xrefs
* Improve comments
* Small code simplification
* Move reference code to modules/references
* Fix typo
* Make MarkdownStripper return [][]byte
* Implement preliminary keywords parsing
* Add FIXME comment
* Fix comment
* make fmt
* Fix permissions check
* Fix text assumptions
* Fix imports
* Fix lint, fmt
* Fix unused import
* Add missing export comment
* Bypass revive on implemented interface
* Move mdstripper into its own package
* Support alphanumeric patterns
* Refactor FindAllMentions
* Move mentions test to references
* Parse mentions from reference package
* Refactor code to implement renderizable references
* Fix typo
* Move patterns and tests to the references package
* Fix nil reference
* Preliminary rendering attempt of closing keywords
* Normalize names, comments, general tidy-up
* Add CSS style for action keywords
* Fix permission for admin and owner
* Fix golangci-lint
* Fix golangci-lint
5 years ago