2
0
Commit Graph

52 Commits

Author SHA1 Message Date
Filip Navara
ec12154cb5 Fix one performance/correctness regression in #6478 found on Rails repository. (#6686)
* Fix flaw in the commit history lookup that caused unnecessary traversal
when the repository contains a lot of merge commits.

Also return the merge commit as the changed one if the file or
directory was changed as part of the merge, eg. through conflict
resolution.

Signed-off-by: Filip Navara <filip.navara@gmail.com>

* Perform history simplification. If a file is present on multiple parents
in a merge commit follow only the first parent.
2019-04-21 16:49:06 +08:00
Filip Navara
18303a1258 Improve listing performance by using go-git (#6478)
* Use go-git for tree reading and commit info lookup.

Signed-off-by: Filip Navara <navara@emclient.com>

* Use TreeEntry.IsRegular() instead of ObjectType that was removed.

Signed-off-by: Filip Navara <navara@emclient.com>

* Use the treePath to optimize commit info search.

Signed-off-by: Filip Navara <navara@emclient.com>

* Extract the latest commit at treePath along with the other commits.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix listing commit info for a directory that was created in one commit and never modified after.

Signed-off-by: Filip Navara <navara@emclient.com>

* Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit).

Signed-off-by: Filip Navara <navara@emclient.com>

* Use go-git for reading blobs.

Signed-off-by: Filip Navara <navara@emclient.com>

* Make SHA1 type alias for plumbing.Hash in go-git.

Signed-off-by: Filip Navara <navara@emclient.com>

* Make Signature type alias for object.Signature in go-git.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix GetCommitsInfo for repository with only one commit.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix PGP signature verification.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix issues with walking commit graph across merges.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix typo in condition.

Signed-off-by: Filip Navara <navara@emclient.com>

* Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes).

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix lising submodules.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix build

Signed-off-by: Filip Navara <navara@emclient.com>

* Add back commit cache because of name-rev

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix tests

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix code style

* Fix spelling

* Address PR feedback

Signed-off-by: Filip Navara <navara@emclient.com>

* Update vendor module list

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix getting trees by commit id

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix remaining unit test failures

* Fix GetTreeBySHA

* Avoid running `git name-rev` if not necessary

Signed-off-by: Filip Navara <navara@emclient.com>

* Move Branch code to git module

* Clean up GPG signature verification and fix it for tagged commits

* Address PR feedback (import formatting, copyright headers)

* Make blob lookup by SHA working

* Update tests to use public API

* Allow getting content from any type of object through the blob interface

* Change test to actually expect the object content that is in the GIT repository

* Change one more test to actually expect the object content that is in the GIT repository

