Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Sep 25, 2018 4:17 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Sep 11, 2018 4:14 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Jan 29, 2010 12:56 pm
Posts: 119
Hi,

after a long while of not maintaining it I am currently merging my patch into the current master sources from github.
I used to use the old repository url: http://git.openttd.org/openttd/trunk.git

But I realized that I get a redirect to the new repo:
Code:
$ git remote show openttd
fatal: unable to update url base from redirection:
  asked for: http://git.openttd.org/openttd/trunk.git/info/refs?service=git-upload-pack
   redirect: https://github.com/OpenTTD/OpenTTD


I updated the remote and fetched the branch again, but during the merge I realized that I don't have a common merge-base anymore and this creates a million conflicts during the merge. The last merge against the old github url was done against this commit:
Code:
d6df92b6d (openttd/master, openttd) (svn r27969) -Update from Eints: danish: 22 changes by Knogle


The last common commit is:
Code:
$ git merge-base openttd nr/master
a580b4c21ee20179fa50bdab04aaeb586185fe8e
$ git --no-pager log -1 a580b4c21ee20179fa50bdab04aaeb586185fe8e
commit a580b4c21ee20179fa50bdab04aaeb586185fe8e
Author: bjarni <bjarni@openttd.org>
Date:   Mon Nov 29 20:03:04 2004 +0000

    (svn r855) BeOS: moved bemidi to os/beos/ (w-ber)


Then they diverge starting at the next commit:
old repo:
Code:
$ git --no-pager log --oneline openttd | grep 'svn r856)'
4950c36769 (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config

new repo:
Code:
$ git --no-pager log --oneline nr/master | grep 'svn r856)'
00d6b3609f (svn r856) Makefile: added the flags CYGWIN and MINGW to libdetection. They were missing in the autodetected makefile.config


Does anybody know what is the reason for this?

I think for my merge I will just cherry-pick all commits for my own patch onto a new branch or something.


Last edited by ffpp on Wed Sep 12, 2018 7:03 pm, edited 1 time in total.

Top
   
PostPosted: Tue Sep 11, 2018 5:38 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7121
the way the new primary repo was created differs from the way the old copy repo was created. however, you should be able to use "rebase onto" to convert an old clone to the new repo

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


Top
   
PostPosted: Tue Sep 11, 2018 6:58 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Jan 29, 2010 12:56 pm
Posts: 119
I get several conflicts รก la

Code:
irst, rewinding head to replay your work on top of it...
Applying: (svn r5214) [languages] Re-done afrikaans change, this time proper
Using index info to reconstruct a base tree...
A   lang/unfinished/afrikaans.txt
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): lang/unfinished/afrikaans.txt deleted in HEAD and modified in (svn r5214) [languages] Re-done afrikaans change, this time proper. Version (svn r5214) [languages] Re-done afrikaans change, this time proper of lang/unfinished/afrikaans.txt left in tree.
error: Failed to merge in the changes.
Patch failed at 0001 (svn r5214) [languages] Re-done afrikaans change, this time proper
The copy of the patch that failed is found in: .git/rebase-apply/patch

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".


Top
   
PostPosted: Tue Sep 11, 2018 8:12 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7121
that sounds like you're trying to merge the entire old repo into the new one (or worse, the other way around), instead of just your changes?

in any case, unfinished/afrikaans.txt doesn't sound like a file containing vital information...

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


Top
   
PostPosted: Wed Sep 12, 2018 7:44 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Aug 08, 2005 1:46 pm
Posts: 1833
Location: Ipswich
If doing a rebase you will need to explicitly exclude the old upstream.
Something like (with your branch checked out)
Code:
git rebase --onto nr/master openttd/master


When I had this problem when merging the new upstream into my patchpack/repo, I used git replace to artificially join the two histories together at equivalent commits, which made things much easier.
That may be worth looking into if you get spurious conflicts or other issues trying to rebase or cherry-pick.

_________________
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018


Top
   
PostPosted: Wed Sep 12, 2018 7:02 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Jan 29, 2010 12:56 pm
Posts: 119
Eddi wrote:
that sounds like you're trying to merge the entire old repo into the new one (or worse, the other way around), instead of just your changes?

in any case, unfinished/afrikaans.txt doesn't sound like a file containing vital information...


I think that the old code base and the new one have diverged long before I made my first commit. So even when I try to rebase only my own changes onto the new master branch, it will use this old commit r5214 as oldest merge-base.
I tried to resolve those conflicts but they more complex than this one with the language text file.

JGR wrote:
If doing a rebase you will need to explicitly exclude the old upstream.
Something like (with your branch checked out)


Actually, the rebase worked now with JGR's suggestion. I was not aware of this rebase syntax where you can exclude a branch, the older master in this case.

Thanks for the help!


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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.