Porting code features

How, what and why to code in BYOND.
Post Reply
Malkevin

Porting code features

Post by Malkevin » #53562

Did anyone ever find an easy way to port commits from one codebase to another?

Say from a tg codebase to a baycode codebase, or vice versa?
User avatar
Xerux
Joined: Fri Apr 18, 2014 5:26 am
Byond Username: Xerux

Re: Porting code features

Post by Xerux » #53574

You can add the other code-base's repo as a remote and cherry-pick commits from it.
Spoiler:
Nolan Field - Various, Solar - Cyborg, Watcher - AI, Honksey - Clown, Sy Lent - Mime, Aveil Nahara - Inactive, Ayden Fryer - Data Lost | Byond, Github
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Porting code features

Post by oranges » #54922

Indeed - from the command line

git remote add baystation https://github.com/Baystation12/Baystation12.git

git fetch baystation

git log baystation - to view commits

once you find the commits you like

git cherry-pick commithash
Malkevin

Re: Porting code features

Post by Malkevin » #54954

Great, now is there a way to search the log based on pull requests, so I can for example bring up my own PRs that have been merged?
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Porting code features

Post by oranges » #55003

Unfortunately not, but you can do it from github
https://github.com/Baystation12/Baystation12/pulls/

Here and then use the filter to search

is:pr is:closed author:xxxxx

You can then view each commit and take note of the relevant commit hashes

Do bear in mind that git cannot always cleanly apply commits, it will do it's best and then stop and let you resolve the final differences if it encounters anyway (which is always likely between codebases)
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Porting code features

Post by oranges » #55004

Also git comes bundled with a small gui tool called gitk

just run gitk from the cli in your repo

It has some limited ability to search the commit log for words of relevance so that may also assist in tracking down changed code.
Post Reply

Who is online

Users browsing this forum: No registered users