Learn to rebase you butts

How, what and why to code in BYOND.
Post Reply
Miauw
Joined: Sat Apr 19, 2014 11:23 am
Byond Username: Miauw62

Learn to rebase you butts

Post by Miauw » #74234

Are you tired of thousands upon thousands of ugly merge commits, screwing everything up and inflating your PR like a balloon?
Worry no more!
For there is a way to avoid this: REBASING.

For those of you who use Tortoisegit, just select "Rebase" in the context menu, select "master" in the Upstream: field and just hit "Start Rebase"!
That's really all there is to it. If you get conflicts, it will say so at the bottom. Resolve these conflicts as you would normally and hit "Continue".
After that, all you have to do is FORCE (this part is important, you're overwriting your previous commit) push your branch to origin and you are DONE!
<wb> For one, the spaghetti is killing me. It's everywhere in food code, and makes it harder to clean those up.
<Tobba> I stared into BYOND and it farted
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: Learn to rebase you butts

Post by Remie Richards » #74236

Or you could do the sane thing and squash them.

I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
私は完璧
User avatar
phil235
Joined: Thu Apr 17, 2014 11:39 am
Byond Username: Phil235

Re: Learn to rebase you butts

Post by phil235 » #74239

Remie Richards wrote:Or you could do the sane thing and squash them.

I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
The 'combine to one commit' option doesn't exist for me, I think the guide is outdated.
I'm a tgstation coding maintainer janitor
Scott
Github User
Joined: Fri Apr 18, 2014 1:50 pm
Byond Username: Xxnoob
Github Username: xxalpha

Re: Learn to rebase you butts

Post by Scott » #74242

or you could use the command line and stop being scrubs
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: Learn to rebase you butts

Post by Remie Richards » #74248

phil235 wrote:
Remie Richards wrote:Or you could do the sane thing and squash them.

I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
The 'combine to one commit' option doesn't exist for me, I think the guide is outdated.
Well shit, really glad I haven't updated my tortoisegit in a while.
Edit: According to the patch notes it hasn't been removed, perhaps just relocated.
私は完璧
User avatar
Mandurrh
Joined: Mon Mar 02, 2015 12:32 pm
Byond Username: Mandurrh

Re: Learn to rebase you butts

Post by Mandurrh » #74257

Image
Spoiler:
Image
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: Learn to rebase you butts

Post by Remie Richards » #74267

Mandurrh wrote:I have a few other ones too!

http://pastebin.com/stbn2Dpg

http://pastebin.com/hAtgdSAq
git reset --soft HEAD~X
soft HEAD
must... resist... joke...
私は完璧
User avatar
MisterPerson
Board Moderator
Joined: Tue Apr 15, 2014 4:26 pm
Byond Username: MisterPerson

Re: Learn to rebase you butts

Post by MisterPerson » #74280

Or you could stop worrying about it because it doesn't fucking matter.
I code for the code project and moderate the code sections of the forums.

Feedback is dumb and it doesn't matter
User avatar
Cheridan
Joined: Tue Apr 15, 2014 6:04 am
Byond Username: Cheridan

Re: Learn to rebase you butts

Post by Cheridan » #74348

MisterPerson wrote:Or you could stop worrying about it because it doesn't fucking matter.
I generally don't care but there's points where newbies get more commits than characters changed in their PRs and it becomes ridiculous.
Image
/tg/station spriter, admin, and headcoder. Feel free to contact me via PM with questions, concerns, or requests.
Incoming
Github User
Joined: Tue Apr 15, 2014 11:41 pm
Byond Username: Incoming
Github Username: Incoming5643

Re: Learn to rebase you butts

Post by Incoming » #74376

I like getting pulls merged with a low number of commits because it shows that I didn't cock up balance/functionality for it too badly on my initial write. It's like solving puzzles in a low number of moves.
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
Mandurrh
Joined: Mon Mar 02, 2015 12:32 pm
Byond Username: Mandurrh

Re: Learn to rebase you butts

Post by Mandurrh » #74386

Cheridan wrote:
MisterPerson wrote:Or you could stop worrying about it because it doesn't fucking matter.
I generally don't care but there's points where newbies get more commits than characters changed in their PRs and it becomes ridiculous.
Me. I always think it'll be just one then it's 10 changes asked for or needed or I forgot something and I have to squash so I don't die from shame.
Image
Spoiler:
Image
User avatar
Not-Dorsidarf
Joined: Fri Apr 18, 2014 4:14 pm
Byond Username: Dorsidwarf
Location: We're all going on an, admin holiday

Re: Learn to rebase you butts

Post by Not-Dorsidarf » #74401

You can't handle my 23-commit 20-lines-changed PR! You can't handle my 300 files changed 1 line of code changed PR!
Image
Image
kieth4 wrote: infrequently shitting yourself is fine imo
There is a lot of very bizarre nonsense being talked on this forum. I shall now remain silent and logoff until my points are vindicated.
Player who complainted over being killed for looting cap office wrote: Sun Jul 30, 2023 1:33 am Hey there, I'm Virescent, the super evil person who made the stupid appeal and didn't think it through enough. Just came here to say: screech, retards. Screech and writhe like the worms you are. Your pathetic little cries will keep echoing around for a while before quietting down. There is one great outcome from this: I rised up the blood pressure of some of you shitheads and lowered your lifespan. I'm honestly tempted to do this more often just to see you screech and writhe more, but that wouldn't be cool of me. So come on haters, show me some more of your high blood pressure please. 🖕🖕🖕
Miauw
Joined: Sat Apr 19, 2014 11:23 am
Byond Username: Miauw62

Re: Learn to rebase you butts

Post by Miauw » #74419

MisterPerson wrote:Or you could stop worrying about it because it doesn't fucking matter.
rebasing has less of a chance to fuck up and give your PR 5000 commits and 5456132 million lines changed.
<wb> For one, the spaghetti is killing me. It's everywhere in food code, and makes it harder to clean those up.
<Tobba> I stared into BYOND and it farted
User avatar
MisterPerson
Board Moderator
Joined: Tue Apr 15, 2014 4:26 pm
Byond Username: MisterPerson

Re: Learn to rebase you butts

Post by MisterPerson » #74435

I would actually argue that telling a beginner to rebase is more likely to cause their pull request to be fucked up than less.
I code for the code project and moderate the code sections of the forums.

Feedback is dumb and it doesn't matter
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Learn to rebase you butts

Post by oranges » #74491

rebasing on top of master is literally a completely safe operation.

it's the force push to the repository after that can bring danger.

But anyone should be able to grasp how to use it.
User avatar
MisterPerson
Board Moderator
Joined: Tue Apr 15, 2014 4:26 pm
Byond Username: MisterPerson

Re: Learn to rebase you butts

Post by MisterPerson » #74498

Even still, it doesn't do any useful function. Mixing in unnecessary commits with your pr's branch is a sign of a bad merge and would need to be corrected anyway. No need to fix a problem that doesn't exist yet.
I code for the code project and moderate the code sections of the forums.

Feedback is dumb and it doesn't matter
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Learn to rebase you butts

Post by oranges » #74517

no merge commits, plus a maintainer can do a fastfoward merge of your PR which means they can revert it easy since there isn't a merge commit which are unrevertable.
User avatar
MisterPerson
Board Moderator
Joined: Tue Apr 15, 2014 4:26 pm
Byond Username: MisterPerson

Re: Learn to rebase you butts

Post by MisterPerson » #74586

What do you mean unrevertable? Of course they're revertable. If they weren't, we wouldn't be able to use them at all because the merge of the pull request itself makes a merge commit. Github was just fine with me making a revert branch for pulls that contained merges (with an s) before the main merge, so I'm going to say with firsthand experience that you're wrong.

The only way to do a "fastforward merge" (which I'm assuming to mean a merge without a merge commit, because frankly it sounds like you're making shit up) would be to have the merge itself be a rebase from the merging branch onto the primary branch. Which would be great if we were using Phabricator. But we don't. And even if we did, avoiding merge commits doesn't mean anything to begin with. It's not a useful goal to strive for because there's no gain from doing so other than to appease some people's obsessive, retarded, unjustified hate of them.
I code for the code project and moderate the code sections of the forums.

Feedback is dumb and it doesn't matter
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Learn to rebase you butts

Post by oranges » #75481

http://ariya.ofilabs.com/2013/09/fast-f ... merge.html

I wasn't quite accurate by stating that a merge commit is unrevertable, you can, but it does cause issues when you want to then later bring that code back in

see here
http://git-scm.com/blog/2010/03/02/undoing-merges.html
Post Reply

Who is online

Users browsing this forum: No registered users