From 8a8f84d245ed7b5cd007b43747098663019654c7 Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Sun, 27 Apr 2014 06:46:03 +0000 Subject: Use commit summaries instead of full messages --- routers/repo/commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/repo/commit.go') diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 6e20a7b7..9ecc697d 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -92,7 +92,7 @@ func Diff(ctx *middleware.Context, params martini.Params) { } ctx.Data["IsImageFile"] = isImageFile - ctx.Data["Title"] = commit.Message() + " · " + base.ShortSha(commitId) + ctx.Data["Title"] = commit.Summary() + " · " + base.ShortSha(commitId) ctx.Data["Commit"] = commit ctx.Data["Diff"] = diff ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 -- cgit v1.2.3 From 67002575589c1b77c86ecacd6edb5a05e81015cb Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Sun, 27 Apr 2014 23:43:14 +0000 Subject: Show parents in commit diff page --- routers/repo/commit.go | 12 ++++++++++++ templates/repo/diff.tmpl | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'routers/repo/commit.go') diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 9ecc697d..d7366992 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -91,10 +91,22 @@ func Diff(ctx *middleware.Context, params martini.Params) { return isImage } + parents := make([]string, commit.ParentCount()) + for i := 0; i < commit.ParentCount(); i++ { + sha, err := commit.ParentId(i) + parents[i] = sha.String() + if err != nil { + ctx.Handle(404, "repo.Diff", err) + } + } + + ctx.Data["Username"] = userName + ctx.Data["Reponame"] = repoName ctx.Data["IsImageFile"] = isImageFile ctx.Data["Title"] = commit.Summary() + " · " + base.ShortSha(commitId) ctx.Data["Commit"] = commit ctx.Data["Diff"] = diff + ctx.Data["Parents"] = parents ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 ctx.Data["IsRepoToolbarCommits"] = true ctx.Data["SourcePath"] = "/" + path.Join(userName, repoName, "src", commitId) diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 0dce4053..38fe3fee 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -8,9 +8,16 @@ Browse Source

{{.Commit.Message}}

+ {{ $username := .Username }} + {{ $reponame := .Reponame }}
- commit {{ShortSha .CommitId}} +
    + {{range .Parents}} +
  • parent {{ShortSha .}}
  • + {{end}} +
  • commit {{ShortSha .CommitId}}
  • +

-- cgit v1.2.3 From 2401e68d7ed7d53425293ad32d231542d03bbef3 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 28 Apr 2014 21:53:40 -0400 Subject: Prepare for v0.3.1 hotfix --- README.md | 2 +- README_ZH.md | 2 +- gogs.go | 2 +- public/img/favicon.bak.png | Bin 0 -> 15949 bytes public/img/favicon.png | Bin 15949 -> 10889 bytes routers/repo/commit.go | 1 + templates/repo/diff.tmpl | 4 +--- 7 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 public/img/favicon.bak.png (limited to 'routers/repo/commit.go') diff --git a/README.md b/README.md index d188508e..c16f721a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### Current version: 0.3.0 Alpha +##### Current version: 0.3.1 Alpha ### NOTICES diff --git a/README_ZH.md b/README_ZH.md index bbf461dd..b8278223 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。 ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### 当前版本:0.3.0 Alpha +##### 当前版本:0.3.1 Alpha ## 开发目的 diff --git a/gogs.go b/gogs.go index 1a8b4d13..d723aa33 100644 --- a/gogs.go +++ b/gogs.go @@ -19,7 +19,7 @@ import ( // Test that go1.2 tag above is included in builds. main.go refers to this definition. const go12tag = true -const APP_VER = "0.3.0.0427 Alpha" +const APP_VER = "0.3.1.0427 Alpha" func init() { base.AppVer = APP_VER diff --git a/public/img/favicon.bak.png b/public/img/favicon.bak.png new file mode 100644 index 00000000..ba9bd037 Binary files /dev/null and b/public/img/favicon.bak.png differ diff --git a/public/img/favicon.png b/public/img/favicon.png index ba9bd037..87282f9a 100644 Binary files a/public/img/favicon.png and b/public/img/favicon.png differ diff --git a/routers/repo/commit.go b/routers/repo/commit.go index d7366992..bc33fe44 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -97,6 +97,7 @@ func Diff(ctx *middleware.Context, params martini.Params) { parents[i] = sha.String() if err != nil { ctx.Handle(404, "repo.Diff", err) + return } } diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 38fe3fee..0b6d4f72 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -8,13 +8,11 @@ Browse Source

{{.Commit.Message}}

- {{ $username := .Username }} - {{ $reponame := .Reponame }}
-- cgit v1.2.3