patchsync

Matt McCutchen hashproduct+rsync at gmail.com
Sat Dec 16 03:22:18 GMT 2006


On 12/14/06, Wayne Davison <wayned at samba.org> wrote:
> I have one wish-list item:  when someone makes changes to a branched
> version, I'd like to have a way to see the changes as a diff relative to
> the branched version, rather than as a diff of the changes to the diff
> in the patches dir.  This way the changes that were made are more
> evident, and they aren't mixed in with other meta changes, such as
> line-number changes for the hunks.

This feature is independent of patchsync's main purpose, so I'm not
sure whether it should be included in patchsync or be a separate
command.  If you pass the script below the original diff in the
patches dir and the metadiff you received, it prints the diff of the
branch.  It uses interdiff(1) from patchutils (
http://cyberelk.net/tim/patchutils/ ), which is probably cheaper than
creating a full copy of the new branch and diffing the branches.

#!/bin/bash
# unmetapatch <A:B> <(A:B):(A:C)> ==> <B:C> on stdout
ACtmp="$(mktemp /tmp/unmetapatch-$$-XXXXXX)"
patch "$1" "$2" -o "$ACtmp"
interdiff "$1" "$ACtmp"
rm -f "$ACtmp"

I have another wish-list item: when patchsync updates a patch, it
should carry over the documentation/command section before the first
"--- old/foo" so I don't have to keep reverting the deletion of this
section.  Actually, I think I can implement the carrying over in my
rsync patchsync-settings file without changing patchsync itself.  I
will post the improved patchsync-settings soon.

Matt


More information about the rsync mailing list