summaryrefslogtreecommitdiffstats
path: root/modules/git
Commit message (Collapse)AuthorAgeFilesLines
* Fixes diff on merged pull requests (#7171)Mario Lubenka2019-06-111-4/+4
|
* Fixes #2738 - Adds the /git/tags API endpoint (#7138)Richard Mahn2019-06-084-24/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixes #2738 - /git/tags API * proper URLs * Adds function comments * Updates swagger * Removes newline from tag message * Removes trailing newline from commit message * Adds integration test * Removed debugging * Adds tests * Fixes bug where multiple tags of same commit show wrong tag name * Fix formatting * Removes unused varaible * Fix to annotated tag function names and response * Update modules/git/repo_tag.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Uses TagPrefix * Changes per review, better error handling for getting tag and commit IDs * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID
* Compare branches, commits and tags with each other (#6991)Mario Lubenka2019-06-073-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Supports tags when comparing commits or branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Hide headline when only comparing and don't load unused data Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Merges compare logics to allow comparing branches, commits and tags with eachother Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Display branch or tag instead of commit when used for comparing Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show pull request form after click on button Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers relevant pull.go changes from master to compare.go Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes error when comparing forks against a commit or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes console.log from JavaScript file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show icon next to commit reference when comparing branch or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Updates css file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes import order * Renames template variable * Update routers/repo/compare.go Co-Authored-By: zeripath <art27@cantab.net> * Update from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Allow short-shas in compare * Renames prInfo to compareInfo Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check PR permissions only if compare is pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use compareInfo instead of prInfo
* Refactor submodule URL parsing (#7100)mrsdizzie2019-06-032-27/+74
| | | | | | | | | | Use combination of url.Parse and regex to parse refURL rather than by hand with indexes & attempt to check if refURL is from same instance and adjust output to match. Also now return empty string instead of our original guess at URL if we are unable to parse it. Fixes #1526
* Show git-notes (#6984)Vladimir Panteleev2019-05-247-1/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | * Show git-notes * Make git-notes heading text localizable * Refactor git-notes data fetching to a separate function * Display the author and time of git notes * Move note bubble inside the commit bubble * Revert "Move note bubble inside the commit bubble" This reverts commit c0951fe0e3b4dea38064515546b1825c1bcf19e1. * Add test for git-notes * testing ui * Polish CSS * Apply suggestions from code review Co-Authored-By: Lauris BH <lauris@nix.lv>
* Do not attempt to return blob on submodule (#6996)zeripath2019-05-211-1/+1
|
* Refactor models.NewRepoContext to extract git related codes to modules/git ↵Lunny Xiao2019-05-151-2/+24
| | | | | | | | | | (#6941) * refactor models.NewRepoContext to extract git related codes to modules/git * fix imports * refactor
* Remove local clones & make hooks run on merge/edit/upload (#6672)zeripath2019-05-116-15/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add options to git.Clone to make it more capable * Begin the process of removing the local copy and tidy up * Remove Wiki LocalCopy Checkouts * Remove the last LocalRepo helpers * Remove WithTemporaryFile * Enable push-hooks for these routes * Ensure tests cope with hooks Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Repository.LocalCopyPath() * Move temporary repo to use the standard temporary path * Fix the tests Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove LocalWikiPath * Fix missing remove Signed-off-by: Andrew Thornton <art27@cantab.net> * Use AppURL for Oauth user link (#6894) * Use AppURL for Oauth user link Fix #6843 * Update oauth.go * Update oauth.go * internal/ssh: ignore env command totally (#6825) * ssh: ignore env command totally * Remove commented code Needed fix described in issue #6889 * Escape the commit message on issues update and title in telegram hook (#6901) * update sdk to latest (#6903) * improve description of branch protection (fix #6886) (#6906) The branch protection description text were not quite accurate. * Fix logging documentation (#6904) * ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG * Allow DISABLE_ROUTER_LOG to be set in the [log] section * [skip ci] Updated translations via Crowdin * Move sdk structs to modules/structs (#6905) * move sdk structs to moduels/structs * fix tests * fix fmt * fix swagger * fix vendor
* Number of commits ahead/behind in branch overview (#6695)Mario Lubenka2019-05-051-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Call Git API to determine divergence of a branch and its base branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show commit divergance in branch list Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds test for diverging commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Try comparing commits instead of branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes test as CI can't run it Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts signature of percentage function to allow providing multiple integers as numerator Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves CountDivergingCommits function into repofiles module Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Git statistics in Activity tab (#4724)Lauris BH2019-05-042-0/+143
| | | | | | | | | | | | | | | | | | * Initial implementation for git statistics in Activity tab * Create top user by commit count endpoint * Add UI and update src-d/go-git dependency * Add coloring * Fix typo * Move git activity stats data extraction to git module * Fix message * Add git code stats test
* Fix #6813: Allow git.GetTree to take both commit and tree names (#6816)Filip Navara2019-05-023-10/+16
| | | | | | | | | | * Allow git.GetTree to take both commit and tree names, return full paths on entries listed through Tree.ListEntriesRecursive Signed-off-by: Filip Navara <filip.navara@gmail.com> * Fix the SHA returned on Git Tree APIs called with commit hash or symbolic name Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Remove `seen` map from `getLastCommitForPaths` (#6807)Filip Navara2019-04-301-8/+2
| | | | | | | | | Ensures correctly traversing the commit graph for all path and avoids erroneously skipping some. Also preallocate some arrays to correct size to prevent unnecessary reallocations. Fixes #6708. Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Fix one performance/correctness regression in #6478 found on Rails ↵Filip Navara2019-04-211-38/+33
| | | | | | | | | | | | | | | | 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.
* Improve listing performance by using go-git (#6478)Filip Navara2019-04-1921-634/+661
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314)Richard Mahn2019-04-173-2/+46
|
* Pre-calculate the absolute path of git (#6575)Mura Li2019-04-172-1/+12
| | | | | | | | * 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.
* Support search operators for commits search (#6479)Mura Li2019-04-122-5/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Prevent server 500 on compare branches with no common history (#6555)zeripath2019-04-091-11/+16
| | | | | * Prevent 500 if there is no common mergebase * Prevent creation of PR with no history
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-2797-0/+4637
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* move out git module and #1573 send push hookUnknwon2015-12-0922-1869/+0
|
* Allow pre-receive hook customizationAdam Strzelecki2015-12-081-0/+1
| | | | | | | 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
* #2008 more supported git hooksUnknwon2015-11-241-3/+11
|
* fix #1383Unknwon2015-11-201-0/+3
|
* better escape char handleUnknwon2015-11-201-9/+9
|
* fix #1119 and data race in timming tasksUnknwon2015-11-201-2/+23
|
* Merge pull request #1994 from arthuroy/developUnknwon2015-11-181-0/+5
|\ | | | | Fix #1965 - the hyperlink and the display name of the branch
| * Use refStr[len("refs/heads/"):] instead of refStr[11:] and fix errorArthur Ouyang2015-11-191-1/+1
| | | | | | | | Fix #1965
| * Use refStr[11:] instead of TrimPrefixArthur Ouyang2015-11-191-1/+2
| | | | | | | | Fix #1965
| * Fix #1965 - the hyperlink and the display name of the branchArthur Ouyang2015-11-191-0/+4
| | | | | | | | The hyperlink and the display name of the branch if the branch is in a folder or the branch name has '#'
* | #1742 Update default branch in git repository while change in web viewUnknwon2015-11-182-0/+35
|/
* #1922 Pull request fail to merge with BINUnknwon2015-11-161-1/+1
|
* rename fieldsUnknwon2015-11-0313-34/+55
|
* #1838 update merge base before generate new patchUnknwon2015-11-031-13/+37
|
* fix workaround for reverse proxy, ssh, submoduleMatthias Pioch2015-10-241-3/+4
|
* workaround for reverse proxy, ssh, submoduleMatthias Pioch2015-10-241-2/+8
|
* work on #1830Unknwon2015-10-231-5/+4
|
* print out git versionUnknwon2015-10-131-0/+5
|
* save PR info as patch and minor fix on PRUnknwon2015-10-041-15/+3
|
* basic PR featureUnknwon2015-09-022-9/+56
|
* finish PR UIUnknwon2015-09-021-0/+28
|
* work on PR conversationUnknwon2015-09-011-0/+86
|
* more clear errorUnknwon2015-08-281-2/+1
|
* new repo git hooks UIUnknwon2015-08-261-1/+6
|
* new commits tableUnknwon2015-08-201-1/+3
|
* fix #966Unknwon2015-08-201-0/+7
|
* list view: issue, label, milestoneUnknwon2015-08-091-9/+9
|
* fix #1169Unknwon2015-07-262-1/+9
| | | | - prevent create reop on existed path
* Handle submodules without a .gitmodules entry - fix #1023Filippo Valsorda2015-03-102-2/+6
|
* modules/git/signature.go: parse date foramt #663Unknwon2015-03-061-1/+1
|
* modules/git: able to parse RFC1123Z date format #663Unknwon2015-02-211-9/+20
|