2021-03-30 16:07:58 +00:00
|
|
|
#!/bin/sh
|
2021-05-07 10:31:14 +00:00
|
|
|
stats() {
|
2021-06-18 15:54:39 +00:00
|
|
|
stat --format '%.10y %n %sB - birth %.10w' "$@"
|
2021-05-07 10:31:14 +00:00
|
|
|
}
|
2021-06-18 15:54:39 +00:00
|
|
|
test "$1" = "-q" && quick=-q && shift
|
2021-04-19 08:39:08 +00:00
|
|
|
if test "$#" -gt 0
|
|
|
|
then
|
2021-05-07 10:31:14 +00:00
|
|
|
orig="$(st-unarchive "$1")"
|
2021-06-18 15:54:39 +00:00
|
|
|
if test -n "$quick"
|
|
|
|
then stats "$orig" "$1"
|
|
|
|
else
|
|
|
|
( stats "$orig" "$1"; dif "$orig" "$@" ) |
|
|
|
|
less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen
|
|
|
|
test "$?" -eq "2" && exit 1
|
|
|
|
echo "y|r to restore, n|d to delete, m to merge"
|
|
|
|
read reply
|
|
|
|
case "$reply" in
|
|
|
|
(y|r) st-restore "$1";;
|
|
|
|
(n|d) rm -v "$1";;
|
|
|
|
(m) touch /tmp/empty && git merge-file "$orig" /tmp/empty "$1" && nvim "$orig" && rm "$1";;
|
|
|
|
esac
|
|
|
|
fi
|
2021-07-02 16:33:30 +00:00
|
|
|
else
|
2021-07-04 21:22:53 +00:00
|
|
|
find "$DATA/2-standards/notes/journal" -name "intentions*sync-conflict*" -exec sh -c 'basename {} | cut -d. -f1 | xargs -i% jrnl % --import --file {}' \; -delete
|
2021-07-02 16:33:30 +00:00
|
|
|
find -name '*sync-conflict*' -exec st-diff $quick '{}' \;
|
2021-04-19 08:39:08 +00:00
|
|
|
fi
|