aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/git_test.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/vcs: be more strict in BaseForDiffAleksandr Nogikh2026-01-161-2/+29
| | | | | | | | | | Do not tolerate unknown blob hashes - it means that we are unable to find the correct base commit given the repository. Explicitly ignore newly added files - we definitely won't find their hashes. Explicitly skip malformed patches that won't have any blob hashes - otherwise we could end up with too many candidates and waste too much time.
* pkg/vcs: return multiple base commit candidatesAleksandr Nogikh2026-01-131-12/+11
| | | | | Return the commits that represent unique sets of branches. Sort the list topologically, breaking ties by commit date.
* pkg/vcs: find base commit by blob sha hashesAleksandr Nogikh2026-01-091-0/+84
| | | | | | Given a git diff, determine the latest commit where the modified files still have the exact sha hashes they had at the moment the git patch was created.
* pkg/vcs: extend git testing helpersAleksandr Nogikh2026-01-091-12/+4
| | | | | Add a commitChangeset() method to simplify setting up repository states in tests.
* pkg/vcs: extend ParseGitDiffAleksandr Nogikh2026-01-091-5/+22
| | | | Return not just the modified files, but also their blob hashes.
* pkg/vcs: extend ListCommitHashesAleksandr Nogikh2025-05-131-26/+17
| | | | | | | | | | Rename the method to LatestCommit and make it more flexible: 1) Return the commit date alongside the commit hash. 2) Rename the time filter to highlight that it's non-inclusive. 3) Make it possible to query the commits newer than the specified commit hash. It will let us poll lore archives more efficiently.
* pkg/vcs: export GitWrapperAleksandr Nogikh2025-01-091-3/+3
| | | | | | | | | | | | | The current common vcs interface and its implementations are designed to support a very big number of situations (git modules, cleaning up complex state, etc), which is too heavy and restrictive when we just need a thin wrapper over the git command that supports a few basic operations. Refactor pkg/vcs to split out the wrapper code from the big git implementation of the vcs.Repo interface. Export the wrapper to enable reuse in other parts of the system.
* pkg/vcs: extend ListCommitHashesAleksandr Nogikh2025-01-031-3/+3
| | | | Support filtering by the commit date.
* pkg/vcs: parse git diffsAleksandr Nogikh2024-10-251-0/+22
| | | | Provide a functionality to extract the files affected by a git patch.
* pkg/vcs: expose commit patchDmitry Vyukov2024-10-151-0/+17
| | | | Add Commit.Patch with patch body.
* pkg/vcs: change HeadCommit to CommitDmitry Vyukov2024-10-151-10/+10
| | | | | | | Currently we have HeadCommit function that returns info about the HEAD commit. Change it to a more flexible Commit function that can return info about any commit. This will be used in future changes.
* pkg/vcs: support fetches by a short git hashAleksandr Nogikh2024-03-051-0/+19
| | | | | | | | | | | | The approach we used works perfectly for all commits, but they must be referenced by the full 40 character hash. In almost all cases, users would prefer to use the shorter one. If the commit hash is not 40 characters long, fetch the whole git tree. The only unsupported scenario is fetching a commit that is referenced by custom refs/* by its short hash. It's unlikely there's anything we can do here.
* pkg/vcs: make git fetch calls more specificAleksandr Nogikh2024-01-171-0/+55
| | | | | | | | | This should make syzkaller only fetch the commits relevant for further processing. Also, specifying the exact commit/branch name to fetch allows us to access commits from custom refs. Test the new behaviour and double-check that remote tags fetch was not broken.
* pkg/vcs: extract merge bases of two commitsAleksandr Nogikh2023-04-281-0/+56
|
* pkg/vcs: add two more vcs.Repo methodsAleksandr Nogikh2023-04-061-0/+79
| | | | | | | 1) ListCommitHashes, which lists all commit hashes reachable from the specified commit. 2) Object, which allows to query the contents of an object at the specified revision.
* pkg/bisect: try to reidentify commit rebased after crashSpace Meyer2022-10-061-0/+79
| | | | | | | | | | | | | | When bisecting a breaking commit, syzkaller starts the bisection from the commit recorded in the last crash for the given bug. Previously the bisection was aborted should the commit no longer exist in the repo. Now we try to reidentify the breaking commit. For git pretty much the best we can do is to search a commit reachable from HEAD with the same title. Other VCS systems might have something better. Syzkaller will still first validate that the start commit is indeed broken in the way it expects. This prevents syzkaller from getting confused should we accidentally pick a completely unrelated commit.
* tools/syz-kconf: detect -rcN tagsDmitry Vyukov2020-10-291-1/+32
| | | | | | We currently detect v5.10-rc1 as v5.9 because we ignore -rc tags. This makes it impossible to enable configs that were already added for v5.10. Treat v5.10-rc1 as v5.10 already.
* pkg/vcs: add ReleaseTagDmitry Vyukov2020-10-211-4/+1
| | | | | | | Add ReleaseTag method that returns last release tag for the given commit. Update #2171
* pkg/vcs: use committer dateTetsuo Handa2020-10-101-1/+7
| | | | | | | | The Freshness columns in Instances: table on the dashboard page look outdated, for these fields are showing when that patch was authored. Where possible, using when that patch was committed into the tree in question would be more meaningful. Update #1537
* pkg: get and store Maintainers dataPedro Lopes2020-07-311-3/+3
| | | | | | Create a struct on pkg/vcs to store data of syzkaller email recipients and update its users. The struct contains default name, email, and a label to divide user into To and Cc when sending the emails.
* pkg/vcs: don't CC people on CC (sic)Dmitry Vyukov2019-12-101-1/+0
| | | | Update #1441
* pkg/vcs: refactor bisection supportDmitry Vyukov2019-03-171-6/+13
| | | | | | | | | | | | | | | In preparation for syz-ci bisection: - move bisection function into a separate interface they look out of place in vcs.Repo because most OSes don't implement it and most users don't case - extract author name and more CC emails for commits - move linux-specific PreviousReleaseTags into linux.go - fix inconclusive bisection (more than 1 potential commits) - add tests fr bisection - add maintainers returned from get_maintainers.pl for commits that don't have enough emails (e.g. only author email) Update #501
* dashboard/app: poll commits infoDmitry Vyukov2019-02-171-63/+1
| | | | | | | | | | | | | | | This implements 2 features: - syz-ci polls a set of additional repos to discover fixing commits sooner (e.g. it can now discover a fixing commit in netfilter tree before it reaches any of the tested trees). - syz-ci uploads info about commits to dashboard. For example, a user marks a bug as fixed by commit "foo: bar". syz-ci will find this commit in the main namespace repo and upload commmit hash/date/author to dashboard. This in turn allows to show links to fixing commits. Fixes #691 Fixes #610
* pkg/vcs: also recognize Tested-by: git commit tagsDmitry Vyukov2018-11-201-0/+2
| | | | | For context see: https://groups.google.com/d/msg/syzkaller-bugs/xiSF9GdiikU/uBoyYyf3AQAJ
* pkg/email, pkg/vcs: test that OpenBSD-style commits are handledDmitry Vyukov2018-10-111-2/+15
| | | | | | OpenBSD does not use "first line is title" convention, so test that this is parsed properly. Also test that multi-line fix/dup commands are properly parsed.
* .gometalinter.json: enable gofmtDmitry Vyukov2018-07-311-1/+1
| | | | | | | The part that we want from gofmt is simplify (-s). Fix all code that needs fixing. Update #538
* pkg/vcs: pave way for multi-vcs supportDmitry Vyukov2018-06-271-79/+6
| | | | | Wrap current git interface in abstract interface. Provide constructor that create repo interface for the given os/vm.
* pkg/vcs: move from pkg/gitDmitry Vyukov2018-06-271-0/+239
Rename pkg/git to pkg/vcs because we need to support not only git.