mirror of https://github.com/gogits/gogs.git
skyblue
11 years ago
27 changed files with 254 additions and 140 deletions
@ -1,49 +1,31 @@ |
|||||||
# Contributing to Gogs |
# Contributing to Gogs |
||||||
|
|
||||||
Want to hack on Gogs? Awesome! Here are instructions to get you |
> 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). |
||||||
started. They are probably not perfect, please let us know if anything |
|
||||||
feels wrong or incomplete. |
**This document is pre^3 release, we're not ready for receiving contribution until v0.5.0 release.** |
||||||
|
|
||||||
|
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 |
## Contribution guidelines |
||||||
|
|
||||||
### Pull requests are always welcome |
### Pull requests are always welcome |
||||||
|
|
||||||
We are always thrilled to receive pull requests, and do our best to |
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. |
||||||
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 |
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. |
||||||
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 |
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. |
||||||
to do everything for everybody. This means that we might decide against |
|
||||||
incorporating a new feature. |
|
||||||
|
|
||||||
### Discuss your design on the mailing list |
### Discuss your design on the mailing list |
||||||
|
|
||||||
We recommend discussing your plans [on the mailing |
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. |
||||||
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 |
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. |
||||||
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... |
### Create issues... |
||||||
|
|
||||||
Any significant improvement should be documented as [a GitHub |
Any significant improvement should be documented as [a GitHub issue](https://github.com/gogits/gogs/issues) before anybody starts working on it. |
||||||
issue](https://github.com/gogits/gogs/issues) before anybody |
|
||||||
starts working on it. |
|
||||||
|
|
||||||
### ...but check for existing issues first! |
### ...but check for existing issues first! |
||||||
|
|
||||||
Please take a moment to check that an issue doesn't already exist |
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. |
||||||
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. |
|
@ -0,0 +1,38 @@ |
|||||||
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package repo |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/codegangsta/martini" |
||||||
|
"github.com/gogits/gogs/models" |
||||||
|
"github.com/gogits/gogs/modules/middleware" |
||||||
|
) |
||||||
|
|
||||||
|
func Branches(ctx *middleware.Context, params martini.Params) { |
||||||
|
if !ctx.Repo.IsValid { |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
brs, err := models.GetBranches(params["username"], params["reponame"]) |
||||||
|
if err != nil { |
||||||
|
ctx.Handle(200, "repo.Branches", err) |
||||||
|
return |
||||||
|
} else if len(brs) == 0 { |
||||||
|
ctx.Handle(404, "repo.Branches", nil) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
ctx.Data["Username"] = params["username"] |
||||||
|
ctx.Data["Reponame"] = params["reponame"] |
||||||
|
|
||||||
|
if len(params["branchname"]) == 0 { |
||||||
|
params["branchname"] = "master" |
||||||
|
} |
||||||
|
ctx.Data["Branchname"] = params["branchname"] |
||||||
|
ctx.Data["Branches"] = brs |
||||||
|
ctx.Data["IsRepoToolbarBranches"] = true |
||||||
|
|
||||||
|
ctx.HTML(200, "repo/branches") |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package repo |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/codegangsta/martini" |
||||||
|
"github.com/gogits/gogs/models" |
||||||
|
"github.com/gogits/gogs/modules/middleware" |
||||||
|
) |
||||||
|
|
||||||
|
func Commits(ctx *middleware.Context, params martini.Params) { |
||||||
|
brs, err := models.GetBranches(params["username"], params["reponame"]) |
||||||
|
if err != nil { |
||||||
|
ctx.Handle(200, "repo.Commits", err) |
||||||
|
return |
||||||
|
} else if len(brs) == 0 { |
||||||
|
ctx.Handle(404, "repo.Commits", nil) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
ctx.Data["IsRepoToolbarCommits"] = true |
||||||
|
commits, err := models.GetCommits(params["username"], |
||||||
|
params["reponame"], params["branchname"]) |
||||||
|
if err != nil { |
||||||
|
ctx.Handle(404, "repo.Commits", nil) |
||||||
|
return |
||||||
|
} |
||||||
|
ctx.Data["Username"] = params["username"] |
||||||
|
ctx.Data["Reponame"] = params["reponame"] |
||||||
|
ctx.Data["CommitCount"] = commits.Len() |
||||||
|
ctx.Data["Commits"] = commits |
||||||
|
ctx.HTML(200, "repo/commits") |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package repo |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/codegangsta/martini" |
||||||
|
|
||||||
|
"github.com/gogits/gogs/modules/middleware" |
||||||
|
) |
||||||
|
|
||||||
|
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") |
||||||
|
} |
Loading…
Reference in new issue