Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Dec 19, 2018 12:50 pm

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Oct 09, 2018 3:31 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 17, 2012 5:49 pm
Posts: 18
Location: Columbus, Ohio
Hello,

As I have stated I am trying to teach myself about C++, Patching, and the GIT system.

I have started by picking a patch which interests me ...
company_profile_v5_r22470.patch

Now according to this website ....
https://wiki.openttd.org/Compiling_on_(GNU/)Linux_and_*BSD#Applying_a_patch

I must first start with the version mentioned in the patch itself which in this case seems to be OpenTTD version 0.5 revision 22470

Looking at this website ....
https://github.com/OpenTTD/OpenTTD/rele ... .6.0-beta3

I can find no version 0.5 revision 22470

So the question is where is this mysterious v5_r22470?

New question ....

I just cloned from ...
https://github.com/OpenTTD/OpenTTD/tree/release/

openttd v 1.0 and v 1.1

When I ran findversion.sh on each of them they gave the same result ...
20181008-gfbfa4eb5 20181008 0
The only thing difference is the 40 digit alpha/numeric sequence following the above information

So why does two separate version clones result in the same version number?

Another question ..

From here ....
https://github.com/OpenTTD/OpenTTD/tree/release/1.1
I clone openttd v1.1
And from here ...
https://github.com/OpenTTD/OpenTTD/releases?after=1.1.0
I download the zip file

Why are these two completely different?
The zip file has a /src/ai/api folder but the cloned file does not

When I put the two files into Meld the quantity of differences is mind boggling

Are the people in charge trying to make me crazy?

As an accountant who sees the world in black, white, and red I am struggling to make sense of this.

Thanks
Bill


Top
   
PostPosted: Tue Oct 09, 2018 6:56 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7232
whtemple1959 wrote:
I have started by picking a patch which interests me ...
company_profile_v5_r22470.patch
[...] which in this case seems to be OpenTTD version 0.5 revision 22470

you seem to misunderstand a bit here, "v5" refers to the version of the patch itself, means this is the 5th attempt at that patch released by the person

the relevant information here is the "r22470", which refers to the revision of the development tree (in SVN-terms "trunk", in git-terms "master") it was developed for (patches are almost never against the "releases" tree)

this old SVN-revision number is included in the imported commit messages, so on the github page you search for "r22470" in the "commit" section like this:
https://github.com/OpenTTD/OpenTTD/sear ... pe=Commits
which gives you the matching git commit hash (that 40 digit hex number), which you can use with "git checkout" on your local clone to get the appropriate revision

from there on, you could add the patch, commit it to your local clone, and then attempt a "git rebase master" to update it

whtemple1959 wrote:
Are the people in charge trying to make me crazy?

from my experience so far, the people who developed git are almost definitely trying to make everyone else crazy.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Wed Oct 10, 2018 12:09 am 
Offline
Engineer
Engineer

Joined: Fri Aug 17, 2012 5:49 pm
Posts: 18
Location: Columbus, Ohio
Eddi,

Thanks for the lesson in versioning control and the guidance on tracking down versions in the "Commit" section.
Following your advice I found r22470 I cloned it and downloaded the zip file

Once again the clone version differs greatly from the zip file.

The clone version compiles with no problems ... but the patch is looking for ....
company_gui.cpp (revision 22470)
+++ company_gui.cpp (working copy)
@@ -1621,6 +1621,10 @@
CW_WIDGET_SELECT_RELOCATE, ///< View/hide the 'Relocate HQ' button.
CW_WIDGET_RELOCATE_HQ,

+ CW_WIDGET_SELECT_SAVE_LOAD_PROFILE,
+ CW_WIDGET_LOAD_PROFILE, ///< Load a company profile
+ CW_WIDGET_SAVE_PROFILE, ///< Save a company profile
+
while the clone file has some sort of WID "command/input"

The patch works in the zip file but once again the zip file tosses up errors beginning with fileio.cpp

So once again I have to ask what happens in the nether that makes a source code malfunction and why is the cloned version so different from the zip file?

Thanks
Bill


Top
   
