Hi, I noticed the diff wasn't showing the "-" at the start of a deleted file and the details of the second file when attributes are different. This change should fix them. thanks.
Gabriele Cerami
2014-Dec-15 18:19 UTC
[Libguestfs] [PATCH] diff/diff.c: diff output to show correct file handles and presence symbol
---
diff/diff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/diff/diff.c b/diff/diff.c
index 8b0fda0..6a374af 100644
--- a/diff/diff.c
+++ b/diff/diff.c
@@ -608,7 +608,7 @@ static void
deleted (guestfs_h *g, struct file *file)
{
output_start_line ();
- output_string ("+");
+ output_string ("-");
output_file (g, file);
output_end_line ();
}
@@ -669,7 +669,7 @@ changed (guestfs_h *g1, struct file *file1,
output_end_line ();
output_start_line ();
output_string ("+");
- output_file (g1, file1);
+ output_file (g2, file2);
output_end_line ();
/* Display stats fields that changed. */
--
1.9.3
Richard W.M. Jones
2014-Dec-15 18:44 UTC
Re: [Libguestfs] [PATCH] diff/diff.c: diff output to show correct file handles and presence symbol
On Mon, Dec 15, 2014 at 07:19:39PM +0100, Gabriele Cerami wrote:> --- > diff/diff.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/diff/diff.c b/diff/diff.c > index 8b0fda0..6a374af 100644 > --- a/diff/diff.c > +++ b/diff/diff.c > @@ -608,7 +608,7 @@ static void > deleted (guestfs_h *g, struct file *file) > { > output_start_line (); > - output_string ("+"); > + output_string ("-"); > output_file (g, file); > output_end_line (); > } > @@ -669,7 +669,7 @@ changed (guestfs_h *g1, struct file *file1, > output_end_line (); > output_start_line (); > output_string ("+"); > - output_file (g1, file1); > + output_file (g2, file2); > output_end_line (); > > /* Display stats fields that changed. */ > -- > 1.9.3Embarrassing ... Thanks, I've applied this and will push it very soon. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v