Re: diff
On Tue, Dec 14, 2021 at 5:45 PM Mark E. Fuller wrote: > > > It's such a small thing, but I really enjoyed being privy to this > question and discussion today. > > On 14/12/2021 17:21, Daniel Shahaf wrote: > > אורי wrote on Tue, 14 Dec 2021 07:44 +00:00: > >> Actually I prefer the "<(..)" method, because sometimes I want to compare 2 > >> commands: > >> > >> diff <(pip freeze | sort) <(cat requirements.txt | sort) > >> > > > > Consider s/diff/comm -12/. > > > >> Or even use cat and echo to add a specific line to one of the outputs. If I > >> want the result to be completely null. For example to run in crontab and > >> send me mail whether it's not null. > > > > Careful here. By default, cron jobs run not under your login shell but > > under /bin/sh, and it's possible the latter doesn't support «<(…)» even > > if the former does. > > Out of curiosity I asked the internet: > https://unix.stackexchange.com/questions/159513/what-are-the-shells-control-and-redirection-operators > > Looks like < as a redirect is POSIX-compliant, but as soon as it's > <(...) it's not a redirect anymore but instead a process substitution > which is implemented in BASH, ZSH, etc.: > https://www.gnu.org/software/bash/manual/bash.html#Process-Substitution > https://zsh.sourceforge.io/Intro/intro_7.html > > Nice to learn a new trick - I probably would have just redirected to a > temp file instead of the compact solution discussed today. If we are heading in this direction, may I remind of another, likely POSIX-compliant (didn't check), more "traditional" way, that still does not require (much) I/O, at least on any reasonably-modern *nix (perhaps e.g. not including cygwin etc. - again, didn't check): $ mkfifo pipe1 $ mkfifo pipe2 $ command1 > pipe1 & $ command2 > pipe2 & - These are now blocked, waiting in the background until someone reads from the pipes $ diff pipe1 pipe2 - After 'diff' finishes reading, command1 and command2 will finish too. - On a job-controlling shell, you'll get some messages about this. $ rm pipe1 pipe2 Best regards, -- Didi ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
comm -3 works here. אורי u...@speedy.net On Tue, Dec 14, 2021 at 6:45 PM Daniel Shahaf wrote: > אורי wrote on Tue, 14 Dec 2021 15:32 +00:00: > > אורי > > u...@speedy.net > > > > > > On Tue, Dec 14, 2021 at 5:22 PM Daniel Shahaf > > wrote: > > > >> אורי wrote on Tue, 14 Dec 2021 07:44 +00:00: > >> > Actually I prefer the "<(..)" method, because sometimes I want to > >> compare 2 > >> > commands: > >> > > >> > diff <(pip freeze | sort) <(cat requirements.txt | sort) > >> > > >> > >> Consider s/diff/comm -12/. > >> > > > > ??? > > s/foo/bar/ means "change foo to bar". In this case, I was referring you > to comm(1). Your use-case there is right up comm(1)'s alley. > > «-12» is an argument to to comm(1). > > ___ > Linux-il mailing list > Linux-il@cs.huji.ac.il > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il > ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
אורי wrote on Tue, 14 Dec 2021 15:32 +00:00: > אורי > u...@speedy.net > > > On Tue, Dec 14, 2021 at 5:22 PM Daniel Shahaf > wrote: > >> אורי wrote on Tue, 14 Dec 2021 07:44 +00:00: >> > Actually I prefer the "<(..)" method, because sometimes I want to >> compare 2 >> > commands: >> > >> > diff <(pip freeze | sort) <(cat requirements.txt | sort) >> > >> >> Consider s/diff/comm -12/. >> > > ??? s/foo/bar/ means "change foo to bar". In this case, I was referring you to comm(1). Your use-case there is right up comm(1)'s alley. «-12» is an argument to to comm(1). ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
It's such a small thing, but I really enjoyed being privy to this question and discussion today. On 14/12/2021 17:21, Daniel Shahaf wrote: אורי wrote on Tue, 14 Dec 2021 07:44 +00:00: Actually I prefer the "<(..)" method, because sometimes I want to compare 2 commands: diff <(pip freeze | sort) <(cat requirements.txt | sort) Consider s/diff/comm -12/. Or even use cat and echo to add a specific line to one of the outputs. If I want the result to be completely null. For example to run in crontab and send me mail whether it's not null. Careful here. By default, cron jobs run not under your login shell but under /bin/sh, and it's possible the latter doesn't support «<(…)» even if the former does. Out of curiosity I asked the internet: https://unix.stackexchange.com/questions/159513/what-are-the-shells-control-and-redirection-operators Looks like < as a redirect is POSIX-compliant, but as soon as it's <(...) it's not a redirect anymore but instead a process substitution which is implemented in BASH, ZSH, etc.: https://www.gnu.org/software/bash/manual/bash.html#Process-Substitution https://zsh.sourceforge.io/Intro/intro_7.html Nice to learn a new trick - I probably would have just redirected to a temp file instead of the compact solution discussed today. Cheers, Daniel אורי u...@speedy.net On Tue, Dec 14, 2021 at 9:31 AM Eli Marmor wrote: Use "-" instead the file name of one of both of the files, and pipe your output to the diff command. On Tue, 14 Dec 2021 at 09:12, אורי wrote: Thank you. אורי u...@speedy.net ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il Mark E. Fuller, Ph.D. HaShikma 19, Apt. 24 Nesher 3681219, Israel +972 (0)53-872-6579 +49 (0)1577 1848188 +1 401-214-4266 mark.e.ful...@gmail.com mark.e.ful...@gmx.de ful...@stossrohr.net @fuller:one.ems.host https://www.stossrohr.net PGP Fingerprint: 73F1 A30C BDF4 DB4B C75F FD0F D599 E76C FFCA BF60 ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
אורי u...@speedy.net On Tue, Dec 14, 2021 at 5:22 PM Daniel Shahaf wrote: > אורי wrote on Tue, 14 Dec 2021 07:44 +00:00: > > Actually I prefer the "<(..)" method, because sometimes I want to > compare 2 > > commands: > > > > diff <(pip freeze | sort) <(cat requirements.txt | sort) > > > > Consider s/diff/comm -12/. > ??? > > > Or even use cat and echo to add a specific line to one of the outputs. > If I > > want the result to be completely null. For example to run in crontab and > > send me mail whether it's not null. > > Careful here. By default, cron jobs run not under your login shell but > under /bin/sh, and it's possible the latter doesn't support «<(…)» even > if the former does. > Yes, I changed crontabs to bash today. אורי ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
אורי wrote on Tue, 14 Dec 2021 07:44 +00:00: > Actually I prefer the "<(..)" method, because sometimes I want to compare 2 > commands: > > diff <(pip freeze | sort) <(cat requirements.txt | sort) > Consider s/diff/comm -12/. > Or even use cat and echo to add a specific line to one of the outputs. If I > want the result to be completely null. For example to run in crontab and > send me mail whether it's not null. Careful here. By default, cron jobs run not under your login shell but under /bin/sh, and it's possible the latter doesn't support «<(…)» even if the former does. Cheers, Daniel > אורי > u...@speedy.net > > > On Tue, Dec 14, 2021 at 9:31 AM Eli Marmor wrote: > >> Use "-" instead the file name of one of both of the files, and pipe your >> output to the diff command. >> >> On Tue, 14 Dec 2021 at 09:12, אורי wrote: >> >>> Thank you. >>> >>> אורי >>> u...@speedy.net >>> ___ >>> Linux-il mailing list >>> Linux-il@cs.huji.ac.il >>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il >>> >> > > ___ > Linux-il mailing list > Linux-il@cs.huji.ac.il > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
diff <(pip freeze) requirements.txt Le mar. 14 déc. 2021 à 09:32, Eli Marmor a écrit : > Use "-" instead the file name of one of both of the files, and pipe your > output to the diff command. > > On Tue, 14 Dec 2021 at 09:12, אורי wrote: > >> Thank you. >> >> אורי >> u...@speedy.net >> ___ >> Linux-il mailing list >> Linux-il@cs.huji.ac.il >> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il >> > ___ > Linux-il mailing list > Linux-il@cs.huji.ac.il > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il > ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
Hi, Actually I prefer the "<(..)" method, because sometimes I want to compare 2 commands: diff <(pip freeze | sort) <(cat requirements.txt | sort) Or even use cat and echo to add a specific line to one of the outputs. If I want the result to be completely null. For example to run in crontab and send me mail whether it's not null. אורי u...@speedy.net On Tue, Dec 14, 2021 at 9:31 AM Eli Marmor wrote: > Use "-" instead the file name of one of both of the files, and pipe your > output to the diff command. > > On Tue, 14 Dec 2021 at 09:12, אורי wrote: > >> Thank you. >> >> אורי >> u...@speedy.net >> ___ >> Linux-il mailing list >> Linux-il@cs.huji.ac.il >> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il >> > ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
Use "-" instead the file name of one of both of the files, and pipe your output to the diff command. On Tue, 14 Dec 2021 at 09:12, אורי wrote: > Thank you. > > אורי > u...@speedy.net > ___ > Linux-il mailing list > Linux-il@cs.huji.ac.il > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il > ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff
Thank you. אורי u...@speedy.net ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
diff
Hi, I want to run diff on the output of a command (pip freeze), and compare it to a file, but without saving the command output to a file. How do I do it? I tried "diff $(pip freeze) requirements.txt" but it doesn't work. Thanks, אורי u...@speedy.net ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
On Thu, Jul 10, 2014 at 4:50 PM, Amos Shapira amos.shap...@gmail.com wrote: How about rsync's --only-write-batch/--read-batch? great this is the closest as it gets to what i wanted only caveat, is that if the system is modified, it will not merge like 'patch' does however, i can live with this thanks, erez. On 10 July 2014 18:55, Erez D erez0...@gmail.com wrote: to make it clear: i need to compare two directory trees - old and new, both holds files, binaries, special files, symbolic and hard links. and create a patch file than, on another system which has a copy of the old dir tree (and possible some modifications), i need to patch it to make it a 'new' what i would like to have is somthing like rsync, which can create a diff file ... On Thu, Jul 10, 2014 at 10:39 AM, Rabin Yasharzadehe ra...@rabin.io wrote: I was just about to write the same suggesting, on my current Android ROM (OmniROM) i have update system called OpenDelta which use xdelta to create the the update images. you can look at the code in github - https://github.com/omnirom/android_packages_apps_OpenDelta -- Rabin On Thu, Jul 10, 2014 at 10:34 AM, shimi linux...@shimi.net wrote: On Thu, Jul 10, 2014 at 9:08 AM, Erez D erez0...@gmail.com wrote: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? If modifying an _image_ is your purpose, and you want to avoid distributing the whole image, and you can do that 'offline' (i.e. you have two partitions, one active, second for upgrade and boot from - so you don't touch a system with a mounted filesystem), and you have your way to manage this versioning (i.e. you know for a fact what the previous image blob is, so what you need is really the blocks that changed from it) - maybe take a look at http://xdelta.org/ -- Shimi ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il -- [image: View my profile on LinkedIn] http://www.linkedin.com/in/gliderflyer ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
diff/patch rootfs
hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? btw: distro is emdebian/debian on armel thanks, erez. ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
Erez D erez0...@gmail.com writes: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? btw: distro is emdebian/debian on armel Proper (IMHO) solution - package your updates (in .deb in your case, I presume). This includes modifying existing packages if you need to roll your own stuff - to avoid clashes. Barring that, rsync is the first thing that comes to my mind. I assume I don't need to remind you to be very, very careful, especially with --delete. ;-) I suppose if you screw up an update you can still reinstall as today, right? Possible enhancements (going on a tangent here): I don't know your circumstances, nor am I familiar with emdebian, but personally I'd prefer to get as much as possible packaged from the distro and not touch rootfs by hand, and keep my own stuff on a separate partition (that I can clobber, e.g., with rsync, even multiple times if things go wrong). I realize this may not be an option, so back to rootfs. Have you considered having 2 partitions side-by-side and swapping old for new (that you have, e.g., rsync'ed, etc.) with the possibility of rolling back? Once new is running you can update old, too, if it is needed to prepare for the next upgrade. The second partition will cost you some space, of course... -- Oleg Goldshmidt | p...@goldshmidt.org ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
Simple solution: 1. diff -N, --new-file treat absent files as empty Comprehensive solution: 2. create git repository on rootfs and work with git init, commit, diff, git-format-patch, am On Thu, Jul 10, 2014 at 9:08 AM, Erez D erez0...@gmail.com wrote: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? btw: distro is emdebian/debian on armel thanks, erez. ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il -- Constantine Shulyupin http://www.MakeLinux.co.il/ Embedded Linux Systems Tel Aviv ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
On Thu, Jul 10, 2014 at 9:54 AM, Oleg Goldshmidt p...@goldshmidt.org wrote: Erez D erez0...@gmail.com writes: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? btw: distro is emdebian/debian on armel Proper (IMHO) solution - package your updates (in .deb in your case, I presume). This includes modifying existing packages if you need to roll your own stuff - to avoid clashes. interesting idea, altough seems trivial, it never came into mind however: 1. will take a lot of work (note that i overwrite some of debian's file with my own, and will need to resove this) 2. will be a big patch (and i pay by the byte, have low flash/ram. and must be done offline) currently i need something simpler, which will be small, offline Barring that, rsync is the first thing that comes to my mind. that was my first idea, however it need to be done offline. searched to see if rsync creates diffs, and never found any info about this ... I assume I don't need to remind you to be very, very careful, especially with --delete. ;-) sure I suppose if you screw up an update you can still reinstall as today, right? yes, if i have access to the product (which is not always true) Possible enhancements (going on a tangent here): I don't know your circumstances, nor am I familiar with emdebian, but personally I'd prefer to get as much as possible packaged from the distro and not touch rootfs by hand, and keep my own stuff on a separate partition (that I can clobber, e.g., with rsync, even multiple times if things go wrong). no problems with emdebian I realize this may not be an option, so back to rootfs. Have you considered having 2 partitions side-by-side and swapping old for new (that you have, e.g., rsync'ed, etc.) with the possibility of rolling back? Once new is running you can update old, too, if it is needed to prepare for the next upgrade. The second partition will cost you some space, of course... think of a software patch to a filesystem, like (god forbid ;-) windows-update ;-) -- Oleg Goldshmidt | p...@goldshmidt.org ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
On Thu, Jul 10, 2014 at 9:08 AM, Erez D erez0...@gmail.com wrote: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? If modifying an _image_ is your purpose, and you want to avoid distributing the whole image, and you can do that 'offline' (i.e. you have two partitions, one active, second for upgrade and boot from - so you don't touch a system with a mounted filesystem), and you have your way to manage this versioning (i.e. you know for a fact what the previous image blob is, so what you need is really the blocks that changed from it) - maybe take a look at http://xdelta.org/ -- Shimi ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
I was just about to write the same suggesting, on my current Android ROM (OmniROM) i have update system called OpenDelta which use xdelta to create the the update images. you can look at the code in github - https://github.com/omnirom/android_packages_apps_OpenDelta *--Rabin* On Thu, Jul 10, 2014 at 10:34 AM, shimi linux...@shimi.net wrote: On Thu, Jul 10, 2014 at 9:08 AM, Erez D erez0...@gmail.com wrote: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? If modifying an _image_ is your purpose, and you want to avoid distributing the whole image, and you can do that 'offline' (i.e. you have two partitions, one active, second for upgrade and boot from - so you don't touch a system with a mounted filesystem), and you have your way to manage this versioning (i.e. you know for a fact what the previous image blob is, so what you need is really the blocks that changed from it) - maybe take a look at http://xdelta.org/ -- Shimi ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: diff/patch rootfs
to make it clear: i need to compare two directory trees - old and new, both holds files, binaries, special files, symbolic and hard links. and create a patch file than, on another system which has a copy of the old dir tree (and possible some modifications), i need to patch it to make it a 'new' what i would like to have is somthing like rsync, which can create a diff file ... On Thu, Jul 10, 2014 at 10:39 AM, Rabin Yasharzadehe ra...@rabin.io wrote: I was just about to write the same suggesting, on my current Android ROM (OmniROM) i have update system called OpenDelta which use xdelta to create the the update images. you can look at the code in github - https://github.com/omnirom/android_packages_apps_OpenDelta -- Rabin On Thu, Jul 10, 2014 at 10:34 AM, shimi linux...@shimi.net wrote: On Thu, Jul 10, 2014 at 9:08 AM, Erez D erez0...@gmail.com wrote: hello i am dealing with rootfs images i install on embedded linux from time to time i update the rootfs - add some file, remove other, update others, mknod etc ... currently, when i do this, i need to reinstall the image i am looking to create a patch, i can patch an old rootfs to update it however, diff does not handle create file, remove file, special files and binary files very well i am looking for a tool that can do that. anyone ? If modifying an _image_ is your purpose, and you want to avoid distributing the whole image, and you can do that 'offline' (i.e. you have two partitions, one active, second for upgrade and boot from - so you don't touch a system with a mounted filesystem), and you have your way to manage this versioning (i.e. you know for a fact what the previous image blob is, so what you need is really the blocks that changed from it) - maybe take a look at http://xdelta.org/ -- Shimi ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Re: binary diff
On Thu, Apr 3, 2008 at 11:03 AM, Alon Altman [EMAIL PROTECTED] wrote: what about cmp? thanks, i didn't know about 'cmp'. however, it's output is cryptic to me. i can not understand what the diff is On Thu, Apr 3, 2008 at 12:45 AM, Erez D [EMAIL PROTECTED] wrote: hi i am looking for something like 'diff' which can compare binary files and give a result other then just 'differ' or 'same' the same as what diff does for text files. i though of using xxd with a regular diff, but that doesn't help, as if there is one byte missing, all lines are shifted which means they are different textually, when they are not really. thanks, erez.
binary diff
hi i am looking for something like 'diff' which can compare binary files and give a result other then just 'differ' or 'same' the same as what diff does for text files. i though of using xxd with a regular diff, but that doesn't help, as if there is one byte missing, all lines are shifted which means they are different textually, when they are not really. thanks, erez.
Re: binary diff
There are a few of them, take a look for example at xdelta and bsdiff Ely On Thu, Apr 3, 2008 at 10:45 AM, Erez D [EMAIL PROTECTED] wrote: hi i am looking for something like 'diff' which can compare binary files and give a result other then just 'differ' or 'same' the same as what diff does for text files. i though of using xxd with a regular diff, but that doesn't help, as if there is one byte missing, all lines are shifted which means they are different textually, when they are not really. thanks, erez. = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: binary diff
Erez - Perhaps you could first convert the binary files to text representation (od --address-radix none) and then preform the comparison in that dimension? Yaacov Erez D wrote: hi i am looking for something like 'diff' which can compare binary files and give a result other then just 'differ' or 'same' the same as what diff does for text files. i though of using xxd with a regular diff, but that doesn't help, as if there is one byte missing, all lines are shifted which means they are different textually, when they are not really. thanks, erez. = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: binary diff
xxd's function is exactly to convert from binary into text. Try to convert your binary files using: xxd -p -c1 (works for me: xxd -v output is xxd V1.10 27oct98 by Juergen Weigert). I checked also how to do it using od. The following would work (my od --version is 5.97): od -v -w1 -ta --address-radix none or: od -v -w1 -tx1 --address-radix none --- Omer On Thu, 2008-04-03 at 11:37 +0300, Yaacov Fenster - System Engineering Troubleshooting and other stuff wrote: Erez - Perhaps you could first convert the binary files to text representation (od --address-radix none) and then preform the comparison in that dimension? Yaacov Erez D wrote: hi i am looking for something like 'diff' which can compare binary files and give a result other then just 'differ' or 'same' the same as what diff does for text files. i though of using xxd with a regular diff, but that doesn't help, as if there is one byte missing, all lines are shifted which means they are different textually, when they are not really. -- One does not make peace with enemies. One makes peace with former enemies. My own blog is at http://www.zak.co.il/tddpirate/ My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: binary diff
On Thu, Apr 3, 2008 at 3:25 PM, Omer Zak [EMAIL PROTECTED] wrote: xxd's function is exactly to convert from binary into text. Try to convert your binary files using: xxd -p -c1 (works for me: xxd -v output is xxd V1.10 27oct98 by Juergen Weigert). I checked also how to do it using od. The following would work (my od --version is 5.97): od -v -w1 -ta --address-radix none or: od -v -w1 -tx1 --address-radix none --- Omer As i replied to someone before, it works for small files. for big files it takes ages to diff using jdiff (jojo's diff) takes very short time, but it gives information of the diff sizes and not about the actual data On Thu, 2008-04-03 at 11:37 +0300, Yaacov Fenster - System Engineering Troubleshooting and other stuff wrote: Erez - Perhaps you could first convert the binary files to text representation (od --address-radix none) and then preform the comparison in that dimension? Yaacov Erez D wrote: hi i am looking for something like 'diff' which can compare binary files and give a result other then just 'differ' or 'same' the same as what diff does for text files. i though of using xxd with a regular diff, but that doesn't help, as if there is one byte missing, all lines are shifted which means they are different textually, when they are not really. -- One does not make peace with enemies. One makes peace with former enemies. My own blog is at http://www.zak.co.il/tddpirate/ My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: binary diff
On Thursday 03 April 2008, Ely Levy wrote: There are a few of them, take a look for example at xdelta and bsdiff It really depends on what files you are planning to use the diff on. The more you know about the files, the better tool you can choose. I've had good experience with xdelta. IIRC, it works very similar to the way rsync transfers files, with an advantage to xdelta, since it works locally. Also, xdelta is available both for Windows and Linux, if that matters to you. --yuval signature.asc Description: This is a digitally signed message part.
Re: Visual diff tool for patches.
[EMAIL PROTECTED]:~/tmp$ echo test 123 1.txt [EMAIL PROTECTED]:~/tmp$ cp -la 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ echo test 321 1.txt [EMAIL PROTECTED]:~/tmp$ diff 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ [EMAIL PROTECTED]:~/tmp$ echo test 123 1.txt [EMAIL PROTECTED]:~/tmp$ cp -la 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ echo test 1234 2.txt [EMAIL PROTECTED]:~/tmp$ diff 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ I don't think this will work ;-) ביום שלישי 06 מרץ 2007, 09:28, נכתב על ידי Vassilii Khachaturov: Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Very true. It's also a good idea to do the copy with the cp -la option so that the files are not copied, but linked instead, so the only thing you waste the disk for is the inodes and the files that actually differ. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Wed, Mar 07, 2007 at 03:57:10PM +0200, Diego Iastrubni wrote: [EMAIL PROTECTED]:~/tmp$ echo test 123 1.txt [EMAIL PROTECTED]:~/tmp$ cp -la 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ echo test 321 1.txt [EMAIL PROTECTED]:~/tmp$ diff 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ [EMAIL PROTECTED]:~/tmp$ echo test 123 1.txt [EMAIL PROTECTED]:~/tmp$ cp -la 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ echo test 1234 2.txt [EMAIL PROTECTED]:~/tmp$ diff 1.txt 2.txt [EMAIL PROTECTED]:~/tmp$ I don't think this will work ;-) It will, actually. patch moves (or unlinks?) the new file before writing it. [EMAIL PROTECTED] ~/t 543 % mkdir old new [EMAIL PROTECTED] ~/t 544 % echo test123 old/file1 [EMAIL PROTECTED] ~/t 545 % echo test321 new/file1 [EMAIL PROTECTED] ~/t 546 % diff -ur old new diff1 [EMAIL PROTECTED] ~/t 547 % rm -rf new [EMAIL PROTECTED] ~/t 555 % cp -la old new [EMAIL PROTECTED] ~/t 556 % patch -d new diff1 patching file file1 [EMAIL PROTECTED] ~/t 557 % diff -ur old new diff -ur old/file1 new/file1 --- old/file1 2007-03-07 16:32:06.0 +0200 +++ new/file1 2007-03-07 16:33:46.0 +0200 @@ -1 +1 @@ -test123 +test321 -- Didi = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Tue, Mar 06, 2007 at 01:09:16AM +0200, guy keren wrote: look at the patch file - it has a very simple general format. i think you can grep for the file names in it, and with little parsing get the list of affected files. Use lsdiff(1) (from the patchutils package) Cheers, Muli = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Tuesday 06 March 2007 01:09, guy keren wrote: look at the patch file - it has a very simple general format. i think you can grep for the file names in it, and with little parsing get the list of affected files. Well, i was curious as to why there is no (famous) script to do such a simple thing conveniently, therefore, i have written a script to do this. The script(python), displays (gtk) the list of files to change from the patch file with an adjacent action (new file/delete file/lanuch a diff program - currently meld) and you can double click to perform the action. No need to copy anything, this is done in /tmp and in memory automagically. Here is an example of a call to the script: cat ../new/patch| python ../easierpatch.py - ./ -p1 Here is the link to the script (GPL) on my homepage: http://tzahi.webhop.info/easierpatch.py Enjoy. -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Visual diff tool for patches.
Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
Meld : Diff and merge tool http://meld.sourceforge.net/ On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] -- Alexander Indenbaum = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Monday 05 March 2007 14:06, Alexander Indenbaum wrote: Meld : Diff and merge tool http://meld.sourceforge.net/ As i wrote below, meld does not seem to support patch files. If you know otherwise, please tell me how to do it. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. Hope it helps. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: On Monday 05 March 2007 14:06, Alexander Indenbaum wrote: Meld : Diff and merge tool http://meld.sourceforge.net/ As i wrote below, meld does not seem to support patch files. If you know otherwise, please tell me how to do it. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html -- Alexander Indenbaum = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Monday 05 March 2007 14:33, Alexander Indenbaum wrote: Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. Hope it helps. That is a good idea and i am going to use it, however, it is very tiring to do so for each patch i receive. There got to be a better way, even from the console but interactive so i can approve or disapprove of a certain part. I mean, how do kernel developers work with this. You cannot cut/paste all the time with many many patches instead of clicking like in kdiff and friends. There got to be a better arrangement. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: On Monday 05 March 2007 14:06, Alexander Indenbaum wrote: Meld : Diff and merge tool http://meld.sourceforge.net/ As i wrote below, meld does not seem to support patch files. If you know otherwise, please tell me how to do it. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Mon, 5 Mar 2007, Tzahi Fadida wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? I've been using meld and really enjoying its features. Michael = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Mon, 5 Mar 2007, Tzahi Fadida wrote: Date: Mon, 5 Mar 2007 16:03:49 +0200 From: Tzahi Fadida [EMAIL PROTECTED] To: Alexander Indenbaum [EMAIL PROTECTED] Cc: Israel Linux Mailing list linux-il@linux.org.il Subject: Re: Visual diff tool for patches. On Monday 05 March 2007 14:33, Alexander Indenbaum wrote: Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. Hope it helps. That is a good idea and i am going to use it, however, it is very tiring to do so for each patch i receive. There got to be a better way, even from the console but interactive so i can approve or disapprove of a certain part. I mean, how do kernel developers work with this. You cannot cut/paste all the time with manymany patches instead of clicking like in kdiff and friends. There got to be a better arrangement. who said anything about copy and paste? all you do is: cp -rp original/ modified apply patch to modified. run the diff tool (meld, tkdiff, whatever) between original and modified. you can write a short script to automate these operations (except the usage of the diff tool, ofcourse). look at this: http://xxdiff.sourceforge.net/local/doc/xxdiff-patch-UNFINISHED.html --guy On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: On Monday 05 March 2007 14:06, Alexander Indenbaum wrote: Meld : Diff and merge tool http://meld.sourceforge.net/ As i wrote below, meld does not seem to support patch files. If you know otherwise, please tell me how to do it. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | [EMAIL PROTECTED] -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] -- guy For world domination - press 1, or dial 0, and please hold, for the creator. -- nob o. dy = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Monday 05 March 2007 19:40, guy keren wrote: On Mon, 5 Mar 2007, Tzahi Fadida wrote: Date: Mon, 5 Mar 2007 16:03:49 +0200 From: Tzahi Fadida [EMAIL PROTECTED] To: Alexander Indenbaum [EMAIL PROTECTED] Cc: Israel Linux Mailing list linux-il@linux.org.il Subject: Re: Visual diff tool for patches. On Monday 05 March 2007 14:33, Alexander Indenbaum wrote: Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. Hope it helps. That is a good idea and i am going to use it, however, it is very tiring to do so for each patch i receive. There got to be a better way, even from the console but interactive so i can approve or disapprove of a certain part. I mean, how do kernel developers work with this. You cannot cut/paste all the time with manymany patches instead of clicking like in kdiff and friends. There got to be a better arrangement. who said anything about copy and paste? all you do is: cp -rp original/ modified apply patch to modified. run the diff tool (meld, tkdiff, whatever) between original and modified. That is a good idea, however, i only wish to automate this for the patched files (since i don't want to copy 20mb of files just for the few patched files). How can i only copy the files to be patched, let's say to /tmp and then run the patch on them. you can write a short script to automate these operations (except the usage of the diff tool, ofcourse). look at this: http://xxdiff.sourceforge.net/local/doc/xxdiff-patch-UNFINISHED.html Looks interesting, buggy though. If i won't find anything working, perhaps i will try to change this to use kdiff3 or meld. --guy On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: On Monday 05 March 2007 14:06, Alexander Indenbaum wrote: Meld : Diff and merge tool http://meld.sourceforge.net/ As i wrote below, meld does not seem to support patch files. If you know otherwise, please tell me how to do it. On 3/5/07, Tzahi Fadida [EMAIL PROTECTED] wrote: Hi, I was given a patch (that refers to several files in a directory) and i wish to review and merge the changes one at a time visually. I tried xfdiff which allows me to review the changes but it have a bug when i am trying to apply them one by one. I tried kcompare, but it tries to do something weird. It tries to revert the patch file to my original files into new files, which is weird enough, but also when i try to save it says it can't upload the file to destination folder etc.. In this instance i tried source:patch destination:folder. If i reverse the roles i get something weird: Error - the files are identical. kdiff3 and meld does not seem to support patch files at all. Can anyone suggest a proper tool? -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | [EMAIL PROTECTED] -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
Tzahi Fadida wrote: On Monday 05 March 2007 19:40, guy keren wrote: On Mon, 5 Mar 2007, Tzahi Fadida wrote: Date: Mon, 5 Mar 2007 16:03:49 +0200 From: Tzahi Fadida [EMAIL PROTECTED] To: Alexander Indenbaum [EMAIL PROTECTED] Cc: Israel Linux Mailing list linux-il@linux.org.il Subject: Re: Visual diff tool for patches. On Monday 05 March 2007 14:33, Alexander Indenbaum wrote: Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. Hope it helps. That is a good idea and i am going to use it, however, it is very tiring to do so for each patch i receive. There got to be a better way, even from the console but interactive so i can approve or disapprove of a certain part. I mean, how do kernel developers work with this. You cannot cut/paste all the time with manymany patches instead of clicking like in kdiff and friends. There got to be a better arrangement. who said anything about copy and paste? all you do is: cp -rp original/ modified apply patch to modified. run the diff tool (meld, tkdiff, whatever) between original and modified. That is a good idea, however, i only wish to automate this for the patched files (since i don't want to copy 20mb of files just for the few patched files). How can i only copy the files to be patched, let's say to /tmp and then run the patch on them. look at the patch file - it has a very simple general format. i think you can grep for the file names in it, and with little parsing get the list of affected files. --guy = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
On Tuesday, 6 בMarch 2007 01:09, guy keren wrote: look at the patch file - it has a very simple general format. i think you can grep for the file names in it, and with little parsing get the list of affected files. lsdiff patch_file -- Oron Peled Voice/Fax: +972-4-8228492 [EMAIL PROTECTED] http://www.actcom.co.il/~oron ICQ UIN: 16527398 It's not the software that's free; it's you. - billyskank on Groklaw = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Visual diff tool for patches.
Did not see you mentioned meld specifically. Anyway I could sugest the following procedure. You could prepare two copies of the source tree: pristine and modified, where modified is pristine with patch applied. Very true. It's also a good idea to do the copy with the cp -la option so that the files are not copied, but linked instead, so the only thing you waste the disk for is the inodes and the files that actually differ. Then fire up meld (or any other merge tool) and just apply/move changes one by one from modified to pristine. = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
Gilad Ben-Yossef [EMAIL PROTECTED] writes: The problem is that I tried various combiniations and none worked: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id' -I '\$Header' -I '\$Date' -I '\$Source' -I '\$Auther' Try double quotes? Here is diffing a file from two different branches of CVS: $ diff -Nur {prototype,exceptions}/src/clone.cc | grep \$Id - $Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $; + $Id: clone.cc,v 1.25.2.1 2006/07/10 08:16:40 olegg Exp $; $ diff -Nur -I\$Id {prototype,exceptions}/src/clone.cc | grep \$Id $ -- Oleg Goldshmidt | [EMAIL PROTECTED] | http://www.goldshmidt.org = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
Gilad Ben-Yossef [EMAIL PROTECTED] writes: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id' -I '\$Header' -I '\$Date' -I '\$Source' -I '\$Auther' I forgot to mention the obvious in my previous response: if you are comparing two versions under CVS control (which is not the case for you, I gather), then there are additional CVS-specific options to exclude keyword diffs: $ cvs diff -u -r1.27 clone.cc | grep \$Id - $Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $; + $Id: clone.cc,v 1.25.2.1 2006/07/10 08:16:40 olegg Exp $; $ cvs diff -u -r1.27 -kk clone.cc | grep \$Id $ See info cvs. -- Oleg Goldshmidt | [EMAIL PROTECTED] | http://www.goldshmidt.org = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
Oleg Goldshmidt wrote: Try double quotes? It makes no sense: $ echo '\$Id' \$Id $ echo \$Id $Id You really want the former, as $ has special meaning in a regexp, and therefor is supposed to need a backslash before it if used literally. I'm not saying you are not right, just that it's strange that this is the case. Shachar -- Shachar Shemesh Lingnu Open Source Consulting ltd. Have you backed up today's work? http://www.lingnu.com/backup.html = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
On Wed, 12 Jul 2006 10:57:35 Oleg Goldshmidt wrote: Gilad Ben-Yossef writes: The problem is that I tried various combiniations and none worked: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id' -I '\$Header' -I '\$Date' -I '\$Source' -I '\$Auther' Try double quotes? Here is diffing a file from two different branches of CVS: $ diff -Nur {prototype,exceptions}/src/clone.cc | grep \$Id - $Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $; + $Id: clone.cc,v 1.25.2.1 2006/07/10 08:16:40 olegg Exp $; $ diff -Nur -I\$Id {prototype,exceptions}/src/clone.cc | grep \$Id $ In bash you can use \$VAR or '$VAR' (i.e. you need not escape the $ when it is between apostrophes). There is even more exotic form: $'string' which does interpret the string by bash (NOT by the calling application). Run the following script to see the differences: #! /bin/bash -ex VAR=example 1 \\ \$ \' \ \134 \044 \047 \042 echo -E $VAR echo -E '$VAR' echo -E $'$VAR' echo -E '$''$VAR' eval echo -E '$''$VAR' eval UNESC1='$''$VAR'# unescaped var echo -E $UNESC1 | $UNESC2 echo -E $UNESC echo -E \$VAR echo -E '\$VAR' echo -E $'\$VAR' On Wed, 12 Jul 2006 11:23:02 Shachar Shemesh wrote: Try double quotes? It makes no sense: $ echo '\$Id' \$Id $ echo \$Id $Id You really want the former, as $ has special meaning in a regexp, and therefor is supposed to need a backslash before it if used literally. I'm not saying you are not right, just that it's strange that this is the case. Shachar, you wrong. Gilad wants the `diff' program to see $ID not \$ID which is what '\$ID' gives to the application (diff does not substitute $ID with its environment value, bash does it). Ehud. -- Ehud Karni Tel: +972-3-7966-561 /\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ GnuPG: 98EA398D http://www.keyserver.net/Better Safe Than Sorry = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
Ehud Karni wrote: Shachar, you wrong. Gilad wants the `diff' program to see $ID not \$ID which is what '\$ID' gives to the application (diff does not substitute $ID with its environment value, bash does it). Last time I checked, $ in regexp meant match end of line. '$Id' would mean, if I understand this correctly, an Id coming AFTER the end of the line (an impossible combination, I know, but still). If I want grep to understand a literal $, I need to pass it a \$, which I can do either by doing \\\$Id or '\$Id'. I stand by my original statement. Ehud. Shachar -- Shachar Shemesh Lingnu Open Source Consulting ltd. Have you backed up today's work? http://www.lingnu.com/backup.html = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
On Wed, 12 Jul 2006 12:11:40 +0300, Shachar Shemesh wrote: Ehud Karni wrote: Shachar, you wrong. Gilad wants the `diff' program to see $ID not \$ID which is what '\$ID' gives to the application (diff does not substitute $ID with its environment value, bash does it). Last time I checked, $ in regexp meant match end of line. '$Id' would mean, if I understand this correctly, an Id coming AFTER the end of the line (an impossible combination, I know, but still). If I want grep to understand a literal $, I need to pass it a \$, which I can do either by doing \\\$Id or '\$Id'. I stand by my original statement. You are right. I'll say it again: YOU ARE RIGHT ! I take my statement back. I think a better way to pass the $Id would be '[$]Id' then you don't have to mess up with who is eating the backslash (and how many of them). Ehud. -- Ehud Karni Tel: +972-3-7966-561 /\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ GnuPG: 98EA398D http://www.keyserver.net/Better Safe Than Sorry = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
On Wed, Jul 12, 2006 at 12:23:44PM +0300, Ehud Karni wrote: Last time I checked, $ in regexp meant match end of line. '$Id' would mean, if I understand this correctly, an Id coming AFTER the end of the line (an impossible combination, I know, but still). If I want grep to understand a literal $, I need to pass it a \$, which I can do either by doing \\\$Id or '\$Id'. I stand by my original statement. You are right. I'll say it again: YOU ARE RIGHT ! I take my statement back. Not quite. There are basic regular expressions and extended regular expressions. The $ means end of string only when used as an anchor. In basic regular expressions, the $ is an anchor only if used at the end of the regular expression. For extended regular expression, what Shachar said is essentially correct. Apparently, diff uses basic regular expressions. bash-3.00$ cat t1 $Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $; bash-3.00$ grep '$Id' t1 $Id: clone.cc,v 1.27 2006/07/10 08:30:21 olegg Exp $; bash-3.00$ grep -E '$Id' t1 bash-3.00$ = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
Adam Morrison wrote: Apparently, diff uses basic regular expressions. Indeed, that was also why my regexp did not work - I was trying to use extended regular expressions, whereas diff only support basic ones. Luckily, for GNU versions of grep/diff, the only difference between basic and extended regexps is that special characters of extended mode (namely {, } |, $, ^ etc) need to be prefixed with a back slash for their special meaning to be used. Yes, backwards from you normally would expect, a $ is just a dollarm but a \$ is a marker for end of line. In the end, this is the diff line used: # diff -pBbNaur -X dontdiff this_kernel/ that_kernel/ -I '$Id\|$Header\|$Date\|$Source\|$Author\|$Revision' Note that this did *not* weed out all uses of the CVS keywords, only those that happend in a block of chanes where all the changed lines matched the regexp, so $Log ... $ lines, for example, could not be catched using this technique. Luckily, after this diff line the number of files with those lines was small enough to allow manual trimming by using an exclude by file technique. Thanks very much to Ehud, Shachar, Oleg, Adam and everyone else! Gilad -- Gilad Ben-Yossef [EMAIL PROTECTED] Codefidence. A name you can trust(tm) Web: http://codefidence.com | SIP: [EMAIL PROTECTED] IL: +972.3.7515563 ext. 201 | Fax:+972.3.7515503 US: +1.212.2026643 ext. 201 | Cel: +972.52.8260388 Resistence was futile. -- Danny Getz, 2004. = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
diff regexps
Howdie, I am trying to diff a vanilla vs. a vendor supplied linux kernel source tree. Some dweeb at the vendor has put the Linux kernel into CVS, causing every line with $Id, $Revision, $Date, $Source etc. in the Linux kernel to mutate. I'm trying to generate a diff that doesn't include these random changes but does include the real changes that occurs between the two trees. Now, diff has an option, -I, via one can provide a regexp and blocks of changed lines that all contain the regexp will not get to the output. The problem is that I tried various combiniations and none worked: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id' -I '\$Header' -I '\$Date' -I '\$Source' -I '\$Auther' and also: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id|\$Header|\$Date|\$Source|\$Auther' but to no avail. Anyone care to help a poor regexp challanged bugger? Thanks, Gilad = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: diff regexps
Hello Gilad, You are doing a big jump here. Let's try to walk a small step at a time. 1. Start with diffing two files i.e. don't use the -X options or the -pBbNaur which requires several searches through man diff to verify. After the two-file compare works, try to add back those options. 2. Check the way you enter regular expressions by, for example, echo '\$Header' and egrepping your files with the same regular expression. (From my check, under bash and using egrep, '\$Header' is the correct way to match a line with the string '$Header' - so you got that part right.) 3. You wrote '\$Auther' - shouldn't it be '\$Author'? 4. If you did not solve the problem yourself by now, show the actual output from diff'ing two files with the unwanted blocks. Also specify exactly which you shell you used (I tested under bash 2.05b.0(1)-release). We'll know better where to look for the problem. --- Omer On Tue, 2006-07-11 at 21:09 +0300, Gilad Ben-Yossef wrote: Howdie, I am trying to diff a vanilla vs. a vendor supplied linux kernel source tree. Some dweeb at the vendor has put the Linux kernel into CVS, causing every line with $Id, $Revision, $Date, $Source etc. in the Linux kernel to mutate. I'm trying to generate a diff that doesn't include these random changes but does include the real changes that occurs between the two trees. Now, diff has an option, -I, via one can provide a regexp and blocks of changed lines that all contain the regexp will not get to the output. The problem is that I tried various combiniations and none worked: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id' -I '\$Header' -I '\$Date' -I '\$Source' -I '\$Auther' and also: diff -X ti_dontdiff -pBbNaur -X dontdiff this-kernel/ that-kernel/ -I '\$Id|\$Header|\$Date|\$Source|\$Auther' but to no avail. Anyone care to help a poor regexp challanged bugger? Thanks, Gilad = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Suggestions for diff(C++(1991),C++(2005)), anyone?
I am faced with the following situation. I learned C++ at the early 1990's, and Turbo C++ 2.0 (later versions were called Borland C++) was my learning and development platform. During the intervening years, I got along very well thank you with C++ without templates, exceptions, namespaces or new keywords. I did some reading of the STL but did not get around to using it. Now I am faced with the task of refreshing my knowledge of standard C++. I am very reluctant to dive into a 500 pages long C++ with explanations of virtual destructors and private friend functions just to familarize myself with the changes made to C++ standard header files handling. Can anyone suggest a Web site which covers exactly the changes from C++(circa 1991)[Turbo C++ 2.0] to C++(circa 2005)[gcc 3.3.5], which will help me get familiar with the changes by reading not more than say 20 pages? Thanks, --- Omer = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Suggestions for diff(C++(1991),C++(2005)), anyone?
some good books (also available on the internet) 1. C++ common knowladge. (explains the fine points of many points you discussed) 2. Essensial C++, more essensial C++, Essensial coding standards / Sutter explains lots of fine points. maybe to hard right now 3. Effective C++, more effective C++, effective STL / meyers also explains mainly the fine points easier and not as good as essensial c++. 4. C++ templates / Vendervourde , Josttis - best book ever written about templates. 5. Modern C++ programming / alexanderscu explains C++ with templates and design patterns. old but still good. there are more but those are the best i know to catch up with modern C++. --- Omer Zak [EMAIL PROTECTED] wrote: I am faced with the following situation. I learned C++ at the early 1990's, and Turbo C++ 2.0 (later versions were called Borland C++) was my learning and development platform. During the intervening years, I got along very well thank you with C++ without templates, exceptions, namespaces or new keywords. I did some reading of the STL but did not get around to using it. Now I am faced with the task of refreshing my knowledge of standard C++. I am very reluctant to dive into a 500 pages long C++ with explanations of virtual destructors and private friend functions just to familarize myself with the changes made to C++ standard header files handling. Can anyone suggest a Web site which covers exactly the changes from C++(circa 1991)[Turbo C++ 2.0] to C++(circa 2005)[gcc 3.3.5], which will help me get familiar with the changes by reading not more than say 20 pages? Thanks, --- Omer = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Line diff
Is there a utility that diff single line, something like : This is line 1, This is Line 2 ! will result with This is line 1 RR++ L2 ! Comments - 1. The syntax of the output is just something I invented right now. 2. Fixed fonts are needed to understand it. Splitting the line into separate characters (one in each line) may do the job when piping with diff, but I would like to improve tkdiff to highlight those changes, and not just the whole line. ~~ Mass movements can rise and spread without belief in a god, but never without belief in a devil. ~~ This e-mail message has been sent by Elbit Systems Ltd. and is for the use of the intended recipients only. The message may contain information that is privileged or confidential. If you are not the intended recipient you are hereby notified that any use, distribution or copying of this communication is strictly prohibited, and you are requested to delete the e-mail and any attachments and notify the sender immediately. = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Line diff
On Mon, Apr 08, 2002, Iftach Hyams wrote about Line diff: Is there a utility that diff single line, something like : This is line 1, This is Line 2 ! will result with This is line 1 RR++ L2 ! Emacs's (or Xemacs's) ediff does something similar to this (among all the other useful things it does): after doing a regular diff it further looks for and highlights the actuall differences in that block. It's very nice and very useful. Another very useful feature of ediff, if I already mentioned it, is a very convenient method for merging differences between two files. For the (X)Emacs illiterates, to use ediff all you need to is to open XEmacs and use the menubar's Tool - Compare - Two Files (the menus in Emacs might be different, I didn't check). It's also possible to compare two preloaded files with Tool - Compare - Two Buffers. There are many other possibilities, which you'll have to discover on your own (or read the docs). -- Nadav Har'El|Monday, Apr 8 2002, 26 Nisan 5762 [EMAIL PROTECTED] |- Phone: +972-53-245868, ICQ 13349191 |Unlike Microsoft, a restaurant will give http://nadav.harel.org.il |me food for free if I find a bug in it! = To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Line diff
On Mon, Apr 08, 2002, Iftach Hyams [EMAIL PROTECTED] wrote the following: Is there a utility that diff single line, something like : This is line 1, This is Line 2 ! will result with This is line 1 RR++ L2 ! You might be interested in wdiff. http://www.gnu.org/software/wdiff/wdiff.html -- { Daniel Jacob Pearson| compare foods} { [EMAIL PROTECTED] | -- jeff covey} msg18466/pgp0.pgp Description: PGP signature