PostPosted: Wed Oct 10, 2018 3:18 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7232
just to get a few obvious things out of the way:
  1. you changed your working copy with "git checkout <id>"? (check the current revision with "git status")
  2. you're applying the patch with -p0 option?
  3. you're in the right directory?

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Wed Oct 10, 2018 3:41 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 17, 2012 5:49 pm
Posts: 18
Location: Columbus, Ohio
Eddi,

I was working on this response in my text editor when of course I exited without moving it over to here.
I was trying to describe the craziness I encountered when I followed your link ... https://github.com/OpenTTD/OpenTTD/sear ... pe=Commits

Long story short with all the links that page has I ended up with 3 cloned files and according to "meld" they were exactly alike and 4 zipped files 3 of the 4 zip files were exactly like the cloned files and of course none of these are compatible with the patch I am interested in.

I will be honest and state that the cli does confuse me very often (plus my chubby fingers always miss-type so I have to re-input the commands often) so i do tend to use guis when possible. are you familiar with git-cola?

I will attempt to teach myself about git checkout and git status and see if that gets me on the right path.

Granted I am an idiot, although I am trying to understand the way "coder's" minds work but it seems that a lot of what is going on intentionally is designed to ignore real world lay people.

The journey continues

Thanks for the help so far

Bill


Last edited by whtemple1959 on Wed Oct 10, 2018 8:28 pm, edited 1 time in total.

Top
   
PostPosted: Wed Oct 10, 2018 5:39 pm 
Online
Engineer
Engineer

Joined: Wed May 24, 2017 12:51 pm
Posts: 33
Location: East Texas
whtemple1959 wrote:
Granted I am an idiot, although I am trying to understand the way "coder's" minds work but it seems that a lot of what is going on intentionally is designed to ignore real world law people.


Don't feel bad about this. Different software has different target audiences. Openttd is intended for everyone while, in the case of git, Linus Torvalds wrote the code to manage the Linux kernel source code and his intended audience was very experienced C coders who generally prefer to work on the command line. Git has grown a lot since it's birth and lots of people have done a lot of work to expand and correct core functionality but there has also been a lot of work to make things more useful for people outside the core audience (e.g. graphical front ends and integration with IDEs)

As a result, git has a ton of options but you really need to know only a few of the commands to use git. Now, I'm no git wizard but I found it quite easy to find those few commands that I use on a daily basis from the document known as "Everyday git"[1]

Really, I'm quite impressed to see an accountant tackle C++ because it's a "serious" language that takes a lot of learning to use. My own experience is that I've been programming since the 70s and I've found git quite easy to use. On the other hand, I'm sure you have accounting software that would make me feel pretty overwhelmed at first but would, hopefully, make sense in time.

[1] https://git-scm.com/docs/everyday

_________________
Unless otherwise stated, all my code is GPL v2.


Top
   
PostPosted: Wed Oct 10, 2018 8:28 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 17, 2012 5:49 pm
Posts: 18
Location: Columbus, Ohio
Row Dog

I do have 3 accounting packages that are very robust
I would be happy to do your taxes .... ;)
Thank you for the link and I will begin studying it today.
I guess the thing which confuses me the most is from the main page where it gives you the option to paste the clone info to the clipboard or download a zip you get two completely different versions.
And that I simply can not get my head around.
But, maybe your link will help because as it says "distributed-even-if-your-workflow-isnt" and my workflow is not distributed.
Again thanks

Respectfully
Bill


Top
   
PostPosted: Sat Oct 13, 2018 4:48 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon Jun 14, 2004 11:27 pm
Posts: 582
Location: Berlin, Germany
whtemple1959 wrote:
I guess the thing which confuses me the most is from the main page where it gives you the option to paste the clone info to the clipboard or download a zip you get two completely different versions.
And that I simply can not get my head around.

This is mostly a GitHub UI fail. The GitHub UI will always just tell you the git repository URL, no matter which sub-page you are on, but a simple git clone <URL> will always default to the latest current revision on the master branch. It fails to tell you that you either need to do git checkout <BRANCH> after the clone or use git clone -b <BRANCH> <URL> for a one-stop command (or whatever the equivalent command/menu option in your git client is). <BRANCH> can either be a real branch or tag like release/1.1 or a (shortened) hash for a specific revision.

-- Michael Lutz


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.