_server.pbl and version control

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Mathemagician
Posts: 31
Joined: March 24th, 2008, 10:42 pm
Location: Right behind you

_server.pbl and version control

Post by Mathemagician »

I'm about ready to publish a campaign, so it's time to make a _server.pbl. I'd like to put that in my git repo - I think title, description and especially dependencies should be versioned. But committing the passphrase is a bad idea. Is there a way around this issue, or do I have to suck it up and gitignore _server.pbl?
Formerly NeoPhile

vghetto
Posts: 96
Joined: November 2nd, 2019, 5:12 pm

Re: _server.pbl and version control

Post by vghetto »

This is how I do it.
I keep a separate branch for what gets uploaded to the addons server. I call it addons.
My main development goes on master and that goes up github.
My addons branch doesn't get uploaded to github and it differs from master in that it includes _server.pbl with the password and excludes a lot of junk and debug files that shouldn't get uploaded to the addons server. git rm junk.txt etc.
Once a new feature is ready, I merge with master, bump up the version number and upload the addons branch to wesnoth.
I hope that made sense.

User avatar
Mathemagician
Posts: 31
Joined: March 24th, 2008, 10:42 pm
Location: Right behind you

Re: _server.pbl and version control

Post by Mathemagician »

That's actually not bad. It kinda defeats the purpose, since the _server.pbl changes don't end up in the same commit as everything else, and can't be shared anyway, but it's still better than nothing. Thanks, vghetto.
Formerly NeoPhile

vghetto
Posts: 96
Joined: November 2nd, 2019, 5:12 pm

Re: _server.pbl and version control

Post by vghetto »

You could have _server.pbl on master but with the password left blank.
Depending on how you did it, the first time you merge addons with master, you might get a conflict on that password line. Fix that by editing _server.pbl on addons and choose the line with the password set. Then on following merges with master it would work fine, there shouldn't be any conflicts I guess, and you could update the master _server.pbl version number directly and have it with the same commit as everything else. You still would need to upload the addons branch to wesnoth though after the merge.

Edit:
I just tried this out and it worked.

I'm starting on branch addons here.

Code: Select all

cp _server.pbl ../
git checkout master
cp ../_server.pbl .
*Edit _server.pbl and blank out passphrase= and email=*
git add _server.pbl
git commit -a -m "pbl"
git checkout addons
git merge master
*Conflict! so move the original file with the set password and email*
mv ../_server.pbl .
git add _server.pbl
git commit
Last edited by vghetto on December 16th, 2019, 8:07 am, edited 1 time in total.


User avatar
Mathemagician
Posts: 31
Joined: March 24th, 2008, 10:42 pm
Location: Right behind you

Re: _server.pbl and version control

Post by Mathemagician »

vghetto wrote:
December 16th, 2019, 7:08 am
You could have _server.pbl on master but with the password left blank.
I thought the same thing as soon as I woke up. I don't think I've ever slept on something quite so literally before.
Ravana wrote:
December 16th, 2019, 7:15 am
One solution is https://github.com/vgaming/wesnoth_upload
Hot diggity dog! That should be officially supported! It'd fit right in in the tools dir.
Formerly NeoPhile

Post Reply