diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08013d3705..1b71d53136 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,49 +1,29 @@ # Contributing to Gogs -Want to hack on Gogs? Awesome! Here are instructions to get you -started. They are probably not perfect, please let us know if anything -feels wrong or incomplete. +> Thanks [drone](https://github.com/drone/drone) because this guidelines sheet is forked from its [CONTRIBUTING.md](https://github.com/drone/drone/blob/master/CONTRIBUTING.md). + +Want to hack on Gogs? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels wrong or incomplete. ## Contribution guidelines ### Pull requests are always welcome -We are always thrilled to receive pull requests, and do our best to -process them as fast as possible. Not sure if that typo is worth a pull -request? Do it! We will appreciate it. +We are always thrilled to receive pull requests, and do our best to process them as fast as possible. Not sure if that typo is worth a pull request? Do it! We will appreciate it. -If your pull request is not accepted on the first try, don't be -discouraged! If there's a problem with the implementation, hopefully you -received feedback on what to improve. +If your pull request is not accepted on the first try, don't be discouraged! If there's a problem with the implementation, hopefully you received feedback on what to improve. -We're trying very hard to keep Gogs lean and focused. We don't want it -to do everything for everybody. This means that we might decide against -incorporating a new feature. +We're trying very hard to keep Gogs lean and focused. We don't want it to do everything for everybody. This means that we might decide against incorporating a new feature. ### Discuss your design on the mailing list -We recommend discussing your plans [on the mailing -list](https://groups.google.com/forum/#!forum/gogits) -before starting to code - especially for more ambitious contributions. -This gives other contributors a chance to point you in the right -direction, give feedback on your design, and maybe point out if someone -else is working on the same thing. +We recommend discussing your plans [on the mailing list](https://groups.google.com/forum/#!forum/gogits) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing. -We may close your pull request if not first discussed on the mailing -list. We aren't doing this to be jerks. We are doing this to prevent -people from spending large amounts of time on changes that may need -to be designed or architected in a specific way, or may not align with -the vision of the project. +We may close your pull request if not first discussed on the mailing list. We aren't doing this to be jerks. We are doing this to prevent people from spending large amounts of time on changes that may need to be designed or architected in a specific way, or may not align with the vision of the project. ### Create issues... -Any significant improvement should be documented as [a GitHub -issue](https://github.com/gogits/gogs/issues) before anybody -starts working on it. +Any significant improvement should be documented as [a GitHub issue](https://github.com/gogits/gogs/issues) before anybody starts working on it. ### ...but check for existing issues first! -Please take a moment to check that an issue doesn't already exist -documenting your bug report or improvement proposal. If it does, it -never hurts to add a quick "+1" or "I have this problem too". This will -help prioritize the most common problems and requests. \ No newline at end of file +Please take a moment to check that an issue doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests. \ No newline at end of file diff --git a/models/user.go b/models/user.go index 88bbabe6d5..7fd7449ce5 100644 --- a/models/user.go +++ b/models/user.go @@ -72,7 +72,10 @@ func (user *User) HomeLink() string { // AvatarLink returns the user gravatar link. func (user *User) AvatarLink() string { - return "/avatar/" + user.Avatar + if base.Service.EnableCacheAvatar { + return "/avatar/" + user.Avatar + } + return "http://1.gravatar.com/avatar/" + user.Avatar } // NewGitSig generates and returns the signature of given user. diff --git a/modules/log/log.go b/modules/log/log.go index 29782fb2ba..80ade3d5b2 100644 --- a/modules/log/log.go +++ b/modules/log/log.go @@ -20,6 +20,10 @@ func Trace(format string, v ...interface{}) { logger.Trace(format, v...) } +func Debug(format string, v ...interface{}) { + logger.Debug(format, v...) +} + func Info(format string, v ...interface{}) { logger.Info(format, v...) } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 78fe4b25d0..a9d8799314 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -31,6 +31,10 @@ func Issues(ctx *middleware.Context, params martini.Params) { return } + if len(params["branchname"]) == 0 { + params["branchname"] = "master" + } + ctx.Data["Branchname"] = params["branchname"] ctx.HTML(200, "repo/issues") } diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 82956098b7..b05ce4a717 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -69,7 +69,10 @@ func Branches(ctx *middleware.Context, params martini.Params) { ctx.Data["Username"] = params["username"] ctx.Data["Reponame"] = params["reponame"] - ctx.Data["Branchname"] = brs[0] + if len(params["branchname"]) == 0 { + params["branchname"] = "master" + } + ctx.Data["Branchname"] = params["branchname"] ctx.Data["Branches"] = brs ctx.Data["IsRepoToolbarBranches"] = true @@ -334,8 +337,13 @@ func Commits(ctx *middleware.Context, params martini.Params) { ctx.HTML(200, "repo/commits") } -func Pulls(ctx *middleware.Context) { +func Pulls(ctx *middleware.Context, params martini.Params) { ctx.Data["IsRepoToolbarPulls"] = true + if len(params["branchname"]) == 0 { + params["branchname"] = "master" + } + + ctx.Data["Branchname"] = params["branchname"] ctx.HTML(200, "repo/pulls") } diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl index a3358fd890..080cb72e57 100644 --- a/templates/repo/nav.tmpl +++ b/templates/repo/nav.tmpl @@ -53,9 +53,9 @@ -