<feed xmlns='http://www.w3.org/2005/Atom'>
<title>reflectub/src, branch v0.0.2</title>
<subtitle>Mirror a user’s GitHub repositories</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/'/>
<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>
<entry>
<title>main: Re-enable GitHub repository fetching</title>
<updated>2021-06-23T22:32:31+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-23T22:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=39ff96139cf9b8e35c83877c38e9fb75c1b84409'/>
<id>39ff96139cf9b8e35c83877c38e9fb75c1b84409</id>
<content type='text'>
Now that we're done working out empty repository handling for setting
the mtime, revert this hard-coded test repository change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we're done working out empty repository handling for setting
the mtime, revert this hard-coded test repository change.
</pre>
</div>
</content>
</entry>
<entry>
<title>update_mtime(): Set the mtime to the repo's `pushed_at` time</title>
<updated>2021-06-23T21:52:19+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-23T21:52:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=1aaef56e5b3c3f4ba6e479c809bd77bc585c716b'/>
<id>1aaef56e5b3c3f4ba6e479c809bd77bc585c716b</id>
<content type='text'>
Use `pushed_at` instead of `updated_at`. This mtime is used to sort
repositories on CGit's repository index page. Prevent things like GitHub
stars from changing the sort order. The sort should instead be
influenced by repository changes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use `pushed_at` instead of `updated_at`. This mtime is used to sort
repositories on CGit's repository index page. Prevent things like GitHub
stars from changing the sort order. The sort should instead be
influenced by repository changes.
</pre>
</div>
</content>
</entry>
<entry>
<title>update_mtime(): Extract agefile handling to a separate function</title>
<updated>2021-06-23T21:45:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-23T21:45:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=5de391101d72f0d2239a69073b08861641d9c878'/>
<id>5de391101d72f0d2239a69073b08861641d9c878</id>
<content type='text'>
The `update_mtime()` function is getting pretty long. Extract this into
a new function since it's more of a self-contained unit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `update_mtime()` function is getting pretty long. Extract this into
a new function since it's more of a self-contained unit.
</pre>
</div>
</content>
</entry>
<entry>
<title>update_mtime(): Remove `.or_else()` idea</title>
<updated>2021-06-23T21:34:00+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-23T21:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=0e2faed4ac9b5950eb786a7127f9fc02df050c25'/>
<id>0e2faed4ac9b5950eb786a7127f9fc02df050c25</id>
<content type='text'>
Decided to keep the `match` expressions. Still working out how to clean
up the code in this function, though.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Decided to keep the `match` expressions. Still working out how to clean
up the code in this function, though.
</pre>
</div>
</content>
</entry>
<entry>
<title>update_mtime(): Write update time to CGit agefile as last recourse</title>
<updated>2021-06-23T21:20:51+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2021-06-23T21:20:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/reflectub/commit/?id=b0287e272376fe788fffdd0fe7d5e799f3517d6e'/>
<id>b0287e272376fe788fffdd0fe7d5e799f3517d6e</id>
<content type='text'>
Adjust the match arms to remove a bit of indentation.

Add some 'anyhow' context to errors for better error reporting.

When "repo/refs/heads/[default-branch]" or "repo/packed-refs" files
don't exist, create a "repo/info/web/last-modified" file and set this
file as the CGit agefile in the repo's local 'cgitrc' file.

It's possible for a repo to not have either of the first two files when
the repo is empty and has no commits.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adjust the match arms to remove a bit of indentation.

Add some 'anyhow' context to errors for better error reporting.

When "repo/refs/heads/[default-branch]" or "repo/packed-refs" files
don't exist, create a "repo/info/web/last-modified" file and set this
file as the CGit agefile in the repo's local 'cgitrc' file.

It's possible for a repo to not have either of the first two files when
the repo is empty and has no commits.
</pre>
</div>
</content>
</entry>
</feed>
