Currently Online

Latest Posts

Topic: Move Widelands to GitHub

hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-09-13, 22:44

Sorry I tried to setup an environment with git and tortoise git gui. But I don't understand how to setup branches, how to check them out, or download them. I think git is much more complicated then bazaar. So if I can't find out I need to stay down from contributing.


Top Quote
niektory
Avatar
Joined: 2019-06-03, 20:06
Posts: 206
Ranking
Widelands-Forum-Junkie
Location: Poland
Posted at: 2019-09-14, 00:56
This free book helped me get the hang of Git, maybe it'll help you too. IIRC I briefly tried TortoiseGit too but ended up with just the command line in the end.
Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-14, 09:10

Have you followed the instructions in Gitprimer? At which point did you stop understanding them?

Git has a masive amount of features, but you will only need a few of them to get started.

And definitely get a GUI client. For Windows, I have some experience with TortoiseGit and can help you with instructions there.

I see that you have already creted a fork, so I recommend that you do your work there first until you become familiar with the process. Maybe also start with a smaller project - I have just pushed an incomplete brlancing branch that you could continue working on https://github.com/widelands/widelands/tree/balancing-201908 for changes proposed in https://www.widelands.org/forum/topic/4589/

ETA: I am tracking the migrated branches in the first post of this thread.

On the command line, you would:

git checkout upstream balancing-201908

Do your changes, then

git add <changed files>
git commit -m "Commit message"
git push origin balancing-201908

I always find the git add step quite time-consuming on the command line. If you use TortoiseGit, you can right-click on the widelands folder to get a context menu and you'll only need to "Add" any files that you have added, just like with Bazaar. When you commit with TortoiseGit, it will add the file changes and deletions for you.

Edited: 2019-09-14, 09:17

Busy indexing nil values

Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-14, 11:17

I have made a pull request for our update.sh script https://github.com/widelands/widelands/pull/3476


Busy indexing nil values

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1928
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-09-14, 14:09

By the way, if you didn´t add new files and want to commit all changes, it´s a bit faster to skip git add and use git commit -am "message" instead.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1928
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-09-14, 16:58

A question about our branch ownership policy.
The bzr wiki page said that all branches should be created in the own personal repo (lp:~username/widelands/branchname), but everyone created their branches in lp:~widelands-dev/widelands/branchname.
The git wiki page also says to use our own fork (Username/widelands). Is this rule to be strictly kept? If so, should existing branches be continued on widelands/widelands or should they be copied over to Username/widelands and abandoned in the official repo? Edit: Exceptions for branches like amazons where several devs collaborate?

Edited: 2019-09-14, 16:59

Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-14, 18:36

Since we don't have an established work flow yet anyway, I will not be strict about where you put your branch. I still recommend using a fork though if you're new to git.

If you want to move an existing branch to your own repo, I think it's best if we delete it from the official repo so that we'll know which one is the current branch.

Nordfriese wrote:

By the way, if you didn´t add new files and want to commit all changes, it´s a bit faster to skip git add and use git commit -am "message" instead.

Thanks, I have added that to the instructions.

Edited: 2019-09-14, 18:37

Busy indexing nil values

Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-14, 20:14

I can also imagine the following workflow:

  • Nordfriese and hessenfarmer are working together on widelands/amazons
  • Nordfriese uses a branch in his own fork (nordfrees/amazons) to work on C++ changes
  • Nordfriese will make a Pull request from nordfrees/amazons into widelands/amazons (not widelands/master) to update widelands/amazons
  • We do a code review on the pull request and squash the commits while merging, ending up in 1 new commit in widelands/amazons

Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2019-09-14, 20:14

Is there a way to make downloading a specific branch a bit faster?

I'have cloned widelands master which lasts round about 25 Minutes (with a very fast internet connection). And now i wanted to test your branch at https://github.com/gunchleoc/widelands/tree/update-script and ran

git clone https://github.com/gunchleoc/widelands.git update_script

but it seems the download last also about 25 minutes...

Maybe i am doing something wrong?

Edited: 2019-09-14, 20:15

Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1928
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-09-14, 20:33

What I do to download a branch:

git clone https://github.com/widelands/widelands.git # Only once

cp -r widelands amazons                              # about 5 minutes
cd amazons
git checkout --track origin/amazons                  # 1 minute

Not entirely sure if this works with forks as well though


Top Quote