<feed xmlns='http://www.w3.org/2005/Atom'>
<title>code-review/code-review-database, branch master</title>
<subtitle>Tools to facilitate code review on the command line</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/'/>
<entry>
<title>Update copyright years on recently changed files</title>
<updated>2023-11-24T20:13:22+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2023-11-24T20:13:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=095286de0e4df86706a807d3898cded4adeeb5d5'/>
<id>095286de0e4df86706a807d3898cded4adeeb5d5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>code-review-changed-files: Move "..." back to `get_merge_base`</title>
<updated>2023-11-24T20:06:46+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2023-11-24T20:06:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=7232165a08aeb511970b5876c6ea13ee443bfe4d'/>
<id>7232165a08aeb511970b5876c6ea13ee443bfe4d</id>
<content type='text'>
It's more convenient to have the "..." here because all of the
code-review commands use `get_merge_base`. Otherwise I'd end up having
to add it to most of the other commands.

But now, instead of only adding it to the default merge base, add it to
all merge bases, including the one set by `code-review-start`. This
makes all merge bases consistent, and means you don't have to include
the dots when setting a custom merge base.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's more convenient to have the "..." here because all of the
code-review commands use `get_merge_base`. Otherwise I'd end up having
to add it to most of the other commands.

But now, instead of only adding it to the default merge base, add it to
all merge bases, including the one set by `code-review-start`. This
makes all merge bases consistent, and means you don't have to include
the dots when setting a custom merge base.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-review-database: Add environment variable for merge base</title>
<updated>2023-11-24T19:50:00+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2023-11-24T19:50:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=0cc2afee74cd3025870a091ec57c5709e2c2ce9f'/>
<id>0cc2afee74cd3025870a091ec57c5709e2c2ce9f</id>
<content type='text'>
I was inspired by Jake Zimmerman's blog post "Code Review from the
Command Line" (https://blog.jez.io/cli-code-review/) to add an
environment variable override for the merge base. This allows us to set
a different merge base for individual command executions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I was inspired by Jake Zimmerman's blog post "Code Review from the
Command Line" (https://blog.jez.io/cli-code-review/) to add an
environment variable override for the merge base. This allows us to set
a different merge base for individual command executions.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-review-database: Remove "..." from merge base</title>
<updated>2023-11-24T19:44:18+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2023-11-24T19:44:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=9afec6570dd9795aeb720678cd3b2286d3998a13'/>
<id>9afec6570dd9795aeb720678cd3b2286d3998a13</id>
<content type='text'>
I don't think this is the right approach, but since I added the "..." in
`code-review-changed-files` in 7659cf07f118fec4c1ba9677c82a7ef61511e797,
removing the "..." from here allows the difftool script to work when
using the default merge base.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I don't think this is the right approach, but since I added the "..." in
`code-review-changed-files` in 7659cf07f118fec4c1ba9677c82a7ef61511e797,
removing the "..." from here allows the difftool script to work when
using the default merge base.
</pre>
</div>
</content>
</entry>
<entry>
<title>get_merge_base(): Change default base to `master...`</title>
<updated>2019-06-17T18:05:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-17T18:05:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=42215fe2bbefba19308bd879f6507123d53d1fe1'/>
<id>42215fe2bbefba19308bd879f6507123d53d1fe1</id>
<content type='text'>
Add the range filter to try to remove commits that we don't care about.
Still not sure if this will work in all cases, as sometimes `..` seemed
to give me the right collection of files and sometimes `...` did.

code-review-difftool:
Pass the merge base without range dots (`..` or `...`) to Vim Fugitive,
as it doesn't accept revisions with ranges. Not sure what to do if I get
a range with two revision names yet, though.

Turns on Bash's `extglob` in order to use `?(...)` to include both
patterns in the expansion.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the range filter to try to remove commits that we don't care about.
Still not sure if this will work in all cases, as sometimes `..` seemed
to give me the right collection of files and sometimes `...` did.

