comparing multiple files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

comparing multiple files

Federico Bruni-2
Hi,

I've received the revision of the texidoc/ files from the italian
proofreader and I'd like to automatically generate the .diff file for
each file (in order to see his changes).

IIUC, diff can only compare two files or the list of files in two
directories.
Should I use some bash script?

Any help appreciated, thanks!

Federico



Reply | Threaded
Open this post in threaded view
|

Re: comparing multiple files

Francisco Vila
2011/7/18 Federico Bruni <[hidden email]>:

> Hi,
>
> I've received the revision of the texidoc/ files from the italian
> proofreader and I'd like to automatically generate the .diff file for
> each file (in order to see his changes).
>
> IIUC, diff can only compare two files or the list of files in two
> directories.
> Should I use some bash script?
>
> Any help appreciated, thanks!

I'd use git itself for that. If your original files are clean in your
tree/index, why not save new files in place and do 'git diff' ? this
will show you all the diffs against originals.  Then

  'git add' new files,
  'git commit' and
  'git format-patch HEAD^'

Once your patch is generated, you can safely reset to HEAD^ to recover
originals again.

--
Francisco Vila. Badajoz (Spain)
www.paconet.org , www.csmbadajoz.com


Reply | Threaded
Open this post in threaded view
|

Re: comparing multiple files

Francisco Vila
In reply to this post by Federico Bruni-2
2011/7/18 Federico Bruni <[hidden email]>:
> Hi,
>
> I've received the revision of the texidoc/ files from the italian
> proofreader and I'd like to automatically generate the .diff file for
> each file (in order to see his changes).
>
> IIUC, diff can only compare two files or the list of files in two
> directories.
> Should I use some bash script?

If you prefer a bash script, try this command line. Say you are in
Documentation/it/notation and newly corrected files are
Documentation/it/notation/new/file1.itexi, file2.itexi and so on.

  rm alldiffs # remove it first if it exists

  for f in file1 file2 file3 ; do diff -u $f.itexi new/$f.itexi >>
alldiffs ; done

then

  less alldiffs

--
Francisco Vila. Badajoz (Spain)
www.paconet.org , www.csmbadajoz.com