<feed xmlns='http://www.w3.org/2005/Atom'>
<title>reflectub/src, branch make-errors-more-traceable</title>
<subtitle>Mirror a user’s GitHub repositories</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/'/>
<entry>
<title>github::Repo: Change `git_url` to `clone_url`</title>
<updated>2022-06-04T12:10:55+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=af1c2811362a603f8878d75590eda3e439665786'/>
<id>af1c2811362a603f8878d75590eda3e439665786</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, was changed from an "https://" URL to
a "git://" URL. Since Reflectub is not authorised to clone any GitHub
"git://" URLs, the connection timed out.

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 the
HTTPS clone URL. This 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, was changed from an "https://" URL to
a "git://" URL. Since Reflectub is not authorised to clone any GitHub
"git://" URLs, the connection timed out.

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 the
HTTPS clone URL. This 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>
<entry>
<title>set_agefile_time: Move repo cgitrc file append to a function</title>
<updated>2021-06-24T22:55:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-24T22:41:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=f3d2cee56389bb41fd539137358eb9dbc884c49f'/>
<id>f3d2cee56389bb41fd539137358eb9dbc884c49f</id>
<content type='text'>
I need to add another line to the repo-local cgitrc file to set the
default branch. Move this code to a function so we can reuse it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I need to add another line to the repo-local cgitrc file to set the
default branch. Move this code to a function so we can reuse it.
</pre>
</div>
</content>
</entry>
<entry>
<title>main::update(): Change HEAD branch if default branch changed</title>
<updated>2021-06-24T19:18:07+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-24T19:18:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=85df39e199fa146e22d9cf8ccd635277fe066d12'/>
<id>85df39e199fa146e22d9cf8ccd635277fe066d12</id>
<content type='text'>
If the default branch on GitHub changed, change the local mirror's HEAD
to match the new default.

Need to store the default branch in the database now so we can find out
whether it changed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the default branch on GitHub changed, change the local mirror's HEAD
to match the new default.

Need to store the default branch in the database now so we can find out
whether it changed.
</pre>
</div>
</content>
</entry>
<entry>
<title>git::mirror(): Change HEAD to GitHub default branch</title>
<updated>2021-06-24T18:53:34+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-24T18:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=98ec0eb9370bd12225fde1d8c2ff8b8ace693609'/>
<id>98ec0eb9370bd12225fde1d8c2ff8b8ace693609</id>
<content type='text'>
The default branch after mirroring was typically 'master'. On GitHub,
the default branch may not necessarily be 'master'. Change the default
branch by changing the HEAD to GitHub's default branch so that the
mirrored repository better matches GitHub.

We'll also need to make a change to the update function in case the
default branch changes after mirroring.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The default branch after mirroring was typically 'master'. On GitHub,
the default branch may not necessarily be 'master'. Change the default
branch by changing the HEAD to GitHub's default branch so that the
mirrored repository better matches GitHub.

We'll also need to make a change to the update function in case the
default branch changes after mirroring.
</pre>
</div>
</content>
</entry>
</feed>
