Browse Source

repo: several minor improvements

1. Fix sample content didn't show up when hook doesn't exist.
2. Fix CSS 'word-break' to use 'break-word' not 'break-all'.
3. Fix single quote in 'locale_en-US.ini' file.
pull/4155/head
Unknwon 8 years ago
parent
commit
7de71333c6
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 2
      README.md
  2. 2
      README_ZH.md
  3. 2
      cmd/web.go
  4. 3
      conf/locale/locale_en-US.ini
  5. 2
      gogs.go
  6. 1
      models/repo.go
  7. 50
      modules/bindata/bindata.go
  8. 2
      public/css/gogs.css
  9. 2
      public/less/_form.less
  10. 1
      routers/repo/setting.go
  11. 2
      templates/.VERSION
  12. 2
      vendor/github.com/gogits/git-module/git.go
  13. 12
      vendor/github.com/gogits/git-module/hook.go
  14. 6
      vendor/vendor.json

2
README.md

@ -41,7 +41,7 @@ The goal of this project is to make the easiest, fastest, and most painless way
- Reverse proxy with sub-path - Reverse proxy with sub-path
- Account/Organization/Repository management - Account/Organization/Repository management
- Add/Remove repository collaborators - Add/Remove repository collaborators
- Repository/Organization webhooks (including Slack) - Repository/Organization webhooks (including Slack and Discord)
- Repository Git hooks/deploy keys - Repository Git hooks/deploy keys
- Repository issues, pull requests, wiki and protected branches - Repository issues, pull requests, wiki and protected branches
- Migrate and mirror repository and its wiki - Migrate and mirror repository and its wiki

2
README_ZH.md

@ -22,7 +22,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
- 支持反向代理子路径 - 支持反向代理子路径
- 支持用户、组织和仓库管理系统 - 支持用户、组织和仓库管理系统
- 支持添加和删除仓库协作者 - 支持添加和删除仓库协作者
- 支持仓库和组织级别 Web 钩子(包括 Slack 集成) - 支持仓库和组织级别 Web 钩子(包括 Slack 和 Discord 集成)
- 支持仓库 Git 钩子和部署密钥 - 支持仓库 Git 钩子和部署密钥
- 支持仓库工单(Issue)、合并请求(Pull Request)、Wiki 和保护分支 - 支持仓库工单(Issue)、合并请求(Pull Request)、Wiki 和保护分支
- 支持迁移和镜像仓库以及它的 Wiki - 支持迁移和镜像仓库以及它的 Wiki

2
cmd/web.go

@ -95,7 +95,7 @@ func checkVersion() {
{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"}, {"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
{"gopkg.in/ini.v1", ini.Version, "1.8.4"}, {"gopkg.in/ini.v1", ini.Version, "1.8.4"},
{"gopkg.in/macaron.v1", macaron.Version, "1.1.7"}, {"gopkg.in/macaron.v1", macaron.Version, "1.1.7"},
{"github.com/gogits/git-module", git.Version, "0.4.11"}, {"github.com/gogits/git-module", git.Version, "0.4.12"},
{"github.com/gogits/go-gogs-client", gogs.Version, "0.12.1"}, {"github.com/gogits/go-gogs-client", gogs.Version, "0.12.1"},
} }
for _, c := range checkers { for _, c := range checkers {

3
conf/locale/locale_en-US.ini

@ -500,7 +500,7 @@ issues.new_label = New Label
issues.new_label_placeholder = Label name... issues.new_label_placeholder = Label name...
issues.create_label = Create Label issues.create_label = Create Label
issues.label_templates.title = Load a predefined set of labels issues.label_templates.title = Load a predefined set of labels
issues.label_templates.info = There arent any labels yet. You can click on the "New Label" button above to create one or use a predefined set below. issues.label_templates.info = There aren't any labels yet. You can click on the "New Label" button above to create one or use a predefined set below.
issues.label_templates.helper = Select a label set issues.label_templates.helper = Select a label set
issues.label_templates.use = Use this label set issues.label_templates.use = Use this label set
issues.label_templates.fail_to_load_file = Failed to load label template file '%s': %v issues.label_templates.fail_to_load_file = Failed to load label template file '%s': %v
@ -656,6 +656,7 @@ settings.protect_require_pull_request = Require pull request instead direct push
settings.protect_require_pull_request_desc = Enable this option to disable direct pushing to this branch. Commits have to be pushed to another non-protected branch and merged to this branch through pull request. settings.protect_require_pull_request_desc = Enable this option to disable direct pushing to this branch. Commits have to be pushed to another non-protected branch and merged to this branch through pull request.
settings.protect_whitelist_committers = Whitelist who can push to this branch settings.protect_whitelist_committers = Whitelist who can push to this branch
settings.protect_whitelist_committers_desc = Add people or teams to whitelist of direct push to this branch. settings.protect_whitelist_committers_desc = Add people or teams to whitelist of direct push to this branch.
settings.update_protect_branch_success = Protect options for this branch has been updated successfully!
settings.hooks = Webhooks settings.hooks = Webhooks
settings.githooks = Git Hooks settings.githooks = Git Hooks
settings.basic_settings = Basic Settings settings.basic_settings = Basic Settings

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.9.160.0218" const APP_VER = "0.9.160.0219"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

1
models/repo.go

@ -122,6 +122,7 @@ func NewRepoContext() {
log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1") log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
} }
git.HookDir = "custom_hooks" git.HookDir = "custom_hooks"
git.HookSampleDir = "hooks"
// Git requires setting user.name and user.email in order to commit changes. // Git requires setting user.name and user.email in order to commit changes.
for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} { for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} {

50
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

2
public/css/gogs.css

@ -910,7 +910,7 @@ footer .ui.language .menu {
padding-top: .6em; padding-top: .6em;
padding-bottom: .6em; padding-bottom: .6em;
display: inline-block; display: inline-block;
word-break: break-all; word-break: break-word;
} }
.ui.attached.header { .ui.attached.header {
background: #f0f0f0; background: #f0f0f0;

2
public/less/_form.less

@ -4,7 +4,7 @@
padding-top: .6em; padding-top: .6em;
padding-bottom: .6em; padding-bottom: .6em;
display: inline-block; display: inline-block;
word-break: break-all; word-break: break-word;
} }
} }
.ui.attached.header { .ui.attached.header {

1
routers/repo/setting.go

@ -462,6 +462,7 @@ func SettingsProtectedBranchPost(ctx *context.Context, form auth.ProtectBranchFo
return return
} }
ctx.Flash.Success(ctx.Tr("repo.settings.update_protect_branch_success"))
ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, branch)) ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, branch))
} }

