Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-calculate the absolute path of git #6575

Merged
merged 3 commits into from
Apr 17, 2019

Conversation

typeless
Copy link
Contributor

Related to #6386

Avoid the overhead of searching large PATH.

@techknowlogick techknowlogick added this to the 1.9.0 milestone Apr 11, 2019
@techknowlogick techknowlogick added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 11, 2019
@codecov-io
Copy link

codecov-io commented Apr 11, 2019

Codecov Report

Merging #6575 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6575      +/-   ##
==========================================
+ Coverage   40.76%   40.77%   +<.01%     
==========================================
  Files         407      407              
  Lines       54730    54735       +5     
==========================================
+ Hits        22310    22317       +7     
+ Misses      29366    29362       -4     
- Partials     3054     3056       +2
Impacted Files Coverage Δ
modules/git/command.go 95.52% <100%> (ø) ⬆️
modules/git/git.go 36.73% <60%> (+2.64%) ⬆️
models/repo_list.go 66.84% <0%> (-1.06%) ⬇️
routers/repo/view.go 42.07% <0%> (+0.99%) ⬆️
models/unit.go 14.28% <0%> (+14.28%) ⬆️

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 7a4c29c...c45b3fc. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 11, 2019
modules/git/git.go Outdated Show resolved Hide resolved
Copy link
Member

@sapk sapk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this solution quite simple for the user/admin and for others calls to git we just have to update call to "git" to GitExecutable in order to optimise them. Or we can even migrate them to NewCommand.

Some could easily be found :

For more : https://github.com/go-gitea/gitea/search?l=Go&q=git+Exec

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 11, 2019
@lunny
Copy link
Member

lunny commented Apr 11, 2019

@sapk Yes, we should move all the git commands to modules/git that's one reason of we merged git repository to gitea. And we need many refactor PRs to do that. For a git command configuration, I would like to don't change it or just change it when it is a relative path.

@zeripath
Copy link
Contributor

zeripath commented Apr 11, 2019

In #6505 I'm moving a lot of the git calls to modules/git. I could complete the job easily if wanted.

Also make it flexible to accept customized/user-defined value.
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 17, 2019
@lafriks lafriks merged commit 2a9806b into go-gitea:master Apr 17, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants