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

WIP: Move git as modules/git #5991

Closed
wants to merge 226 commits into from
Closed

Conversation

lunny
Copy link
Member

@lunny lunny commented Feb 7, 2019

This will still keep all the git commit histories.

unknwon and others added 30 commits November 26, 2015 17:34
try to fix  Duplicate of files in directory (gogs#2254 )
This fixes regression introduced in ebd9fb2,
that GetSubModules was always returning empty submodule info because
c.submoduleCache != nil check was always true since parseCommitData was setting
commit.submoduleCache = newObjectCache() so it was always not-nil.

Now we initialize submoduleCache in first GetSubModules call, next call will
return cached entries.
This fixes GetCommitsInfo returning

 GetSubModule (/somemodule): object does not exist [id: , rel_path: .gitmodules]

when /somemodule is a ref entry but no .gitmodules file is present. Instead
failing we just check for IsErrNotExist and return empty submodule url.

This also fixes HTTP 500 internal error in Gogs for case described above.
agrn and others added 5 commits February 2, 2019 22:21
…o-gitea#113)

* GetCommit() returns a ErrNotExist if short commit ID does not exists

Currently, GetCommit() returns a generic error if a short commit ID
does not exists in a repository.

When a commit is not found by git-rev-parse, it returns an errors
which contains "fatal: ambiguous argument". GetCommit() now search if
the error contains this string, and, if it does, returns an
ErrNotExist.

The idea is to allow commits to be accessed from gitea with a short
commit ID.  Without this change, it would return a 500 Internal Server
Error when a short ID does not exists in the repository.

Signed-off-by: Alban Gruin <alban@pa1ch.fr>

* GetCommit(): change the comparison for short commit messages

`fatal: ambiguous argument` can be the beginning of two errors in
git. This changes the comparison to something less ambiguous.

Signed-off-by: Alban Gruin <alban@pa1ch.fr>
…e5c'

git-subtree-dir: modules/git
git-subtree-mainline: 2d213b6
git-subtree-split: 0aea7f1
@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Feb 7, 2019
@lunny lunny changed the title Move git as modules/git WIP: Move git as modules/git Feb 7, 2019
@codecov-io
Copy link

Codecov Report

Merging #5991 into master will increase coverage by 0.65%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5991      +/-   ##
==========================================
+ Coverage   38.72%   39.38%   +0.65%     
==========================================
  Files         332      360      +28     
  Lines       48992    50816    +1824     
==========================================
+ Hits        18973    20014    +1041     
- Misses      27271    27939     +668     
- Partials     2748     2863     +115
Impacted Files Coverage Δ
models/repo_branch.go 58.73% <ø> (ø) ⬆️
modules/git/tree.go 64.81% <ø> (ø)
models/repo_tag.go 62.5% <ø> (ø) ⬆️
routers/init.go 71.83% <ø> (ø) ⬆️
routers/repo/setting.go 10.35% <ø> (ø) ⬆️
modules/git/repo_tag.go 63.63% <ø> (ø)
modules/git/tree_entry.go 73.73% <ø> (ø)
models/graph.go 81.03% <ø> (ø) ⬆️
routers/repo/view.go 46.1% <ø> (-1.2%) ⬇️
modules/notification/base/null.go 22.72% <ø> (ø) ⬆️
... and 100 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 8c865f3...9558cc8. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 9, 2019
@zeripath
Copy link
Contributor

zeripath commented Feb 9, 2019

Hey @lunny I hope you don't mind that I took the liberty of getting this to build.

I think there's still a few things left:

  • Ensure that everything in modules/git/Makefile is covered by the main gitea Makefile.
  • There's a still a modules/git/docker folder which should probably be removed.

@zeripath
Copy link
Contributor

I looked a bit more at this earlier today, there are issues in terms of the tests and benchmarks of the git module. These will add files to modules/git directory by default - these aren't cleaned and as some are go files will then cause other make tasks to fail.

They should probably be changed to download to a temporary directory which is deleted at the end of a test.

@lunny
Copy link
Member Author

lunny commented Feb 11, 2019

@zeripath please feel free to submit your commits. This PR still needs many changes.

@zeripath
Copy link
Contributor

They should already be there - I used my manager rights to push changes to your GitHub branch. If you pull from that locally you should get the changes.

@techknowlogick techknowlogick added this to the 1.9.0 milestone Feb 19, 2019
@techknowlogick
Copy link
Member

We don’t need to keep git history because 1. We will have it in old repo (and can archive that repo), and 2. When this is merged it’ll be squashed into one commit then merged.

@lunny
Copy link
Member Author

lunny commented Mar 11, 2019

should fix #5954

@lunny
Copy link
Member Author

lunny commented Mar 19, 2019

Please go #6364 to discuss further.

@lunny lunny closed this Mar 19, 2019
@lunny lunny removed this from the 1.9.0 milestone Mar 19, 2019
@lunny lunny deleted the lunny/add_git_as_module branch March 19, 2019 03:55
@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/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.