2
templates/.VERSION

@ -1 +1 @@
0.9.160.0218 0.9.160.0219

2
vendor/github.com/gogits/git-module/git.go generated vendored

@ -10,7 +10,7 @@ import (
"time" "time"
) )
const _VERSION = "0.4.11" const _VERSION = "0.4.12"
func Version() string { func Version() string {
return _VERSION return _VERSION

12
vendor/github.com/gogits/git-module/hook.go generated vendored

@ -13,8 +13,9 @@ import (
) )
var ( var (
// Direcotry of hook file. Can be changed to "custom_hooks" for very purpose. // Direcotry of hook and sample files. Can be changed to "custom_hooks" for very purpose.
HookDir = "hooks" HookDir = "hooks"
HookSampleDir = HookDir
// HookNames is a list of Git server hooks' name that are supported. // HookNames is a list of Git server hooks' name that are supported.
HookNames = []string{ HookNames = []string{
"pre-receive", "pre-receive",
@ -62,8 +63,13 @@ func GetHook(repoPath, name string) (*Hook, error) {
} }
h.IsActive = true h.IsActive = true
h.Content = string(data) h.Content = string(data)
} else if isFile(h.path + ".sample") { return h, nil
data, err := ioutil.ReadFile(h.path + ".sample") }
// Check sample file
samplePath := path.Join(repoPath, HookSampleDir, h.name) + ".sample"
if isFile(samplePath) {
data, err := ioutil.ReadFile(samplePath)
if err != nil { if err != nil {
return nil, err return nil, err
} }

6
vendor/vendor.json vendored

@ -159,10 +159,10 @@
"revisionTime": "2016-08-10T03:50:02Z" "revisionTime": "2016-08-10T03:50:02Z"
}, },
{ {
"checksumSHA1": "JPQWxQRYFpezMThuSqcPhvbJdq4=", "checksumSHA1": "RnWB5UDcTpSGepvWnwic1SyRZrc=",
"path": "github.com/gogits/git-module", "path": "github.com/gogits/git-module",
"revision": "c882f3d24df5fb730d3b3c1b6cc64416dd22660c", "revision": "1b9552bab7499e5cbd96f6b550aaa0038faf6b67",
"revisionTime": "2017-02-18T23:44:51Z" "revisionTime": "2017-02-19T18:16:29Z"
}, },
{ {
"checksumSHA1": "xvG+RgJODQqlmdAkHUQK2TyLR88=", "checksumSHA1": "xvG+RgJODQqlmdAkHUQK2TyLR88=",

Loading…
Cancel
Save