Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old September 12, 2010, 04:44   #1
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
dummy question: diff

How do you make a diff?

(I understand that that is a record of all the differences between two files or groups of files, correct me if I'm wrong)

I googled it and found this:
http://stephenjungels.com/jungels.ne...n-minutes.html

I tried to take it's advice and I got
"'diff' is not recognized as an internal or external command, operable program or batch file."
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old September 12, 2010, 04:53   #2
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by will_asher View Post
How do you make a diff?

(I understand that that is a record of all the differences between two files or groups of files, correct me if I'm wrong)

I googled it and found this:
http://stephenjungels.com/jungels.ne...n-minutes.html

I tried to take it's advice and I got
"'diff' is not recognized as an internal or external command, operable program or batch file."
diff is a *NIX utility. If you're on Windows, you need to install the relevant chunk of either MingW32 or CygWin (I use MingW32).

Any decent source code control system will also provide diff functionality (SVN/Git/Mercurial/..., unsure about CVS).
__________________
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011
zaimoni is offline   Reply With Quote
Old September 12, 2010, 05:19   #3
krugar
Apprentice
 
krugar's Avatar
 
Join Date: Sep 2010
Location: Portugal
Age: 48
Posts: 76
krugar is on a distinguished road
If you want to go directly to the programs, you can download the GNU Diffutils package.

Personally I also like colordiff. This is a perl script that wraps around diff and outputs in color. Quite useful if you appreciate syntax coloring. To facilitate usage, you can add the following to your shell settings file (usually ~/.bashrc if you are using bash)

Code:
alias diff='colordiff'
krugar is offline   Reply With Quote
Old September 12, 2010, 05:39   #4
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
okay I downloaded diiffutils and extracted it from the archive. now what?

what directory do these files have to be in for diff to work?
I don't see any file called diff...?
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Old September 12, 2010, 07:59   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,054
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by will_asher View Post
okay I downloaded diiffutils and extracted it from the archive. now what?

what directory do these files have to be in for diff to work?
I don't see any file called diff...?
Will, Krugar is using Linux and you, IIUC, are using Windows. As Zaimoni said, you'll need either mingw32 or cygwin.

The usual syntax is

diff -u file1 file2 >outputfile.diff

or

diff -u dir1 dir2 >outputfile.diff

(the -u tells it to use the "unified diff" format)

But if you're using svn or git you can just type "svn diff" or "git diff" to get the changes against the latest checked out revision.
Magnate is offline   Reply With Quote
Old September 12, 2010, 09:57   #6
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,093
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by krugar View Post
If you want to go directly to the programs, you can download the GNU Diffutils package.
That's wrong link to diffutils (you posted colordiff twice).

GNU diffutils is a right one.

(EDIT)
Windows diffutils:
DiffUtils for Windows

Last edited by Timo Pietilš; September 12, 2010 at 10:08.
Timo Pietilš is offline   Reply With Quote
Old September 12, 2010, 10:07   #7
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,093
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by will_asher View Post
okay I downloaded diiffutils and extracted it from the archive. now what?

what directory do these files have to be in for diff to work?
I don't see any file called diff...?
You probably downloaded diffutils for linux/unix systems.

Here is link for windows utils:

DiffUtils for Windows
Timo Pietilš is offline   Reply With Quote
Old September 13, 2010, 04:41   #8
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,585
Donated: $40
Pete Mack is on a distinguished road
If you are doing a diff vs the main (svn) branch, the best option is to use svn diff. (TortoiseSVN explorer plugin has it too.)
Pete Mack is offline   Reply With Quote
Old September 13, 2010, 05:48   #9
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by will_asher View Post
what directory do these files have to be in for diff to work?
I don't see any file called diff...?
Hmm...wrong archive, then.

When you do have a file called diff.exe , it will need to be in your PATH. I find it simplest to maintain a *NIX-like directory system, and adjust my PATH to make sure the directory corresponding to /bin is in it. [Do this from the System control panel; it's an "advanced" function supposedly, will trigger UAC to adjust it.]

For my MingW32-based setup, I use the following for my *NIX-like directories

Code:
c:\bin  [diff and other typical *NIX utilities goes here; in PATH]
c:\etc [for bash and a few other utilities]
c:\usr\local\include [for GCC]
c:\usr\local\lib [for GCC]
Note that this is not a standard MingW32 install, I'm breaking practically all typical install shell scripts in exchange for having everything "just work" almost everywhere on the main hard drive.

For working in C++, the following are also in my PATH
Code:
c:\dev.tools\bin [unpack binutils in c:\dev.tools so I can update without trashing my GCC installs]
c:\MingW32\bin [rename whatever MingW32 compiler suite's directory I want to work in to this]
I currently have installed:
Code:
c:\MingW32.345 [3.4.5 works, binaries tend to be bloated]
c:\MingW32.421 [4.2.1 works, atexit and friends highly unstable]
c:\MingW32.433 [4.3.3 works]
c:\MingW32.441 [4.4.1 won't build libJPEG or libPNG by generating invalid assembly, so generally useless]
c:\MingW32.450 [4.5.0 won't build libJPEG or libPNG by generating invalid assembly, so generally useless]
I normally use MingW32 4.3.3 unless specifically checking backward compatibility, or faced with source code that ICE's on 4.3.3.
__________________
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011
zaimoni is offline   Reply With Quote
Old September 13, 2010, 06:22   #10
will_asher
DaJAngband Maintainer
 
will_asher's Avatar
 
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
Quote:
Originally Posted by Timo Pietilš View Post
You probably downloaded diffutils for linux/unix systems.

Here is link for windows utils:

DiffUtils for Windows
Ah yes, that would probably be my problem. thanks

Nice that I can get diffutils without having to learn how to use MingW32 or svn. I've never used either and I don't think it's worthwhile for me to learn them. I don't really plan to become a serious programmer.
__________________
Will_Asher

Play DaJAngband:
http://sites.google.com/site/dajangbandwebsite/home
will_asher is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.