Refactor branch list using src-d/go-git and add GetRefs function #133

Merged
lunny merged 6 commits from unknown repository into master 2018-11-15 22:38:34 +00:00
Owner

Author: @lafriks

GetRefs will be needed to implement Refs API

Add src-d/go-git dependency and refactored GetBranches to use this lib.

Old using git command:
BenchmarkRepository_GetBranches-4           1000           1505930 ns/op
New using src-d/go-git:
BenchmarkRepository_GetBranches-4          10000            150774 ns/op
Author: @lafriks GetRefs will be needed to implement Refs API Add src-d/go-git dependency and refactored GetBranches to use this lib. ``` Old using git command: BenchmarkRepository_GetBranches-4 1000 1505930 ns/op New using src-d/go-git: BenchmarkRepository_GetBranches-4 10000 150774 ns/op ```
Author
Owner

Author: @codecov-io

Codecov Report

Merging #133 into master will decrease coverage by 0.21%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
- Coverage   33.54%   33.33%   -0.22%     
==========================================
  Files          25       28       +3     
  Lines        1407     1761     +354     
==========================================
+ Hits          472      587     +115     
- Misses        862     1096     +234     
- Partials       73       78       +5
Impacted Files Coverage Δ
ref.go 0% <0%> (ø)
repo_branch.go 12.32% <58.33%> (+12.32%) ⬆️
repo_ref.go 70% <70%> (ø)
tree.go 68.42% <0%> (-6.58%) ⬇️
signature.go 64% <0%> (-6%) ⬇️
repo_tree.go 35.71% <0%> (-5.96%) ⬇️
tree_blob.go 40.54% <0%> (-4.63%) ⬇️
commit_info.go 63.92% <0%> (-4.08%) ⬇️
git.go 27.27% <0%> (-3.29%) ⬇️
parse.go 57.62% <0%> (-3.16%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3afe30...0b52498. Read the comment docs.

Author: @codecov-io # [Codecov](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=h1) Report > Merging [#133](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=desc) into [master](https://codecov.io/gh/go-gitea/git/commit/f3afe30030edc46d8a494f37afcff4380c37d685?src=pr&el=desc) will **decrease** coverage by `0.21%`. > The diff coverage is `63.63%`. [![Impacted file tree graph](https://codecov.io/gh/go-gitea/git/pull/133/graphs/tree.svg?width=650&token=sCATTcwuUJ&height=150&src=pr)](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #133 +/- ## ========================================== - Coverage 33.54% 33.33% -0.22% ========================================== Files 25 28 +3 Lines 1407 1761 +354 ========================================== + Hits 472 587 +115 - Misses 862 1096 +234 - Partials 73 78 +5 ``` | [Impacted Files](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [ref.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-cmVmLmdv) | `0% <0%> (ø)` | | | [repo\_branch.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-cmVwb19icmFuY2guZ28=) | `12.32% <58.33%> (+12.32%)` | :arrow_up: | | [repo\_ref.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-cmVwb19yZWYuZ28=) | `70% <70%> (ø)` | | | [tree.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-dHJlZS5nbw==) | `68.42% <0%> (-6.58%)` | :arrow_down: | | [signature.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-c2lnbmF0dXJlLmdv) | `64% <0%> (-6%)` | :arrow_down: | | [repo\_tree.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-cmVwb190cmVlLmdv) | `35.71% <0%> (-5.96%)` | :arrow_down: | | [tree\_blob.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-dHJlZV9ibG9iLmdv) | `40.54% <0%> (-4.63%)` | :arrow_down: | | [commit\_info.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-Y29tbWl0X2luZm8uZ28=) | `63.92% <0%> (-4.08%)` | :arrow_down: | | [git.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-Z2l0Lmdv) | `27.27% <0%> (-3.29%)` | :arrow_down: | | [parse.go](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree#diff-cGFyc2UuZ28=) | `57.62% <0%> (-3.16%)` | :arrow_down: | | ... and [18 more](https://codecov.io/gh/go-gitea/git/pull/133/diff?src=pr&el=tree-more) | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=footer). Last update [f3afe30...0b52498](https://codecov.io/gh/go-gitea/git/pull/133?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Author
Owner

Author: @lunny

@lafriks the benchmark is for a bare git repository?

Author: @lunny @lafriks the benchmark is for a bare git repository?
Author
Owner

Author: @lafriks

@lunny yes

Author: @lafriks @lunny yes
Author
Owner

Author: @lunny

It seems we only have a bare repo on testdata

Author: @lunny It seems we only have a bare repo on testdata
Author
Owner

Author: @lafriks

@lunny is that a problem?

Author: @lafriks @lunny is that a problem?
Author
Owner

Author: @lunny

I prefer pure go library than git command. But for performance measure, I think a bare repo maybe not a good example.

Author: @lunny I prefer pure go library than git command. But for performance measure, I think a bare repo maybe not a good example.
Author
Owner

Author: @lafriks

We store all git repos as bare server-side so that is measurement most important for gitea case

Author: @lafriks We store all git repos as bare server-side so that is measurement most important for gitea case
This repo is archived. You cannot comment on pull requests.
No description provided.