This PR registers requests with the process manager and manages hierarchy within the processes.
Git repos are then associated with a context, (usually the request's context) - with sub commands using this context as their base context.
Signed-off-by: Andrew Thornton <[email protected]>
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Use `..` instead of `...` with `rev-list`. In combination with #16282 the receiver can get the correct commit. The behaviour is now like Github.
fixes#11802
Use common git cat-file --batch and git cat-file --batch-check to
significantly reduce calls to git.
Signed-off-by: Andrew Thornton <[email protected]>
There is a weird gotcha with GetTagCommitID that because it uses git rev-list
can cause an ambiguous argument error.
This PR simply makes tags use the same code as branches.
Signed-off-by: Andrew Thornton <[email protected]>
* Make auto check manual merge as a chooseable mod and add manual merge way on ui
as title, Before this pr, we use same way with GH to check manually merge.
It good, but in some special cases, misjudgments can occur. and it's hard
to fix this bug. So I add option to allow repo manager block "auto check manual merge"
function, Then it will have same style like gitlab(allow empty pr). and to compensate for
not being able to detect THE PR merge automatically, I added a manual approach.
Signed-off-by: a1012112796 <[email protected]>
* make swager
* api support
* ping ci
* fix TestPullCreate_EmptyChangesWithCommits
* Apply suggestions from code review
Co-authored-by: zeripath <[email protected]>
* Apply review suggestions and add test
* Apply suggestions from code review
Co-authored-by: zeripath <[email protected]>
* fix build
* test error message
* make fmt
* Fix indentation issues identified by @silverwind
Co-authored-by: silverwind <[email protected]>
* Fix tests and make manually merged disabled error on API the same
Signed-off-by: Andrew Thornton <[email protected]>
* a small nit
* fix wrong commit id error
* fix bug
* simple test
* fix test
Co-authored-by: zeripath <[email protected]>
Co-authored-by: silverwind <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Unfortunately `git log revision ... --skip=x -- path` skips the number of commits
not the number of commits relating to the path.
This PR changes the function to have a reader that reads and skips the
necessary number of commits by hand instead.
Fix#8716
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: 6543 <[email protected]>
GetCommit() assumes that all 40 char strings are SHA1s. This leads to an
error if you try to do a PR on a branch which is 40 characters long.
This PR attempts the SHA first - and if it fails will switch to using rev-parse.
Fix#14470
Signed-off-by: Andrew Thornton <[email protected]>
* Add pager to the branches page
* override pageSize if bigger than max
* Make branches commit range configurable
Co-authored-by: zeripath <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: silverwind <[email protected]>
* Move last commit cache back into modules/git
Signed-off-by: Andrew Thornton <[email protected]>
* Remove go-git from the interface for last commit cache
Signed-off-by: Andrew Thornton <[email protected]>
* move cacheref to last_commit_cache
Signed-off-by: Andrew Thornton <[email protected]>
* Remove go-git from routers/private/hook
Signed-off-by: Andrew Thornton <[email protected]>
* Move FindLFSFiles to pipeline
Signed-off-by: Andrew Thornton <[email protected]>
* Make no-go-git variants
Signed-off-by: Andrew Thornton <[email protected]>
* Submodule RefID
Signed-off-by: Andrew Thornton <[email protected]>
* fix issue with GetCommitsInfo
Signed-off-by: Andrew Thornton <[email protected]>
* fix GetLastCommitForPaths
Signed-off-by: Andrew Thornton <[email protected]>
* Improve efficiency
Signed-off-by: Andrew Thornton <[email protected]>
* More efficiency
Signed-off-by: Andrew Thornton <[email protected]>
* even faster
Signed-off-by: Andrew Thornton <[email protected]>
* Reduce duplication
* As per @lunny
Signed-off-by: Andrew Thornton <[email protected]>
* attempt to fix drone
Signed-off-by: Andrew Thornton <[email protected]>
* fix test-tags
Signed-off-by: Andrew Thornton <[email protected]>
* default to use no-go-git variants and add gogit build tag
Signed-off-by: Andrew Thornton <[email protected]>
* placate lint
Signed-off-by: Andrew Thornton <[email protected]>
* as per @6543
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
* Multiple GitGraph improvements.
Add backend support for excluding PRs, selecting branches and files.
Fix#10327
Signed-off-by: Andrew Thornton <[email protected]>
* as per @silverwind
Signed-off-by: Andrew Thornton <[email protected]>
* as per @silverwind
Signed-off-by: Andrew Thornton <[email protected]>
* Only show refs in dropdown we display on the graph
Signed-off-by: Andrew Thornton <[email protected]>
* as per @silverwind
Signed-off-by: Andrew Thornton <[email protected]>
* use flexbox for ui header
Signed-off-by: Andrew Thornton <[email protected]>
* Move Hide Pull Request button to the dropdown
Signed-off-by: Andrew Thornton <[email protected]>
* Add SHA and user pictures
Signed-off-by: Andrew Thornton <[email protected]>
* fix test
Signed-off-by: Andrew Thornton <[email protected]>
* fix test 2
Signed-off-by: Andrew Thornton <[email protected]>
* fixes
* async
* more tweaks
* use tabs in tmpl
Signed-off-by: Andrew Thornton <[email protected]>
* remove commented thing
Signed-off-by: Andrew Thornton <[email protected]>
* fix linting
Signed-off-by: Andrew Thornton <[email protected]>
* Update web_src/js/features/gitgraph.js
Co-authored-by: silverwind <[email protected]>
* graph tweaks
* more tweaks
* add title
Signed-off-by: Andrew Thornton <[email protected]>
* fix loading indicator z-index and position
Co-authored-by: silverwind <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Go-version constraints ignore pre-releases.
Rather than change the library further this PR simply changes
the git version comparison to use simple version compare ignoring the
issue of pre-releases.
Signed-off-by: Andrew Thornton <[email protected]>
`GetCommitsFromIDs` is only used in one place: `LoadPushCommits` where
it expects that `c.Commits` is not nil.
This potentially nil set causes a NPE in in #12953Fix#12953
Signed-off-by: Andrew Thornton <[email protected]>
* Handle more pathological branch and tag names
Signed-off-by: Andrew Thornton <[email protected]>
* Fix failing test
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
* Fix panic in API pulls when headbranch does not exist
* refix other reference to plumbing.ErrReferenceNotFound
Signed-off-by: Andrew Thornton <[email protected]>
* search commits via commit hash
Signed-off-by: Gary Kim <[email protected]>
* Also include all option for hash search
Signed-off-by: Gary Kim <[email protected]>
* Remove code duplication in commit search
Signed-off-by: Gary Kim <[email protected]>
* Add case ignore to commit hash search
Signed-off-by: Gary Kim <[email protected]>
* add history comments to detect page delete
Signed-off-by: Michael Gnehr <[email protected]>
* fix too much history entries
- caused by --follow flag
- if files with same contents exists
Signed-off-by: Michael Gnehr <[email protected]>
* style imprevements wiki
- history - wrap long author names
Signed-off-by: Michael Gnehr <[email protected]>
* Supports tags when comparing commits or branches
Signed-off-by: Mario Lubenka <[email protected]>
* Hide headline when only comparing and don't load unused data
Signed-off-by: Mario Lubenka <[email protected]>
* Merges compare logics to allow comparing branches, commits and tags with eachother
Signed-off-by: Mario Lubenka <[email protected]>
* Display branch or tag instead of commit when used for comparing
Signed-off-by: Mario Lubenka <[email protected]>
* Show pull request form after click on button
Signed-off-by: Mario Lubenka <[email protected]>
* Transfers relevant pull.go changes from master to compare.go
Signed-off-by: Mario Lubenka <[email protected]>
* Fixes error when comparing forks against a commit or tag
Signed-off-by: Mario Lubenka <[email protected]>
* Removes console.log from JavaScript file
Signed-off-by: Mario Lubenka <[email protected]>
* Show icon next to commit reference when comparing branch or tag
Signed-off-by: Mario Lubenka <[email protected]>
* Updates css file
Signed-off-by: Mario Lubenka <[email protected]>
* Fixes import order
* Renames template variable
* Update routers/repo/compare.go
Co-Authored-By: zeripath <[email protected]>
* Update from master
Signed-off-by: Mario Lubenka <[email protected]>
* Allow short-shas in compare
* Renames prInfo to compareInfo
Signed-off-by: Mario Lubenka <[email protected]>
* Check PR permissions only if compare is pull request
Signed-off-by: Mario Lubenka <[email protected]>
* Adjusts comment
Signed-off-by: Mario Lubenka <[email protected]>
* Use compareInfo instead of prInfo
* Use go-git for tree reading and commit info lookup.
Signed-off-by: Filip Navara <[email protected]>
* Use TreeEntry.IsRegular() instead of ObjectType that was removed.
Signed-off-by: Filip Navara <[email protected]>
* Use the treePath to optimize commit info search.
Signed-off-by: Filip Navara <[email protected]>
* Extract the latest commit at treePath along with the other commits.
Signed-off-by: Filip Navara <[email protected]>
* Fix listing commit info for a directory that was created in one commit and never modified after.
Signed-off-by: Filip Navara <[email protected]>
* Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit).
Signed-off-by: Filip Navara <[email protected]>
* Use go-git for reading blobs.
Signed-off-by: Filip Navara <[email protected]>
* Make SHA1 type alias for plumbing.Hash in go-git.
Signed-off-by: Filip Navara <[email protected]>
* Make Signature type alias for object.Signature in go-git.
Signed-off-by: Filip Navara <[email protected]>
* Fix GetCommitsInfo for repository with only one commit.
Signed-off-by: Filip Navara <[email protected]>
* Fix PGP signature verification.
Signed-off-by: Filip Navara <[email protected]>
* Fix issues with walking commit graph across merges.
Signed-off-by: Filip Navara <[email protected]>
* Fix typo in condition.
Signed-off-by: Filip Navara <[email protected]>
* Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes).
Signed-off-by: Filip Navara <[email protected]>
* Fix lising submodules.
Signed-off-by: Filip Navara <[email protected]>
* Fix build
Signed-off-by: Filip Navara <[email protected]>
* Add back commit cache because of name-rev
Signed-off-by: Filip Navara <[email protected]>
* Fix tests
Signed-off-by: Filip Navara <[email protected]>
* Fix code style
* Fix spelling
* Address PR feedback
Signed-off-by: Filip Navara <[email protected]>
* Update vendor module list
Signed-off-by: Filip Navara <[email protected]>
* Fix getting trees by commit id
Signed-off-by: Filip Navara <[email protected]>
* Fix remaining unit test failures
* Fix GetTreeBySHA
* Avoid running `git name-rev` if not necessary
Signed-off-by: Filip Navara <[email protected]>
* 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
* 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