<feed xmlns='http://www.w3.org/2005/Atom'>
<title>reflectub/src, branch v0.0.3</title>
<subtitle>Mirror a user’s GitHub repositories</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/'/>
<entry>
<title>database: Update copyright year</title>
<updated>2022-06-04T16:59:25+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-04T16:59:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=6fe38d83ec90f5adb411706ed23d9a8b2929aed8'/>
<id>6fe38d83ec90f5adb411706ed23d9a8b2929aed8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>database::Repo: From&lt;&amp;github::Repo&gt;: Use newest update date</title>
<updated>2022-06-04T16:14:08+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-04T16:14:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=b324a7a96acbaf589fedca245e9e5659ee9cd8fa'/>
<id>b324a7a96acbaf589fedca245e9e5659ee9cd8fa</id>
<content type='text'>
It turns out the GitHub `updated_at` field doesn't change when new
commits are pushed to the repository, only when the repository config
etc. changes.

In order to update the mirrors when any update happens in the
repository, we need to look at both of those date values to see if
they've been updated.

Take the most recent of `updated_at` or `pushed_at` and set it to
`(database::Repo).updated_at`. This allows us to refresh the repo when
either of those dates change, catching all GitHub repo updates.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It turns out the GitHub `updated_at` field doesn't change when new
commits are pushed to the repository, only when the repository config
etc. changes.

In order to update the mirrors when any update happens in the
repository, we need to look at both of those date values to see if
they've been updated.

Take the most recent of `updated_at` or `pushed_at` and set it to
`(database::Repo).updated_at`. This allows us to refresh the repo when
either of those dates change, catching all GitHub repo updates.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright year</title>
<updated>2022-06-04T12:25:32+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-04T12:25:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=34c69bd00249d78e9277bb66c6c0bf7e5b4613a1'/>
<id>34c69bd00249d78e9277bb66c6c0bf7e5b4613a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>github::Repo: Change `git_url` to `clone_url`</title>
<updated>2022-06-04T12:11:54+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-04T03:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=996426344348fb72b283a2df18a981d073aecad8'/>
<id>996426344348fb72b283a2df18a981d073aecad8</id>
<content type='text'>
I was getting errors mirroring and updating:

    failed to connect to github.com: Connection timed out; class=Os (2)

and

    remote 'origin' already exists; class=Config (7); code=Exists(-4)

It turns out that the `git_url` field, which I had been using previously
to mirror and clone repositories, stopped working. My guess is that it's
because Reflectub is not authorised to clone GitHub "git://" URLs, so
the connection timed out. I'm not sure why this stopped being allowed,
though.

The URL change seems to have happened around March 2022, or at least
between December 2021 and April 2022.

The second error was caused by a previously-created repository existing
in the filesystem, but not being in the database as it hadn't been
correctly mirrored. For now, I've decided not to fix that problem and am
only fixing the URL issue.

The GitHub API also includes a `clone_url` field, which contains an
HTTPS clone URL. Using this URL to mirror fixes the timeout problem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I was getting errors mirroring and updating:

    failed to connect to github.com: Connection timed out; class=Os (2)

and

    remote 'origin' already exists; class=Config (7); code=Exists(-4)

It turns out that the `git_url` field, which I had been using previously
to mirror and clone repositories, stopped working. My guess is that it's
because Reflectub is not authorised to clone GitHub "git://" URLs, so
the connection timed out. I'm not sure why this stopped being allowed,
though.

The URL change seems to have happened around March 2022, or at least
between December 2021 and April 2022.

The second error was caused by a previously-created repository existing
in the filesystem, but not being in the database as it hadn't been
correctly mirrored. For now, I've decided not to fix that problem and am
only fixing the URL issue.

The GitHub API also includes a `clone_url` field, which contains an
HTTPS clone URL. Using this URL to mirror fixes the timeout problem.
</pre>
</div>
</content>
</entry>
<entry>
<title>git.rs: Add more context to errors</title>
<updated>2022-06-02T22:50:17+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-02T22:50:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=b8a188e19e7ec0ae381c18a5a4db86fb576bf95a'/>
<id>b8a188e19e7ec0ae381c18a5a4db86fb576bf95a</id>
<content type='text'>
Add full definitions for our new error variant ideas.

Use a distinct variant and message in each error case in order to trace
errors to the line of code where they occur.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add full definitions for our new error variant ideas.

Use a distinct variant and message in each error case in order to trace
errors to the line of code where they occur.
</pre>
</div>
</content>
</entry>
<entry>
<title>git.rs: Ideas for error structure and context</title>
<updated>2022-06-02T21:22:39+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-02T21:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=0951bb614aa1602983dacbf604c5a52e44d49bc3'/>
<id>0951bb614aa1602983dacbf604c5a52e44d49bc3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>git.rs: Add `Error::MirrorAddRemote` variant</title>
<updated>2022-06-02T19:33:20+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-02T19:33:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=079ca8b33657da216a8d08a9fae0fd54e488ec71'/>
<id>079ca8b33657da216a8d08a9fae0fd54e488ec71</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>git.rs: Add ideas for new error variants</title>
<updated>2022-06-02T19:27:33+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2022-06-02T19:27:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=bde733890aeea0a1bbbdcbc1ad14fe05ed58661a'/>
<id>bde733890aeea0a1bbbdcbc1ad14fe05ed58661a</id>
<content type='text'>
These variants should make it easier to trace where in the code that a
particular error occurred, and include a context-descriptive error
message.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These variants should make it easier to trace where in the code that a
particular error occurred, and include a context-descriptive error
message.
</pre>
</div>
</content>
</entry>
<entry>
<title>set_agefile_time(): Don't add `agefile=info/web/last-modified` to cgitrc</title>
<updated>2021-06-25T17:55:50+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-25T17:55:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=82966ee8d37f64b4d0b148507a775e8d25116548'/>
<id>82966ee8d37f64b4d0b148507a775e8d25116548</id>
<content type='text'>
We don't need to set the `agefile` config value because
"info/web/last-modified" is already CGit's default value for the
setting.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We don't need to set the `agefile` config value because
"info/web/last-modified" is already CGit's default value for the
setting.
</pre>
</div>
</content>
</entry>
<entry>
<title>main: If the default branch is not "master", set cgitrc defbranch</title>
<updated>2021-06-24T22:58:18+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-24T22:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=bf189958d498255e486455e803d93b5e8de7539e'/>
<id>bf189958d498255e486455e803d93b5e8de7539e</id>
<content type='text'>
In order for CGit to know that the repository uses a default branch that
isn't "master", we need to set the `defbranch` setting in 'cgitrc'.

The mtime is read from either the "master" ref or the ref specified with
`defbranch`:
https://git.zx2c4.com/cgit/tree/ui-repolist.c?id=5258c297ba6fb604ae1415fbc19a3fe42457e49e#n56
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order for CGit to know that the repository uses a default branch that
isn't "master", we need to set the `defbranch` setting in 'cgitrc'.

The mtime is read from either the "master" ref or the ref specified with
`defbranch`:
https://git.zx2c4.com/cgit/tree/ui-repolist.c?id=5258c297ba6fb604ae1415fbc19a3fe42457e49e#n56
</pre>
</div>
</content>
</entry>
</feed>
