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?
Using Version Control with Text Files
Moderator: Paul Siramy
Using Version Control with Text Files
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
Re: Using Version Control with Text Files
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.
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.- Necrolis
- Throne
- Posts: 9125
- Joined: Sat Mar 25, 2006 1:22 pm
- Location: The Land of the Dead
- Contact:
Re: Using Version Control with Text Files
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.
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.
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
Re: Using Version Control with Text Files
Totally forgot about TortoiseGit. But if you Git, you should be fully armed with command line-fu XDNecrolis wrote: ↑Tue Dec 25, 2018 5:07 pmThere 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.
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
Re: Using Version Control with Text Files
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.
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.