Fixing merge conflicts

How, what and why to code in BYOND.
Post Reply
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Fixing merge conflicts

Post by CPTANT » #163363

What are the correct steps to solve a merge conflict for our environment?

The guide put on the wiki has a very big DONT DO THIS printed above it but doesn't give the correct way.
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
User avatar
Steelpoint
Github User
Joined: Thu Apr 17, 2014 6:37 pm
Byond Username: Steelpoint
Github Username: Steelpoint
Location: The Armoury

Re: Fixing merge conflicts

Post by Steelpoint » #163371

It varies slightly but here's the run down.

1:) Save all changes you've made, revert anything you have no intention of keeping.

2:) Right Click your -tg-station folder, hover 'TortoiseGit' and click the 'Pull' button.

3:) Using the code base remote (I named it upstream) pull the new code to the 'Master' branch, DO NOT pull the changes to the branch you are currently working on as this won't work.

4:) You'll receive a error when the pull attempt finishes, accept this and you'll see a menu allowing you to observe the changes between the two codes, yours and the new one, hit accept.

5:) From this menu you'll be displayed all the files in the code base, and any of YOUR OLD code files that are conflicting with the NEW CODEBASE files will be highlighted in red. From here simply right click any and all conflicting files and save using the new code.

6:) Hit the 'Push' button (or whatever) to save the changes.

From here you now need to go to all the files that were conflicting and re-add the code changes you added. You only have to do this for code files that were conflicted and were overwritten.

Addendum: If you have a conflicting map file what I recommend you do is copy+paste the map changes you've made into a new map files somewhere else, then when you've finished fixing the merge conflict simply take that and copy+paste it back into the map. Just make sure you're not overwriting anything by accident.
Last edited by Steelpoint on Mon Mar 21, 2016 4:36 pm, edited 1 time in total.
Image
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Post by CPTANT » #163395

It just says it is already up to date if I try step 3.
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
User avatar
Steelpoint
Github User
Joined: Thu Apr 17, 2014 6:37 pm
Byond Username: Steelpoint
Github Username: Steelpoint
Location: The Armoury

Re: Fixing merge conflicts

Post by Steelpoint » #163401

Scratch that I meant you need to get the code from the "upstream" branch.

Also known as the branch the code is held for /tg/.
Image
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Post by CPTANT » #163405

Steelpoint wrote:Scratch that I meant you need to get the code from the "upstream" branch.

Also known as the branch the code is held for /tg/.
But that just updates my master branch.
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Fixing merge conflicts

Post by Remie Richards » #163427

Steelpoint wrote: 3:) Using the code base remote (I named it upstream) pull the new code to the 'Master' branch, DO NOT pull the changes to the branch you are currently working on as this won't work.
You mean don't pull /tg/ master to my current local branch (eg: BEES_glorsious_BEES)? if so you're totally wrong and the evidence is every merge conflict I've ever solved.
私は完璧
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Post by duncathan » #163440

Yeah uh steelpoint you're SUPPOSED to pull to the current branch... NOT to master
Image
Players can and will create their own fun.
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Re: Fixing merge conflicts

Post by PKPenguin321 » #163506

how to fix conflicts:
1. git pull upstream master
2. git status
3. manually fix conflicts in the code
4. git add [full path and filename of conflicting files. can be found with git status]
5. commit
6. push
7. roll the dice of fate
8. your PR now has 20000 lines changed
9. close it and make a new PR
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
kazeespada
Joined: Wed Jan 21, 2015 4:29 am
Byond Username: Kaze Espada

Re: Fixing merge conflicts

Post by kazeespada » #163665

step 1. use tortoise
step 2. pull from origin master to your local master before making a new branch
step 3. make the changes.
step 4. PR it.
step 5.MERGE CONFLICTS
step 6. Pull from origin master to your local branch.
step 7. RESOLVE CONFLICTS. Go to conflicted files and right click them and select "Edit conflicts" it will open a side by side comparision. Use this to make the file most correct.
step 8. COMMIT CHANGES
step 9.Push to github branch for PR.
Image
Image
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Fixing merge conflicts

