[Junichi Uekawa]
> Have you actually tested this?
> You may realize that patch command does not preserve timestamps,
> and there will always be a diff.

Bah - I did not notice this.  I thought about the timestamp issue, but
I thought it would only affect the file(s) I actually edited.  Of
course you are correct, it affects all +++ lines.

So, one fix is to use patch -T in dpatch.lib.shpp.  This works, but
not if two developers live in different timezones.

But my preference is to strip out timestamps entirely.  'patch' does
not require them, and they don't seem very interesting to me.  dpatch
users have gotten by without useful timestamps until now.

Two other minor things: first, there's no need for source and
destination files to be named differently - my ~ suffix on the source
dir is not needed.  Second, I've switched from ":" to "|" as a sed
pattern delimiter - people don't generally use either character in
filenames, but ":" may be slightly more common.

So, here's what I'm currently using.  It strips out timestamps and
does not insert that ~ character.

Thanks for looking at this,
Peter
--- dpatch-edit-patch
+++ dpatch-edit-patch
@@ -285,7 +285,11 @@
 DIFFHOLDER="$(tempfile -d "$WORKDIR" -p "dpep." -s ".diff")"
 dpep_message debug1 "Diff temporary file is $DIFFHOLDER"
 cd "$REFDIR"
-diff -urNad $DPEP_DIFF_EXCLUDE . "$WORKDIR/$(basename "$DPEP_SOURCEDIR")" > 
"$DIFFHOLDER" || true
+diff -urNad $DPEP_DIFF_EXCLUDE . "$WORKDIR/$(basename "$DPEP_SOURCEDIR")" |
+  sed -e "/^--- \|^diff /s| \./| $(basename "$DPEP_SOURCEDIR")/|" \
+      -e "/^+++ \|^diff /s| $WORKDIR/| |" \
+      -e "/^--- \|^+++ /s|\t.*||" \
+      -e "/^diff /s| $DPEP_DIFF_EXCLUDE||" > "$DIFFHOLDER" || true
 
 # Diff created, let's switch back to the original directory, and start the
 # process of updating or creating the patch.

Attachment: signature.asc
Description: Digital signature

Reply via email to