Revision/Source Code Control

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Dyrcona
Posts: 15
Joined: December 26th, 2021, 12:59 pm

Revision/Source Code Control

Post by Dyrcona »

I'm just curious if anyone uses revision control software such as git, Mercurial, svn, etc. with their scenario and/or map files. I am thinking about using git and am looking for tips from others on how to organize the files and get the game to see them with limited fuss.

My current thought is to use a remote gitdir in my add-ons directory. This way the actual git files live elsewhere and can be updated from my local Wesnoth data directory.

If you use git or something for revision control, I'm curious to hear about what you do to minimize file copying, etc.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Revision/Source Code Control

Post by Lord-Knightmare »

Dyrcona wrote: January 21st, 2022, 5:21 pm I'm just curious if anyone uses revision control software such as git, Mercurial, svn, etc. with their scenario and/or map files. I am thinking about using git and am looking for tips from others on how to organize the files and get the game to see them with limited fuss.

My current thought is to use a remote gitdir in my add-ons directory. This way the actual git files live elsewhere and can be updated from my local Wesnoth data directory.

If you use git or something for revision control, I'm curious to hear about what you do to minimize file copying, etc.
I have git for all my add-ons these days. Helps in a lot of maintenance and patching.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Revision/Source Code Control

Post by octalot »

Thanks for creating this thread, I'm hoping that it will have something better/less complex that my current setup. I'm currently using git-subtree to have a dedicated repo for each add-on that I want to edit, and then a single Git repo covering wesnoth's data/add-ons directory.

The data/add-ons directory's .git/config includes these for Non Fatal Wounds:

Code: Select all

[alias]
	subadd-nfw-master = subtree add --prefix Non_Fatal_Wounds/ dedicatedNonFatalWounds/master -m "Merge.nfw/master"
	submerge-nfw-master = subtree merge --prefix Non_Fatal_Wounds/ dedicatedNonFatalWounds/master -m "Merge.nfw/master"
	subsplit-nfw = subtree split --prefix Non_Fatal_Wounds/ -b splits/nfw
I either edit in the dedicated repo and then merge with git subtree, or edit in the big repo and then split or cherry-pick back to the dedicated repo.
User avatar
Dyrcona
Posts: 15
Joined: December 26th, 2021, 12:59 pm

Re: Revision/Source Code Control

Post by Dyrcona »

octalot wrote: January 21st, 2022, 7:43 pm I either edit in the dedicated repo and then merge with git subtree, or edit in the big repo and then split or cherry-pick back to the dedicated repo.
That seems like an interesting approach. I've never used git subtrees before, though I do contribute to a project that uses git submodule. I'm going to have to look into subtree as an alternative to submodule.

I've had a look at Lord-Knighmare's github account, and I'm impressed. I'm definitely not ready to share anything, yet, but I'll consider putting the source on github when I am.
Post Reply