code-review-difftool:
Pass the merge base without range dots (`..` or `...`) to Vim Fugitive,
as it doesn't accept revisions with ranges. Not sure what to do if I get
a range with two revision names yet, though.

Turns on Bash's `extglob` in order to use `?(...)` to include both
patterns in the expansion.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-review-database: Always try to create the database</title>
<updated>2019-06-11T18:41:03+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-11T18:41:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=87b53c3468625eab072dbd80e983eb3b364d4a10'/>
<id>87b53c3468625eab072dbd80e983eb3b364d4a10</id>
<content type='text'>
If the database doesn't exist, we get this error:

    Error: near line 3: no such table: merge_bases

This is because `sqlite3` will always create a new database if it
doesn't exist when running a command against a database. The
newly-created database doesn't have the required table, and we get the
error.

Fix the problem by ensuring the database always exists and is
initialised properly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the database doesn't exist, we get this error:

    Error: near line 3: no such table: merge_bases

This is because `sqlite3` will always create a new database if it
doesn't exist when running a command against a database. The
newly-created database doesn't have the required table, and we get the
error.

Fix the problem by ensuring the database always exists and is
initialised properly.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-review-database: Remove TODO</title>
<updated>2019-06-10T18:04:38+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-10T18:04:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=926cb7085175c270527562f0e2f0a4feb9930b33'/>
<id>926cb7085175c270527562f0e2f0a4feb9930b33</id>
<content type='text'>
This was taken care of in 21534162124501f0410ee31cd31130aa3b92a9f3.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was taken care of in 21534162124501f0410ee31cd31130aa3b92a9f3.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add license (GNU GPLv3+)</title>
<updated>2019-06-10T10:48:33+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-10T10:48:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=3bfeca8f6735e9f614f898af56da29775c47d337'/>
<id>3bfeca8f6735e9f614f898af56da29775c47d337</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>code-review-database(create_merge_base): Upsert merge base</title>
<updated>2019-06-10T00:08:51+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-10T00:08:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=21534162124501f0410ee31cd31130aa3b92a9f3'/>
<id>21534162124501f0410ee31cd31130aa3b92a9f3</id>
<content type='text'>
Don't duplicate rows if we call `create_merge_base` multiple times.
Doing so would mean we'd get multiple merge base rows for the same head.

Instead, overwrite the existing merge base for a given head using an
upsert.

Thanks a bunch to MarqueIV
(https://stackoverflow.com/users/168179/marqueiv) on Stack Overflow for
demonstrating a way to do an upsert without the UPSERT syntax. This
enables us to do an upsert on SQLite &lt; 3.24.0. Neat trick.
https://stackoverflow.com/questions/15277373/sqlite-upsert-update-or-insert/38463024#38463024
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't duplicate rows if we call `create_merge_base` multiple times.
Doing so would mean we'd get multiple merge base rows for the same head.

Instead, overwrite the existing merge base for a given head using an
upsert.

Thanks a bunch to MarqueIV
(https://stackoverflow.com/users/168179/marqueiv) on Stack Overflow for
demonstrating a way to do an upsert without the UPSERT syntax. This
enables us to do an upsert on SQLite &lt; 3.24.0. Neat trick.
https://stackoverflow.com/questions/15277373/sqlite-upsert-update-or-insert/38463024#38463024
</pre>
</div>
</content>
</entry>
<entry>
<title>Move database functions from code-review-start to code-review-database</title>
<updated>2019-06-09T19:47:49+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2019-06-09T19:43:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/code-review/commit/?id=df93125733ef95038e9281f605e117ec805218f6'/>
<id>df93125733ef95038e9281f605e117ec805218f6</id>
<content type='text'>
Put these functions in a function-only file that can be sourced by other
scripts that need database access.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Put these functions in a function-only file that can be sourced by other
scripts that need database access.
</pre>
</div>
</content>
</entry>
</feed>