Post by oranges » #163718

Step 1. Stop using tortisegit, it's shit

Step 2. There is no step 2.
User avatar
kazeespada
Joined: Wed Jan 21, 2015 4:29 am
Byond Username: Kaze Espada

Re: Fixing merge conflicts

Post by kazeespada » #163744

oranges wrote:Step 1. Stop using tortisegit, it's shit

Step 2. There is no step 2.
Never had an error yet. Not sure why its shit?
Image
Image
Incoming
Github User
Joined: Tue Apr 15, 2014 11:41 pm
Byond Username: Incoming
Github Username: Incoming5643

Re: Fixing merge conflicts

Post by Incoming » #163749

Asking people to do all their git stuff from the command line is a great way to never get any more new hobbyist coders.
Developer - Datum Antags: Feburary 2016

Poly the Parrot - All Seeing Bird Transcends Universe, Joins Twitter.

Kofi - Make A Poor Life Choice

Good ideas backed by cruddy code since 2012!
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Fixing merge conflicts

Post by oranges » #163751

It's a great way to get rid of the shit ones though.
User avatar
kazeespada
Joined: Wed Jan 21, 2015 4:29 am
Byond Username: Kaze Espada

Re: Fixing merge conflicts

Post by kazeespada » #163754

oranges wrote:It's a great way to get rid of the shit ones though.
I can code better then half our coders and I use tortoise.
Image
Image
Scott
Github User
Joined: Fri Apr 18, 2014 1:50 pm
Byond Username: Xxnoob
Github Username: xxalpha

Re: Fixing merge conflicts

Post by Scott » #163755

Are you going to list some names?
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Post by duncathan » #163768

kazeespada wrote:
oranges wrote:It's a great way to get rid of the shit ones though.
I can code better then half our coders
hahahahahahahahahahahha
Image
Players can and will create their own fun.
User avatar
Steelpoint
Github User
Joined: Thu Apr 17, 2014 6:37 pm
Byond Username: Steelpoint
Github Username: Steelpoint
Location: The Armoury

Re: Fixing merge conflicts

Post by Steelpoint » #163839

I guess the problem is that these things are rarely documented and I'm trying to work off of memory.
Image
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Post by duncathan » #163859

Yeah, better documentation is sorely needed.
Image
Players can and will create their own fun.
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Re: Fixing merge conflicts

Post by PKPenguin321 » #163921

kazeespada wrote:step 1. use tortoise
step 2. pull from origin master to your local master before making a new branch
step 3. make the changes.
step 4. PR it.
step 5.MERGE CONFLICTS
step 6. Pull from origin master to your local branch.
step 7. RESOLVE CONFLICTS. Go to conflicted files and right click them and select "Edit conflicts" it will open a side by side comparision. Use this to make the file most correct.
step 8. COMMIT CHANGES
step 9.Push to github branch for PR.
okay so wait i actually have a question about this. when i do step 8 it changes like 30 dozen files and what i did last time was uncheck all but the file i actually want to fix conflicts on, but this lead to having 20,000~ lines changed on my PR. am i supposed to leave all of the files ticked or ???
oranges wrote:Step 1. Stop using tortisegit, it's shit

