X-Git-Url: https://mattmccutchen.net/utils/utils.git/blobdiff_plain/2a4c04302618a3888c0af087daa78d70adeeab33..5b69859a5224244f3b1d2721d1545f0aca7ee2cc:/patchsync?ds=sidebyside diff --git a/patchsync b/patchsync index 31a4001..31dd624 100755 --- a/patchsync +++ b/patchsync @@ -1,9 +1,11 @@ #!/bin/bash # patchsync: Synchronizes a trunk, a branch, and a patch containing the # differences between them. -# Version 2 # -- Matt McCutchen -# + +# If I had to update the version in the --version message separately, I would forget. +PATCHSYNC_VERSION=2.2 + # usage: patchsync [--dry-run] [branch | patch] # # Patchsync is invoked on a "staging directory", which holds some configuration @@ -286,7 +288,7 @@ if ! [ $error ] && ! [ $dryrun ]; then "${COPYOUT[@]}" -i --link-dest="$(wdpp_from branch/)branch-new/" branch-new/ branch/ rm -rf branch-new } - ! [ -e patch-new ] || cmp -s patch-work patch || { + ! [ -e patch-new ] || cmp -s patch patch-new || { hash_file patch-new >patch-new-hash # Don't use rsync because we might have to write through a symlink. echo "> patch" @@ -307,7 +309,7 @@ else "${COPYOUT[@]}" -n -i --link-dest="$(wdpp_from branch/)branch-new/" branch-new/ branch/ #rm -rf branch-new } - ! [ -e patch-new ] || cmp -s patch-work patch || { + ! [ -e patch-new ] || cmp -s patch patch-new || { hash_file patch-new >patch-new-hash # Don't use rsync because we might have to write through a symlink. echo "> patch" @@ -423,7 +425,7 @@ END function patchsync_help { cat < [branch | patch] patchsync --new Please read the top of the script for complete documentation.