mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-13 02:02:53 +09:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12f51ec7dd | ||
|
|
82b843a5ab | ||
|
|
dcbbf37082 | ||
|
|
3e8618a543 | ||
|
|
3a2679db2e |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -4,6 +4,20 @@ This changelog goes through all the changes that have been made in each release
|
||||
without substantial changes to our git log; to see the highlights of what has
|
||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||
|
||||
## [1.12.1](https://github.com/go-gitea/gitea/releases/tag/v1.12.1) - 2020-06-21
|
||||
|
||||
* BUGFIXES
|
||||
* Handle multiple merges in gitgraph.js (#11996) (#12000)
|
||||
* Add serviceworker.js to KnownPublicEntries (#11992) (#11994)
|
||||
* For language detection do not try to analyze big files by content (#11971) (#11975)
|
||||
* ENHANCEMENTS
|
||||
* Fix scrollable header on dropdowns (#11893) (#11965)
|
||||
|
||||
## [1.11.8](https://github.com/go-gitea/gitea/releases/tag/v1.11.8) - 2020-06-21
|
||||
|
||||
* BUGFIXES
|
||||
* Really fix __webpack_public_path__ for 1.11 (#11961)
|
||||
|
||||
## [1.12.0](https://github.com/go-gitea/gitea/releases/tag/v1.12.0) - 2020-06-17
|
||||
|
||||
* BREAKING
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/generate"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/public"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
@@ -878,7 +879,7 @@ func (u *User) IsGhost() bool {
|
||||
}
|
||||
|
||||
var (
|
||||
reservedUsernames = []string{
|
||||
reservedUsernames = append([]string{
|
||||
".",
|
||||
"..",
|
||||
".well-known",
|
||||
@@ -888,17 +889,13 @@ var (
|
||||
"attachments",
|
||||
"avatars",
|
||||
"commits",
|
||||
"css",
|
||||
"debug",
|
||||
"error",
|
||||
"explore",
|
||||
"fomantic",
|
||||
"ghost",
|
||||
"help",
|
||||
"img",
|
||||
"install",
|
||||
"issues",
|
||||
"js",
|
||||
"less",
|
||||
"login",
|
||||
"manifest.json",
|
||||
@@ -916,8 +913,8 @@ var (
|
||||
"stars",
|
||||
"template",
|
||||
"user",
|
||||
"vendor",
|
||||
}
|
||||
}, public.KnownPublicEntries...)
|
||||
|
||||
reservedUserPatterns = []string{"*.keys", "*.gpg"}
|
||||
)
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
)
|
||||
|
||||
const fileSizeLimit int64 = 16 * 1024 * 1024
|
||||
const fileSizeLimit int64 = 16 * 1024 // 16 KiB
|
||||
const bigFileSize int64 = 1024 * 1024 // 1 MiB
|
||||
|
||||
// specialLanguages defines list of languages that are excluded from the calculation
|
||||
// unless they are the only language present in repository. Only languages which under
|
||||
@@ -62,8 +63,11 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
|
||||
return nil
|
||||
}
|
||||
|
||||
// If content can not be read just do detection by filename
|
||||
content, _ := readFile(f, fileSizeLimit)
|
||||
// If content can not be read or file is too big just do detection by filename
|
||||
var content []byte
|
||||
if f.Size <= bigFileSize {
|
||||
content, _ = readFile(f, fileSizeLimit)
|
||||
}
|
||||
if enry.IsGenerated(f.Name, content) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -30,12 +30,13 @@ type Options struct {
|
||||
Prefix string
|
||||
}
|
||||
|
||||
// List of known entries inside the `public` directory
|
||||
var knownEntries = []string{
|
||||
// KnownPublicEntries list all direct children in the `public` directory
|
||||
var KnownPublicEntries = []string{
|
||||
"css",
|
||||
"fomantic",
|
||||
"img",
|
||||
"js",
|
||||
"serviceworker.js",
|
||||
"vendor",
|
||||
}
|
||||
|
||||
@@ -114,7 +115,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
|
||||
if len(parts) < 2 {
|
||||
return false
|
||||
}
|
||||
for _, entry := range knownEntries {
|
||||
for _, entry := range KnownPublicEntries {
|
||||
if entry == parts[1] {
|
||||
ctx.Resp.WriteHeader(404)
|
||||
return true
|
||||
|
||||
@@ -2,39 +2,37 @@
|
||||
<div class="repository commits">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<div id="git-graph-container" class="ui segment">
|
||||
<h1>{{.i18n.Tr "repo.commit_graph"}}</h1>
|
||||
<div id="rel-container">
|
||||
<canvas id="graph-canvas">
|
||||
<ul id="graph-raw-list">
|
||||
{{ range .Graph }}
|
||||
<li><span class="node-relation">{{ .GraphAcii -}}</span></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</canvas>
|
||||
</div>
|
||||
<div id="rev-container">
|
||||
<ul id="rev-list">
|
||||
{{ range .Graph }}
|
||||
<li>
|
||||
{{ if .OnlyRelation }}
|
||||
<span />
|
||||
{{ else }}
|
||||
<code id="{{.ShortRev}}">
|
||||
<a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.Rev}}">{{ .ShortRev}}</a>
|
||||
</code>
|
||||
<strong> {{.Branch}}</strong>
|
||||
<span>{{RenderCommitMessage .Subject $.RepoLink $.Repository.ComposeMetas}}</span> by
|
||||
<span class="author">
|
||||
{{.Author}}
|
||||
</span>
|
||||
<span class="time">{{.Date}}</span>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="git-graph-container" class="ui segment">
|
||||
<h1>{{.i18n.Tr "repo.commit_graph"}}</h1>
|
||||
<div id="rel-container">
|
||||
<canvas id="graph-canvas">
|
||||
<ul id="graph-raw-list">
|
||||
{{ range .Graph }}
|
||||
<li><span class="node-relation">{{ .GraphAcii -}}</span></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</canvas>
|
||||
</div>
|
||||
<div id="rev-container">
|
||||
<ul id="rev-list">
|
||||
{{ range .Graph }}
|
||||
<li>
|
||||
{{ if .OnlyRelation }}
|
||||
<span />
|
||||
{{ else }}
|
||||
<code id="{{.ShortRev}}">
|
||||
<a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.Rev}}">{{ .ShortRev}}</a>
|
||||
</code>
|
||||
<strong> {{.Branch}}</strong>
|
||||
<span>{{RenderCommitMessage .Subject $.RepoLink $.Repository.ComposeMetas}}</span> by
|
||||
<span class="author">{{.Author}}</span>
|
||||
<span class="time">{{.Date}}</span>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
|
||||
15
web_src/js/vendor/gitgraph.js
vendored
15
web_src/js/vendor/gitgraph.js
vendored
@@ -65,7 +65,7 @@ export default function gitGraph(canvas, rawGraphList, config) {
|
||||
|
||||
for (i = 0; i < l; i++) {
|
||||
midStr = rawGraphList[i].replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '');
|
||||
|
||||
midStr = midStr.replace(/(--)|(-\.)/g,'-')
|
||||
maxWidth = Math.max(midStr.replace(/(_|\s)/g, '').length, maxWidth);
|
||||
|
||||
row = midStr.split('');
|
||||
@@ -343,11 +343,6 @@ export default function gitGraph(canvas, rawGraphList, config) {
|
||||
return (val !== ' ' && val !== '_');
|
||||
}).length;
|
||||
|
||||
// do some clean up
|
||||
if (flows.length > condenseCurrentLength) {
|
||||
flows.splice(condenseCurrentLength, flows.length - condenseCurrentLength);
|
||||
}
|
||||
|
||||
colomnIndex = 0;
|
||||
|
||||
// a little inline analysis and draw process
|
||||
@@ -362,7 +357,7 @@ export default function gitGraph(canvas, rawGraphList, config) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// inline interset
|
||||
// inline intersect
|
||||
if ((colomn === '_' || colomn === '/')
|
||||
&& currentRow[colomnIndex - 1] === '|'
|
||||
&& currentRow[colomnIndex - 2] === '_') {
|
||||
@@ -380,6 +375,7 @@ export default function gitGraph(canvas, rawGraphList, config) {
|
||||
color = flows[colomnIndex].color;
|
||||
|
||||
switch (colomn) {
|
||||
case '-':
|
||||
case '_':
|
||||
drawLineRight(x, y, color);
|
||||
|
||||
@@ -416,6 +412,11 @@ export default function gitGraph(canvas, rawGraphList, config) {
|
||||
|
||||
y -= config.unitSize;
|
||||
}
|
||||
|
||||
// do some clean up
|
||||
if (flows.length > condenseCurrentLength) {
|
||||
flows.splice(condenseCurrentLength, flows.length - condenseCurrentLength);
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
@@ -1245,7 +1245,7 @@ i.icon.centerlock {
|
||||
|
||||
/* limit width of all direct dropdown menu children */
|
||||
/* https://github.com/go-gitea/gitea/pull/10835 */
|
||||
.dropdown:not(.selection) > .menu:not(.review-box) > * {
|
||||
.dropdown:not(.selection) > .menu:not(.review-box) > *:not(.header) {
|
||||
max-width: 300px;
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
Reference in New Issue
Block a user