* Add comments
2019-04-19 20:17:27 +08:00
Richard Mahn
e63ad220bb Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 2019-04-17 12:06:35 -04:00
Mura Li
08408121ea Pre-calculate the absolute path of git (#6575)
* Pre-caculate the absolute path of git

* Do not repeat string literals which has been defined somewhere

Also make it flexible to accept customized/user-defined value.
2019-04-17 14:11:37 +03:00
Mura Li
5b472274cd Support search operators for commits search (#6479)
* Support searching commits with prefix syntax

For now, support auther: committer:
When more than one prefix is supplied is presented, the result is the union.
When different prefixes are supplied, the result is the intersection.

For example,
"author:alice author:bob"
=> the result is all commits authored by Alice OR Bob

"hello committer:alice"
=> the result is all commits committed by Alice AND has the keyword
'hello' in the message.

Note that there should NOT have any space after the colon(:) of the prefix.
For example,
"author:bill" => correct
"author: bill" => wrong

* Remove unneeded logging

* Add missing files of test repository

* Add missing repo_unit entries to test fixtures

* Update test cases

* Add tooltip for commits search button

* Update tooltip text

I have no idea about how to format it with line breaks.

* Make the usage example more real

* Add a test case

* Add new options struct for SearchCommits

* Prefer len(s) > 0 over s != ""

* Add NewSearchCommitsOptions
2019-04-12 10:28:44 +08:00
zeripath
1fa7c608ec Prevent server 500 on compare branches with no common history (#6555)
* Prevent 500 if there is no common mergebase
* Prevent creation of PR with no history
2019-04-09 21:45:58 +01:00
Lunny Xiao
6058bf85ca move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)
* move code.gitea.io/git to code.gitea.io/gitea/modules/git

* fix imports

* fix fmt

* fix misspell

* remove wrong tests data

* fix unit tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* enable Debug to trace the failure tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* comment commit count tests since git clone depth is 50

* fix tests

* update from code.gitea.io/git

* revert change to makefile
2019-03-27 17:33:00 +08:00
Unknwon
0638ee1b76 move out git module and #1573 send push hook 2015-12-09 20:46:05 -05:00
Adam Strzelecki
68b06312d7 Allow pre-receive hook customization
This hook can be used for example to reject too large commits and it is
executed before "update" hook, used exclusively by Gogs to update its state.

https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
2015-12-08 01:28:32 +01:00
Unknwon
97053baac1 #2008 more supported git hooks 2015-11-24 16:30:47 -05:00
Unknwon
b94f6fc495 fix #1383 2015-11-20 02:38:41 -05:00
Unknwon
0b652fab2f better escape char handle 2015-11-20 01:18:50 -05:00
Unknwon
655ce77c41 fix #1119 and data race in timming tasks 2015-11-20 00:47:35 -05:00
Unknwon
c7126fe9ec Merge pull request #1994 from arthuroy/develop
Fix #1965 - the hyperlink and the display name of the branch
2015-11-18 23:01:06 -05:00
Unknwon
44b4eb5e90 #1742 Update default branch in git repository while change in web view 2015-11-18 19:32:23 -05:00
Arthur Ouyang
d1d45f3443 Use refStr[len("refs/heads/"):] instead of refStr[11:] and fix error
Fix #1965
2015-11-19 08:10:44 +08:00
Arthur Ouyang
e010bb4f58 Use refStr[11:] instead of TrimPrefix
Fix #1965
2015-11-19 08:05:27 +08:00
Arthur Ouyang
c41050b082 Fix #1965 - the hyperlink and the display name of the branch
The hyperlink and the display name of the branch if the branch is in a folder or the branch name has '#'
2015-11-19 07:31:55 +08:00
Unknwon
879ae3d2aa #1922 Pull request fail to merge with BIN 2015-11-16 21:18:04 -05:00
Unknwon
01db8ff533 rename fields 2015-11-03 22:49:06 -05:00
Unknwon
bdebbec195 #1838 update merge base before generate new patch 2015-11-03 17:25:39 -05:00
Matthias Pioch
57b773896b fix workaround for reverse proxy, ssh, submodule 2015-10-24 22:46:13 +02:00
Matthias Pioch
268747b74c workaround for reverse proxy, ssh, submodule 2015-10-24 22:03:08 +02:00
Unknwon
37c9ca40ca work on #1830 2015-10-23 10:31:13 -04:00
Unknwon
42a713d268 print out git version 2015-10-13 16:01:57 -04:00
Unknwon
1f25d2b519 save PR info as patch and minor fix on PR 2015-10-04 20:54:06 -04:00
Unknwon
e71446e60c basic PR feature 2015-09-02 09:26:56 -04:00
Unknwon
b4b096cdcc finish PR UI 2015-09-02 04:08:05 -04:00
Unknwon
5952498be0 work on PR conversation 2015-09-01 19:07:02 -04:00
Unknwon
8200c7e8b7 more clear error 2015-08-28 19:28:26 +08:00
Unknwon
9462ae28dd new repo git hooks UI 2015-08-26 18:03:30 +08:00
Unknwon
a9c5628426 new commits table 2015-08-20 20:18:49 +08:00
Unknwon
11d74ecf0d fix #966 2015-08-20 15:57:51 +08:00
Unknwon
28e16ea88d list view: issue, label, milestone 2015-08-09 22:45:38 +08:00
Unknwon
ab65286c60 fix #1169
- prevent create reop on existed path
2015-07-26 19:22:17 +08:00
Filippo Valsorda
0d8a70e957 Handle submodules without a .gitmodules entry - fix #1023 2015-03-10 03:08:17 +00:00
Unknwon
a02649fcd4 modules/git/signature.go: parse date foramt #663 2015-03-06 18:27:20 -05:00
Unknwon
c16693e217 modules/git: able to parse RFC1123Z date format #663 2015-02-21 23:37:32 -05:00
Unknwon
3005c4f6db Fix diff css style, hooks \r char 2014-10-11 18:20:07 -04:00
Unknwon
64c68220d2 Fix #264 2014-10-06 17:50:00 -04:00
Linquize
67c44b7d27 If git >= 2.0, sort tags in descending order by version number 2014-10-05 11:59:54 +08:00
Unknwon
2a031c1365 Fix #515 2014-09-30 04:39:53 -04:00
Unknwon
ebb05475ed Fix #495 and cannot view repository by tag 2014-09-23 13:06:25 -04:00
Unknwon
3f707b3f32 Add basic submodule support 2014-09-22 17:01:19 -04:00
lunnyxiao
7df60af60e submodule support and closed #478 2014-09-22 14:23:36 +08:00
lunnyxiao
150eef93b2 add submodule basic support & buf fixed #478 2014-09-22 10:43:16 +08:00
Unknwon
ae3639868e Quick fix on #476 2014-09-16 20:58:06 -04:00
Unknwon
62f21ff3ed Work on #476 2014-09-16 11:29:53 -04:00
Unknwon
0d9c41be7d Work on #476 2014-09-16 10:10:33 -04:00
Unknwon
9a1d5d2489 Finish new web hook pages 2014-08-09 15:40:10 -07:00