chore(readme): document methods

This commit is contained in:
Anna 2023-08-31 02:25:05 -04:00
parent fae0578386
commit fae0c50149
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 27 additions and 0 deletions

View File

@ -28,6 +28,33 @@ gpg-agent: 353 hashes ( 11.7519/s)
```
<small>The asterisked sequoia is using the `crypto-rust` feature.</small>
## Methods
`git-vain` can use one of several different methods to generate different hashes
for a commit.
**Note that none of these are necessary when using PGP signing.** Since the
signature will be different every time, the hash will also be different every
time. If signing is enabled, none of these methods will be used.
### `increment` and `decrement`
Increases or decreases the commit's timestamp by one second each try. This is
not recommended for longer prefixes (or really at all, in the author's opinion).
### `counter`
Appends an increasing counter to the end of the commit message (in the body).
### `random`
Appends a random 32-character hexadecimal string to the end of the commit
message (in the body).
### `header`
Adds an additional `xvain` header to the commit, which contains an increasing
counter. Git ignores additional headers that aren't `gpgsig`, so this does work
and is considered valid by `git fsck`. In the author's opinion, it is doubtful
that Git would change the way headers are parsed, but it is possible, and that
would break this method (and possibly the commits created by it).
## PGP performance
Signing commits drastically reduces the speed at which `git-vain` operates. By