How to you make diff-files?

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

How to you make diff-files?

Postby Ant_222 » 2017-8-10 @ 14:00

Dear patch writers,

the only working procedure that I have found for the making of diff files is rather cumbersome:
  1. Get a fresh version of DOSBox from SVN, say into the fresh directory.
  2. Copy it to another directory, let us say patch.
  3. From the working environment, copy all the files that the patch creates or modifies to patch, overwriting the existing files.
  4. Invoke diff between patch and freshto produce the patch file
As you see, this procedure is tedious and prone to errors. I cannot use the directory with my working DOSBox source directly because the binary and automake files will get in the way. I cannot use the very handy svn diff because it ignores new (unversioned) files.

How do you make you patch files?
Ant_222
Member
 
Posts: 335
Joined: 2010-7-24 @ 21:29

Re: How to you make diff-files?

Postby gdjacobs » 2017-8-10 @ 15:11

You might find git to be more flexible than svn.
User avatar
gdjacobs
l33t
 
Posts: 4178
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: How to you make diff-files?

Postby Ant_222 » 2017-8-10 @ 15:27

gdjacobs wrote:You might find git to be more flexible than svn.
Do you suggest that I set up and maintain a Git repository with a mirror of the official DOSBox SVN?
Ant_222
Member
 
Posts: 335
Joined: 2010-7-24 @ 21:29

Re: How to you make diff-files?

Postby konc » 2017-8-10 @ 15:43

I don't have a clue about SVN, but since git was mentioned, yes it's super-super easy to create diff files/patches with git. Easy as a 3-word command with the output redirected to a file. I used to hate git but hey, I got old and sane :)
User avatar
konc
Oldbie
 
Posts: 790
Joined: 2013-1-14 @ 15:09
Location: Greece

Re: How to you make diff-files?

Postby Qbix » 2017-8-10 @ 15:52

you can use svn add filename
to add it. You don't need write access to do that.
then svn diff will include that file "filename" as well.
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10375
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: How to you make diff-files?

Postby Ant_222 » 2017-8-10 @ 15:55

Thank you, Qbix.
Ant_222
Member
 
Posts: 335
Joined: 2010-7-24 @ 21:29

Re: How to you make diff-files?

Postby Qbix » 2017-8-10 @ 15:58

Code: Select all
svn checkout svn://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk dosbox-code-0
cd dosbox-code-0
echo hi >test.txt
svn add test.txt
svn diff --ignore-properties


or use as last line
Code: Select all
svn diff --patch-compatible


both will give
Code: Select all
Index: test.txt
===================================================================
--- test.txt    (nonexistent)
+++ test.txt    (working copy)
@@ -0,0 +1 @@
+hi


of course you need to redirect the output to a file to save it.
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10375
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: How to you make diff-files?

Postby gdjacobs » 2017-8-10 @ 19:05

Ant_222 wrote:Do you suggest that I set up and maintain a Git repository with a mirror of the official DOSBox SVN?


You can use the subversion bridging tool to pull into a local GIT repository which then gives you the full GIT toolset on your local copy. If you're only doing small stuff, it might not be worth it. If you're making substantial changes to the tree and merging them back or if it provides a way of keeping things organized, GIT could be a very powerful tool for you.
User avatar
gdjacobs
l33t
 
Posts: 4178
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: How to you make diff-files?

Postby Ant_222 » 2017-8-10 @ 20:54

gdjacobs, Right now I need to simplify relatively small changes, so Qbix's advice is the right next step for me. As far as I know, SVN offers the same fundamental functionality as GIT, i.e.: checkout, commit, branch, merge, diff; and whereas DOXBox is hosted in SVN I shall use that unless or until I meet with such incoveniences as GIT solves considerably better than SVN. I am on the path of least resistance and try do to the simplest thing that works.
Ant_222
Member
 
Posts: 335
Joined: 2010-7-24 @ 21:29

Re: How to you make diff-files?

Postby gdjacobs » 2017-8-11 @ 02:49

Again, the big difference is that with GIT the functionality is available by design for your local work as well as on the central server, and GIT is better at merging changes between different source trees (as that's what it was designed for).

The good news is that you're not locked into any particular tool. SVN is mature and works quite well within it's scope, but if you begin running into it's limits, you've got a wealth of options available to you.
User avatar
gdjacobs
l33t
 
Posts: 4178
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: How to you make diff-files?

Postby Serious Callers Only » 2017-8-19 @ 16:46

I use quilt. It's quite sophisticated, if linux only.
Serious Callers Only
Member
 
Posts: 331
Joined: 2003-4-26 @ 21:34

Re: How to you make diff-files?

Postby gdjacobs » 2017-8-19 @ 18:05

Yes. Andrew Morton is a clever guy.
User avatar
gdjacobs
l33t
 
Posts: 4178
Joined: 2015-11-03 @ 05:51
Location: The Great White North


Return to DOSBox Development

Who is online

Users browsing this forum: NY00123 and 1 guest