aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/git.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/vcs: add repo.Contains methodDmitry Vyukov2020-12-251-0/+5
| | | | | | Returns true if the current tree contains the specified commit (the commit is reachable from the current HEAD). Cntains(commit string) (bool, error)
* pkg/kconfig: store minimization resultsJouni Hogander2020-12-101-4/+5
| | | | | Store config options identified using DebugTracer. Also change bisection and configuration minimization code to use new DebugTracer.
* pkg/vcs: use --force with git fetchDmitry Vyukov2020-12-101-3/+3
| | | | | | | | | | | | | | git fetch can fail due to force-recreated tags: > ! [rejected] ext4_for_linus -> ext4_for_linus > (would clobber existing tag) And due to something related to updating local branches (see 'git help fetch' for details). --force should avoid both issues and it seems that we always want force for our purposes (rather than fail update/patch testing).
* pkg/vcs/git: optimize CheckoutBranchAlexander Egorenkov2020-11-201-1/+4
| | | | | | | | | | | | | | | | | Fetching a remote branch w/o the corresponding remote with git disables delta optimization on the server's side and the git client is forced to download the complete branch even if it already has got an older version. This leads to several problems as: * Long fetch time * Limitless growth of local git repo due to git fetch creating a new pack file every time Create a remote before fetching to fix the above issues. With a remote, only the first fetch will take some time and all the following ones shall be very fast. Furthermore, git fetch will avoid creating many pack files in .git/objects/pack. Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
* tools/syz-kconf: detect -rcN tagsDmitry Vyukov2020-10-291-6/+6
| | | | | | 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 repo OptPrecious and OptDontSandbox optionsDmitry Vyukov2020-10-211-18/+38
| | | | | | | | | | The pkg/vcs code assumed that we fully manage the repo within an autonomous program. In particular it tried to repair any errors by dropping and re-creating the repo. This does not work well for command-line tools that work with a user-provided repo. Add OptPrecious for such uses. Update #2171
* pkg/vcs: add ReleaseTagDmitry Vyukov2020-10-211-10/+21
| | | | | | | Add ReleaseTag method that returns last release tag for the given commit. Update #2171
* pkg/vcs: use committer dateTetsuo Handa2020-10-101-4/+9
| | | | | | | | 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-8/+8
| | | | | | 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 sandbox syzkaller repoDmitry Vyukov2020-07-121-5/+19
| | | | | | | | | | | | | | | | | | | Currently we sandbox all repos b/c we assumed that all builds are also sandboxes. But this causes havoc for bisection/patch testing b/c syzkaller build is not actually sandboxed anywhere. Build creates root-owned files and then git can't do anything with them but don't report errors either: $ git checkout 8eda0b95 && echo OK error: unable to unlink old 'sys/linux/gen/386.go': Permission denied error: unable to unlink old 'sys/linux/gen/ppc64le.go': Permission denied ... HEAD is now at 8eda0b957e5b OK We trust own sources and we don't test syzkaller patches, so don't sandbox syzkaller repos.
* pkg/vcs: reset state even moreDmitry Vyukov2020-07-041-1/+2
| | | | | | "git clean -fd" does not remove ignored files, while can mess state when .gitignore changes across commits. Use "git clean -fdx" to delete ignored files as well.
* pkg/vcs: run git clean with switching commitsDmitry Vyukov2020-05-251-0/+1
| | | | | Maybe it will help to fix: https://groups.google.com/forum/#!topic/syzkaller-bugs/2lgvlHd8t1c
* pkg/vcs: always extract tags from subjectDmitry Vyukov2020-05-181-15/+2
|
* pkg/vcs: Unset various git environment variables when invoking gitAndrew Donnellan2019-12-121-1/+22
| | | | | | | | | | | | | | | | If you try to run git-using tests while the GIT_DIR environment variable (and GIT_WORK_TREE, etc) happens to be set, the tests are going to do fun and exciting things on a repository that isn't the test repository it tries to set up. As it turns out, if you try to run "make test" using git rebase -x, you'll end up with GIT_DIR set to the syzkaller tree. Hilarity ensues. Unset GIT_DIR, GIT_WORK_TREE and a few other environment variables when invoking git - that way it'll default to looking at the working directory that we have given it, which is what we expect. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
* dashboard/app: don't report bisections pointing to release commitsDmitry Vyukov2019-11-271-0/+12
| | | | | | | | | | | They should have been detected by "same binary" logic. But the problem is that we may use different compilers for different commits and they switch exactly at release commits. So we can build the release with a differnet compiler than the rest of commits and then obviously it won't be "same binary". Detect release commits separately. Update #1271
* pkg/bisect: detect wrong bisectionsDmitry Vyukov2019-11-071-3/+5
| | | | | | | | Detect bisection to merge commits and to commits that don't affect kernel binary (comments, other arches, whitespaces, etc). Such bisections are not reported in emails (but shown on web). Update #1271
* pkg/bisect: add initial testing support for cause bisectionZubin Mithra2019-10-221-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | (note: incomplete change) Refactor existing code as follows: * Move reusable test utility functions from git_repo_test.go to pkg/vcs/test_util.go and make them exported. * Split Run() into Run()+runImpl(). * Change type of bisect.go:env.inst to `instance.BuilderTester`. Change usage inside syz-testbuild/testbuild.go accordingly. * Move most of linux.PreviousReleaseTags() into vcs/git.go as git.previousReleaseTags(). * Allow build.CompilerIdentity to be mocked. Introduce the following changes: * instance.BuilderTester is an interface with methods BuildSyzkaller() BuildKernel() Test() NewEnv() now returns this interface. * type testEnv implements instance.BuilderTester. * type testBuilder implements builder interface. Add a entry into table inside pkg/build/build.go:getBuilder() to return testBuilder object.
* pkg/vcs: handle git commits without a bodyAnton Lindqvist2019-09-241-1/+15
| | | | | | | | | | OpenBSD uses cvs and does not enforce the standard Git convention for commit messages of putting a summary followed by a new line and body. If such commit[1] contains a `Reported-by` header, it's currently not detected. Instead, if the body is empty try to extract data from the commit summary. [1] https://github.com/openbsd/src/commit/bdbfbec5cea84d24d6a598cf1e63dbdb10e8331a
* pkg/vcs: wrap git invocations in a helper methodDmitry Vyukov2019-03-201-29/+30
| | | | | There is a bunch of repetition to invoke git. Wrap it into a helper method.
* pkg/vcs: reset repo moreDmitry Vyukov2019-03-171-7/+15
| | | | | | | | If we cherry-pick some fixes during bisection we need to "git reset" repo before "git bisect reset". Otherwise it will fail. Reset repo in more points. Update #501
* pkg/vcs: refactor bisection supportDmitry Vyukov2019-03-171-62/+58
| | | | | | | | | | | | | | | 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-43/+102
| | | | | | | | | | | | | | | 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: fetch git tags when checking out particular commitDmitry Vyukov2019-01-041-1/+1
| | | | | | Fetch of a named remote does not seem to fetch all tags. This is a problem for linux-next as it contains lots of tags that are not on the main branch because of periodic rebases.
* pkg/vcs: don't use --no-tags when fetching gitDmitry Vyukov2018-12-171-1/+1
| | | | | | | pkg/bisect uses Poll and then relies on tags for compiler detection. Don't use --no-tags when fetching. Update #501
* pkg/vcs: fix fetching of commits on non master branchDmitry Vyukov2018-12-161-2/+10
| | | | Fixes #728
* pkg/vcs: add openbsd supportDmitry Vyukov2018-09-111-5/+1
| | | | | | | This just says that we want to use git to checkout OpenBSD without any special/complex features. Update #712
* pkg/vcs: add fuchsia supportDmitry Vyukov2018-06-271-13/+3
| | | | For now only checking out and polling.
* pkg/vcs: pave way for multi-vcs supportDmitry Vyukov2018-06-271-181/+65
| | | | | 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/+496
Rename pkg/git to pkg/vcs because we need to support not only git.