@mwl@io.mwl.ioMichael Lucas :flan_set_fire:’s post made me revisit RCS in a very small role: a safety net for individual files.
Paired with nvi, a tiny wrapper lets me snapshot configs before risky edits. Simple, local, no magic.

Example wrapper I’m using:

#!/bin/sh
#
# safeedit — RCS-backed safe editing with nvi
#

set -e

if [ $# -ne 1 ]; then
echo "usage: safeedit <file>" >&2
exit 1
fi

FILE="$1"

if [ ! -f "$FILE" ]; then
echo "safeedit: file not found: $FILE" >&2
exit 1
fi

DIR=$(dirname "$FILE")
BASE=$(basename "$FILE")
RCS_DIR="$DIR/RCS"
RCS_FILE="$RCS_DIR/$BASE,v"

mkdir -p "$RCS_DIR"
chmod 700 "$RCS_DIR"

if [ ! -f "$RCS_FILE" ]; then
ci -l "$FILE"
else
ci -u "$FILE" || true
co -l "$FILE"
fi

exec nvi "$FILE"
nvi protects the session; RCS protects the decision.

Original post by @mwl@snac.bsd.cafe: https://io.mwl.io/@mwl/115814245521209100


0

If you have a fediverse account, you can quote this note from your own instance. Search https://snac.bsd.cafe/r1w1s1/p/1767214984.247541 on your instance and quote it. (Note that quoting is not supported in Mastodon.)