Step 2. There is no step 2.
i use tortoisegit only for committing and pushing (and i would use it for cherrypicking too but i've never had to) since the interface for those are nicer, but i use the console for everything else (with all the commands i need in a .txt file). am i a heathen or just a half heathen
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Post by duncathan » #163922

You have to leave the other files ticked.
Image
Players can and will create their own fun.
Incoming
Github User
Joined: Tue Apr 15, 2014 11:41 pm
Byond Username: Incoming
Github Username: Incoming5643

Re: Fixing merge conflicts

Post by Incoming » #163972

when you commit in those circumstances what your telling the project is "this is how the project looks after I make my changes as well as other peoples changes compared to the previous commit". If you uncheck the other files that changed besides your own you're basically saying "My changes obsoleted everything that's changed in the meantime, get rid of it". Which is probably not true.
Developer - Datum Antags: Feburary 2016

Poly the Parrot - All Seeing Bird Transcends Universe, Joins Twitter.

Kofi - Make A Poor Life Choice

Good ideas backed by cruddy code since 2012!
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Post by CPTANT » #164006

oranges wrote:It's a great way to get rid of the shit ones though.
Having to memorize text commands because someone is too lazy to make a decent UI does not make you a good coder.

Command lines were bearable in the past because the amount of programs worked with was limited and graphics were expensive.

There is literally no excuse for not making a decent UI these days.
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
Scott
Github User
Joined: Fri Apr 18, 2014 1:50 pm
Byond Username: Xxnoob
Github Username: xxalpha

Re: Fixing merge conflicts

Post by Scott » #164088

Yes there is, UIs are slow.
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Fixing merge conflicts

Post by oranges » #164103

Guys don't get all worked up about a flippant comment sheesh
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Post by CPTANT » #164104

Scott wrote:Yes there is, UIs are slow.
ohw yeah, because typing out all those commands is fast.
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Post by duncathan » #164119

CLI - higher skill cap, steeper learning curve
GUI - lower skill cap, smoother learning curve

just use the one you prefer
Image
Players can and will create their own fun.
User avatar
PKPenguin321
Site Admin
Joined: Tue Jul 01, 2014 7:02 pm
Byond Username: PKPenguin321
Github Username: PKPenguin321
Location: U S A, U S A, U S A

Re: Fixing merge conflicts

Post by PKPenguin321 » #164191

duncathan wrote:CLI - higher skill cap, steeper learning curve
GUI - lower skill cap, smoother learning curve

just use the one you prefer
mix of both is the way to go imo
i play Lauser McMauligan. clown name is Cold-Ass Honkey
i have three other top secret characters as well.
tell the best admin how good he is
Spoiler:
Image
User avatar
kazeespada
Joined: Wed Jan 21, 2015 4:29 am
Byond Username: Kaze Espada

Re: Fixing merge conflicts

Post by kazeespada » #164321

PKPenguin321 wrote:
kazeespada wrote:step 1. use tortoise
step 2. pull from origin master to your local master before making a new branch
step 3. make the changes.
step 4. PR it.
step 5.MERGE CONFLICTS
step 6. Pull from origin master to your local branch.
step 7. RESOLVE CONFLICTS. Go to conflicted files and right click them and select "Edit conflicts" it will open a side by side comparision. Use this to make the file most correct.
step 8. COMMIT CHANGES
step 9.Push to github branch for PR.
okay so wait i actually have a question about this. when i do step 8 it changes like 30 dozen files and what i did last time was uncheck all but the file i actually want to fix conflicts on, but this lead to having 20,000~ lines changed on my PR. am i supposed to leave all of the files ticked or ???
Commit changes will show that there are like 20 file changes if its larger then that then you should be updating your master more often. Commit these files as well. Also, if those files are not touched, then they will not show up on your PR. Always close DM when working with Git. DM and Git will fight each other silently for who can do what with files.
Image
Image
User avatar
CPTANT
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Post by CPTANT » #165475

So what happens if you try the method described on the wiki?
Timberpoes wrote: Tue Feb 14, 2023 3:21 pm The rules exist to create the biggest possible chance of a cool shift of SS13. They don't exist to allow admins to create the most boring interpretation of SS13.
User avatar
duncathan
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Post by duncathan » #165544

It often fucks up your branch and is not worth the pain of fixing
Image
Players can and will create their own fun.
Post Reply

Who is online

Users browsing this forum: No registered users