Using Version Control with Text Files

This would be the forum for questions about how to work with mod making tools which can be a problem of its own.

Moderator: Paul Siramy

Post Reply
User avatar
mmpx222
Junior Member
Paladin
Posts: 154
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Using Version Control with Text Files

Post by mmpx222 » Mon Dec 24, 2018 12:50 pm

After several years of modding with Brood War and Diablo 2, I've come to appreciate how great Version Control Systems are. You can try new things without headaches over managing backups or getting your files mixed up. If you work with a hosting service, such as GitHub, you don't even have to worry about your computer dying (you still do, but not so much if you back up stuff regularly). You can actually work with other people.

I used to work with Subversion because TortoiseSVN is easy to learn. However, the growth of GitHub and my interest in S/W development eventually made me learn Git. Git was tough to learn, but powerful.

For beginning modders, I still recommend backing up with Ctrl+C/Ctrl+V. For intermediate modders, who have much to lose over missed backups, I recommend TortoiseSVN. Set up a repository on your PC until you become comfortable with Subversion, then migrate to a online hosting service, such as SourceForge. However, most free hosting services require you to make your mod's source public. If this is a problem, just stick with the local repo, or look for paid options.

If you *really* want, you can learn Git or Mercurial, which have become much more popular in the last decade. It's easy to find free online hosting services for both of them, such as GitHub.

One problem: Maintaining diff logs (auto-generated changelogs) of tabbed TXT files can be difficult. Most VCSes and code editors are designed to compare software code, which is structured vertically, line-by-line. Diablo's tabbed TXT files have enormous "lines", and it's difficult to see which column has been changed.

My solution: I'm using a small hand-written Python script to "decompile" my TXT files into INI format. This makes the diff logs much easier to read. But I'm wondering, has anyone done this before? Do other modders use version control, and how?
Last edited by mmpx222 on Tue Dec 25, 2018 4:57 pm, edited 1 time in total.
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

User avatar
allas
Dark Alliance Beta Test
Paladin
Posts: 236
Joined: Wed Aug 22, 2007 4:44 pm

Re: Using Version Control with Text Files

Post by allas » Tue Dec 25, 2018 1:42 pm

For both SVN and GIT, you can use Bitbucket.org for unlimited private repository. The inline diff could be better (column are still hard to see) but it's still fine imo.
Capture.PNG
You can use Gitea to self host a github clone if you're not interested in sharing your mods too. It's open source but only work with git obviously.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: Using Version Control with Text Files

Post by Necrolis » Tue Dec 25, 2018 5:07 pm

There is also a TortoiseGIT available, I specifically like the TourtoiseMerge tools for diffing :) (and VS 2013+ directly supports GIT and SVN).
But when it comes to the txt files that are tabular, its not so great (there aren't really any good tools for this), what you can do is mark them as binary files, which may or may not be more helpful.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
mmpx222
Junior Member
Paladin
Posts: 154
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Re: Using Version Control with Text Files

Post by mmpx222 » Mon Jan 14, 2019 9:44 am

Necrolis wrote:
Tue Dec 25, 2018 5:07 pm
There is also a TortoiseGIT available, I specifically like the TourtoiseMerge tools for diffing :) (and VS 2013+ directly supports GIT and SVN).
But when it comes to the txt files that are tabular, its not so great (there aren't really any good tools for this), what you can do is mark them as binary files, which may or may not be more helpful.
Totally forgot about TortoiseGit. But if you Git, you should be fully armed with command line-fu XD

Glad to see people sharing the sentiment on diff logs. Would you be interested in a tool that (de)compiles TXT files to INI format? I wrote a crude Python script for it. INI files make diff logs sane (but rather long, since 1 cell = 1 line). If anyone's interested, I might release it.

Edit: Project is up, see thread: https://d2mods.info/forum/viewtopic.php?f=7&t=65849
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

User avatar
JDS
Junior Member
Paladin
Posts: 198
Joined: Wed Jun 05, 2013 8:31 pm

Re: Using Version Control with Text Files

Post by JDS » Mon Jan 14, 2019 4:28 pm

I've been using turtoiseSVN.
I haven't had problems as I only use diff to see what I have already changed in case I had to stop working in the middle of something.
If I really need to compare versions I copy the old revision and compare them side by side. Since it happens rarely I haven't gone through the effort of coding something up to do it for me.

Post Reply

Return to “Tools”