Fixing merge conflicts

How, what and why to code in BYOND.

Moderators: MisterPerson, Code Maintainers

CPTANT
 
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Fixing merge conflicts

Postby CPTANT » Mon Mar 21, 2016 2:08 pm #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.
Screemonster wrote:how the fuck are you supposed to RP with a grille



User avatar
Steelpoint
Github User
 
Joined: Thu Apr 17, 2014 6:37 pm
Location: The Armoury
Byond Username: Steelpoint
Github Username: Steelpoint

Re: Fixing merge conflicts

Postby Steelpoint » Mon Mar 21, 2016 2:29 pm #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

CPTANT
 
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Postby CPTANT » Mon Mar 21, 2016 4:03 pm #163395

It just says it is already up to date if I try step 3.
Screemonster wrote:how the fuck are you supposed to RP with a grille

User avatar
Steelpoint
Github User
 
Joined: Thu Apr 17, 2014 6:37 pm
Location: The Armoury
Byond Username: Steelpoint
Github Username: Steelpoint

Re: Fixing merge conflicts

Postby Steelpoint » Mon Mar 21, 2016 4:36 pm #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

CPTANT
 
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Postby CPTANT » Mon Mar 21, 2016 4:59 pm #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.
Screemonster wrote:how the fuck are you supposed to RP with a grille

User avatar
Remie Richards
 
Joined: Thu Apr 17, 2014 7:11 pm
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Byond Username: CrimsonVision

Re: Fixing merge conflicts

Postby Remie Richards » Mon Mar 21, 2016 6:52 pm #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

Postby duncathan » Mon Mar 21, 2016 7:17 pm #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
Location: U S A, U S A, U S A
Byond Username: PKPenguin321
Github Username: PKPenguin321

Re: Fixing merge conflicts

Postby PKPenguin321 » Mon Mar 21, 2016 10:57 pm #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

Postby kazeespada » Tue Mar 22, 2016 7:11 pm #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
Location: #CHATSHITGETBANGED
Byond Username: Optimumtact
Github Username: optimumtact

Re: Fixing merge conflicts

Postby oranges » Tue Mar 22, 2016 9:10 pm #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

Postby kazeespada » Tue Mar 22, 2016 9:56 pm #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

Postby Incoming » Tue Mar 22, 2016 10:00 pm #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.

Patreon - 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
Location: #CHATSHITGETBANGED
Byond Username: Optimumtact
Github Username: optimumtact

Re: Fixing merge conflicts

Postby oranges » Tue Mar 22, 2016 10:06 pm #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

Postby kazeespada » Tue Mar 22, 2016 10:12 pm #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

Postby Scott » Tue Mar 22, 2016 10:14 pm #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

Postby duncathan » Tue Mar 22, 2016 10:38 pm #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
Location: The Armoury
Byond Username: Steelpoint
Github Username: Steelpoint

Re: Fixing merge conflicts

Postby Steelpoint » Wed Mar 23, 2016 1:48 am #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

Postby duncathan » Wed Mar 23, 2016 2:34 am #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
Location: U S A, U S A, U S A
Byond Username: PKPenguin321
Github Username: PKPenguin321

Re: Fixing merge conflicts

Postby PKPenguin321 » Wed Mar 23, 2016 5:41 am #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

Postby duncathan » Wed Mar 23, 2016 5:47 am #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

Postby Incoming » Wed Mar 23, 2016 8:38 am #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.

Patreon - Make A Poor Life Choice

Good ideas backed by cruddy code since 2012!

CPTANT
 
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Postby CPTANT » Wed Mar 23, 2016 1:36 pm #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.
Screemonster wrote:how the fuck are you supposed to RP with a grille

Scott
Github User
 
Joined: Fri Apr 18, 2014 1:50 pm
Byond Username: Xxnoob
Github Username: xxalpha

Re: Fixing merge conflicts

Postby Scott » Wed Mar 23, 2016 9:17 pm #164088

Yes there is, UIs are slow.

User avatar
oranges
Code Maintainer
 
Joined: Tue Apr 15, 2014 9:16 pm
Location: #CHATSHITGETBANGED
Byond Username: Optimumtact
Github Username: optimumtact

Re: Fixing merge conflicts

Postby oranges » Wed Mar 23, 2016 10:06 pm #164103

Guys don't get all worked up about a flippant comment sheesh

CPTANT
 
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Postby CPTANT » Wed Mar 23, 2016 10:08 pm #164104

Scott wrote:Yes there is, UIs are slow.


ohw yeah, because typing out all those commands is fast.
Screemonster wrote:how the fuck are you supposed to RP with a grille

User avatar
duncathan
 
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Postby duncathan » Wed Mar 23, 2016 11:01 pm #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
Location: U S A, U S A, U S A
Byond Username: PKPenguin321
Github Username: PKPenguin321

Re: Fixing merge conflicts

Postby PKPenguin321 » Thu Mar 24, 2016 4:44 am #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

Postby kazeespada » Thu Mar 24, 2016 9:27 pm #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

CPTANT
 
Joined: Mon May 04, 2015 1:31 pm
Byond Username: CPTANT

Re: Fixing merge conflicts

Postby CPTANT » Wed Mar 30, 2016 1:28 pm #165475

So what happens if you try the method described on the wiki?
Screemonster wrote:how the fuck are you supposed to RP with a grille

User avatar
duncathan
 
Joined: Mon May 25, 2015 4:12 pm
Byond Username: Dunc
Github Username: duncathan

Re: Fixing merge conflicts

Postby duncathan » Wed Mar 30, 2016 6:33 pm #165544

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


Return to Coding

Who is online

Users browsing this forum: No registered users