I think I finally figured out how to work with git for small subtrees,
and not get annoyed with the $OpenBSD$ keyword expansion...


- define a filter in your git attributes, that's either
$GITDIR/info/attributes or ~/.gitattributes:
*       filter=openbsd

- set up the filter to clean files, that's either
$GITDIR/config or ~/.gitconfig:
[filter "openbsd"]
        clean = openbsd-zap

- create a script in your PATH that cleans up things, in my case,
~/bin/openbsd-zap

#! /usr/bin/perl -p
# what ? you expected another scripting language
s/\$OpenBSD\:.*?\$/\$OpenBSD\$/g;
s/[ \t]+$//; # jmc's gonna love that



side-effect: git diff is a bit slower...

Reply via email to