Use `httm` to convert your ZFS/btrfs snapshots to `git` archives

Introducing nicotine, the perfect complement to tar. (Yes, I do need a better name for this script.) nicotine is a wrapper script for httm1 which converts unique file versions on snapshots to git archives.

Although a proof of concept script which accomplishes something similar has been included in the httm README.md for awhile, if you need your snapshots on the go, and if you can't just send and receive the bits, you shouldn't have to copy and paste a script. Perhaps you also deserve some polish and some basic sanity checks!

First, create a snapshot archive:

➜ nicotine ~/program/httm/*
nicotine archive created successfully: /home/kimono/Cargo.lock-snapshot-archive.tar.gz
nicotine archive created successfully: /home/kimono/Cargo.toml-snapshot-archive.tar.gz
/srv/program/httm/debian is an empty directory. Skipping.
nicotine archive created successfully: /home/kimono/httm.1-snapshot-archive.tar.gz
nicotine archive created successfully: /home/kimono/LICENSE-snapshot-archive.tar.gz
nicotine archive created successfully: /home/kimono/packaging-snapshot-archive.tar.gz
nicotine archive created successfully: /home/kimono/README.md-snapshot-archive.tar.gz
nicotine archive created successfully: /home/kimono/scripts-snapshot-archive.tar.gz
nicotine archive created successfully: /home/kimono/src-snapshot-archive.tar.gz

Next, expand that archive wherever you need it:

➜ tar zxvf httm.1-snapshot-archive.tar.gz
./httm.1/
./httm.1/httm.1
./httm.1/.git/
...

Then, use it as you would any git repo. For instance, view changes to files via git log -p:

➜  cd httm.1; git log -p
commit c2cd0f4c7728b3f3dcd7d87d7c24334b0d5b5d41 (HEAD -> master)
Author: ...
Date:   Mon Jan 30 14:53:30 2023 -0600

    httm commit from ZFS snapshot

diff --git a/httm.1 b/httm.1
index 3831a10..e895f53 100644
--- a/httm.1
+++ b/httm.1
@@ -1,9 +1,9 @@
    .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.49.3.
-.TH HTTM "1" "January 2023" "httm 0.20.0" "User Commands"
+.TH HTTM "1" "January 2023" "httm 0.20.1" "User Commands"
    .SH NAME
-httm \- manual page for httm 0.20.0
+httm \- manual page for httm 0.20.1
    .SH DESCRIPTION
-httm 0.20.0
+httm 0.20.1
...
1

httm prints the size, date and corresponding locations of available unique versions (deduplicated by modify time and size) of files residing on snapshots, and can also be used interactively to select, restore, and snapshot files.