aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-05-30database::repo_update(): Fix SQL `UPDATE` queryTeddy Wing
Forgot to add commas when I added the additional fields.
2021-05-30database: Always try to create the database and tablesTeddy Wing
This is simpler, and means we don't have to check if the database file exists and only initialise if it doesn't. Here, we can just run the code and trust it will do the right thing in both cases.
2021-05-30database: Add repo description to `repositories` tableTeddy Wing
Store the repository description so we can check whether the description was updated and copy it in our mirror accordingly.
2021-05-30main::update(): Add TODOTeddy Wing
2021-05-30main::update(): Update repository description on fetch updateTeddy Wing
If the repository was updated, write the description into the `description` file. Add a `github::Repo.description()` method to get an empty string if the description is `None`. This facilitates writing to the `description` file.
2021-05-30main: Remove unused repo variable `r`Teddy Wing
Looks like I'm not going to be using this, since the functions in this match arm that take `database::Repo`s should take the one based on the `github::Repo` rather than the one fetched from the database.
2021-05-30git::mirror(): Write empty description if `description` is `None`Teddy Wing
This gets rid of the default description string: Unnamed repository; edit this file 'description' to name the repository.
2021-05-30main: Fetch from repositories that exist and have been updatedTeddy Wing
2021-05-30Clone forks to a `/fork/` pathTeddy Wing
Separate source and fork repositories into different paths.
2021-05-30Replace boxed errors with concrete error typesTeddy Wing
2021-05-30main::mirror: Take a `github::Repo` instead of repo attribute argumentsTeddy Wing
I wanted to move `clone_path` into `mirror()` so I could make a different clone path for forks.
2021-05-30Add repository description when mirroringTeddy Wing
Copy the repository description from GitHub into the clone repo.
2021-05-30main: Mirror new repositoriesTeddy Wing
If we haven't encountered a repository yet, mirror it to the filesystem. Change `From<github::Repo>` to `From<&github::Repo>` so we don't consume the repo and can use it later in the repo list loop.
2021-05-30main: Add notes for CGit mirroring stepsTeddy Wing
2021-05-30main: Add TODO for mirroring Git repositoryTeddy Wing
2021-05-30main: If repo was updated, save new `updated_at` valueTeddy Wing
If the repo was updated since we last cached it, update the `updated_at` column to the new value so we know that we fetched the latest.
2021-05-30database::repo_is_updated: Use `fetch_optional`Teddy Wing
I think I like this better than checking the `RowNotFound` error.
2021-05-30Check if repo was updated based on `updated_at` timestampTeddy Wing
Find out if the latest copy is more recent than the cached value in our database.
2021-05-30main: If repo is not in database, insert itTeddy Wing
2021-05-30database: Use a custom `Error` typeTeddy Wing
Get rid of the boxed errors to make matching on errors easier.
2021-05-30main: Add test `Repo` dataTeddy Wing
Will be using this to implement the main logic.
2021-05-30database: Implement `From<github::Repo>` for `database::Repo`Teddy Wing
2021-05-30database: Change `GithubRepo` arguments to `Repo`Teddy Wing
Also change `repo_insert()` to take only a single repo instead of a slice of them.
2021-05-30database::Repo: Make `id` non-optionalTeddy Wing
2021-05-30database::repo_get: Don't need my own error for empty rowTeddy Wing
Sqlx already returns an appropriate error if no row was found.
2021-05-30database: Add a way to get a single repoTeddy Wing
2021-05-29Create SQLite databaseTeddy Wing
Set up the database with a table for repositories so we can cache when they were last updated.
2021-05-29Start setting up database interfaceTeddy Wing
2021-05-29src/git.rs: Add function documentationTeddy Wing
2021-05-29github::fetch_repos(): Remove `unwrap`sTeddy Wing
2021-05-29Move `Repo` to `github` moduleTeddy Wing
Makes more sense here rather than in its own module since it models GitHub's repository structure.
2021-05-29Add function to update a Git repositoryTeddy Wing
Should work like: $ git remote update From what I can tell from: https://github.com/git/git/blob/a0dda6023ed82b927fa205c474654699a5b07a82/builtin/remote.c#L1452-L1490 this translates to something like: $ git fetch --prune --multiple default --all
2021-05-29git::mirror(): Extract argumentsTeddy Wing
Move hard-coded repository values to function arguments.
2021-05-29Work out how to mirror a Git repositoryTeddy Wing
Based on the guide here: https://libgit2.org/docs/guides/101-samples/#repositories_clone_mirror References: https://github.com/libgit2/libgit2sharp/issues/577 https://github.com/libgit2/libgit2.github.io/pull/31
2021-05-29Split GitHub API request into separate filesTeddy Wing
2021-05-29Parse GitHub API response to a structTeddy Wing
2021-05-29Move headers into HTTP client instead of requestTeddy Wing
2021-05-29Make a test request to the GitHub API to get user reposTeddy Wing
2021-05-29New Rust v1.50.0 projectTeddy Wing