There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

pomodoro_longbreak , in History repeats itself
@pomodoro_longbreak@sh.itjust.works avatar

The little median in the middle is the dev who helps them fix their branch over screenshare

MonkderZweite , in Golang be like

Comment the unused variable out and no security hole gets accidentally shipped.

GandarfDeGrape , in History repeats itself

OK. Query.

Rebase or merge into current?

I personally never rebase. It always seems to have some problem. I’m surely there’s a place and time for rebasing but I’ve never seen it in action I guess.

NatoBoram ,

It only matters if you want to be able to use the commit tree and actually find something. Otherwise, there’s no harm in using merges.

Blamemeta ,

What you do is create a third branch off master, cherry pick the commits from the feature branch, and merge in the third branch. So much easier.

BabaYaga ,

I’ve definitely done this before…

JDubbleu ,

This is actually genius. Gonna start using this at work.

GigglyBobble ,

If your cherry-pick doesn't run into conflicts why would your merge? You don't need to merge to master until you're done but you should merge from master to your feature branch regularly to keep it updated.

Blamemeta ,

Git is weird sometimes.

yogo ,

That’s called rebasing

fiah ,
@fiah@discuss.tchncs.de avatar

for some reason it’s easier than normal rebasing though

yogo ,

Have you tried interactive rebase (rebase -i)? I find it very useful

Blamemeta ,

Yeah, but then you deal with merge conflicts

gedhrel ,

rerere is a lifesaver here.

(I’m also a fan of rebasing; but I also like to land commits that perform a logical and separable chunk of work, because I like history to have decent narrative flow.)

dukk ,

You can get merge conflicts in cherry picks too, it’s the same process.

atyaz ,

That is absolutely not what rebasing does. Rebasing rewrites the commit history, cherry picking commits then doing a normal merge does not rewrite any history.

yogo , (edited )

I’m sorry but that’s incorrect. “Rewriting the commit history” is not possible in git, since commits are immutable. What rebase actually does is reapply each commit between upstream and head on top of upstream, and then reset the current branch to the last commit applied (This is by default, assuming no interactive rebase and other advanced uses). But don’t take my word for it, just read the manual. git-scm.com/docs/git-rebase

atyaz ,

“Reapply” is rewriting it on the other branch. The branch you are rebasing to now has a one or multiple commits that do not represent real history. Only the very last commit on the branch is actually what the user rebasing has on their computer.

yogo ,

Cherry picking also rewrites the commits. This is equivalent to rebasing:


<span style="color:#323232;">git branch -f orig_head
</span><span style="color:#323232;">git reset target
</span><span style="color:#323232;">git cherry-pick ..orig_head
</span>
dukk ,

Merge commits suck.

My biggest issue with GitHub is that it always squashes and merges. It’s really annoying as it not only takes away from commit history, but it also puts the fork out of sync with the main branch, and I’ll often realize this after having implemented another features, forcing me end up cherry picking just to fix it. Luckily LazyGit makes this process pretty painless, but still.

Seriously people, use FF-merge where you can.

Then again, if my feature branch has simply gone behind upstream, I usually pull and rebase. If you’ve got good commits, it’s a really simple process and saves me a lot of future headaches.

There’s obviously places not to use rebase(like when multiple people are working on a branch), but I consider it good practice to always rebase before merge. This way, we can always just FF-merge and avoid screwing with the Git history. We do this at my company and honestly, as long as you follow good practices, it should never really get too out of hand.

GandarfDeGrape ,

Sounds like I just gotta get better with rebasing. But generally I do my merges clean from local changes. I’ll commit and push, then merge in, push. Then keep working. Not too hard to track but I’ve found it’s the diff at MR time that people really pay attention to. So individual commits haven’t been too crucial.

GigglyBobble ,

Merge commits suck.

My biggest issue with GitHub is that it always squashes and merges.

You are aware you're talking about two different pieces of software?

dukk ,

Yeah, I am. However GitHub, being the biggest Git hosting provider and all that, makes you use merge commits. FF-merges must be done manually from the command line. While this definitely isn’t a problem for me, many people out there just don’t care and merge without a second thought (which, as I said in my comment, results in having to create a new branch and cherry picking the commits onto there).

themusicman ,

You should check out the repo options on GitHub. It most definitely supports rebase merges, and you can disable other merge types if desired.

risottinopazzesco ,

Rebase. Merge into current leaves merge commits in the dev branches.

atyaz ,

Always merge when you’re not sure. Rebasing rewrites your commit history, and merging with the squash flag discards history. In either case, you will not have a real log of what happened during development.

Why do you want that? Because it allows you to go back in time and search. For example, you could be looking for the exact commit that created a specific issue using git bisect. Rebasing all the commits in a feature branch makes it impossible to be sure they will even work, since they represent snapshots that never existed.

I’ll never understand why people suggest you should default to rebasing. When prompted about why, it’s usually some story about how it went wrong and it was just easier to do it the wrong way.

I’m not saying never squash or rebase. It depends on the situation but if you had to pick a default, it should be to simply merge.

h14h ,

I try to structure my commits in a way that minimizes their blast radius, which usually likes trying to reduce the number of files In touch per commit.

For example, my commit history would look like this:

  • Add new method to service class
  • Use new service class method in worker

And then as I continue working, all changes will be git commit --fixuped to one of those two commit’s hashes depending on where they occur.

And when it’s time to rebase in full, I can do a git rebase master --interactive --autosquash.

dukk ,

This is the way! Small commits with descriptive commit names, then just fixup into a few feature commits. Makes rebase a breeze.

rookeh ,

I’ve always merged. Rebase simplifies the history graph, but realistically I can’t think of a time where that has been important to me, or any of the teams I’ve worked with.

Maybe on some projects with a huge number of concurrent branches it becomes more important, probably less so for smaller teams.

EarJava , in Scammers vs Impossible Password Game

The moment when the fire started was gold! Paul was slain!

ytrav , in Ouch

when your code showers more than you (stinky)

Mic_Check_One_Two , in Order

Chaotic evil is encrypting, compressing, then encrypting again.

UtMan1988 ,

Then decompress after. Let fear be your cypher.

InfiniteStruggle ,

When playing football, to keep the socks from riding down our legs, we used to put loose rubber bands on top of them, near the top of the sock. Then to avoid the rubberbands from riding up above the sockline, we used to fold the sock over the rubberbands downwards. Then to avoid the fold from being undone during play another rubberband had to be put on top of the folded part.

Sounds similar to this. Just thought it was notable.

UtMan1988 ,

So, when you foot turns purple from the multitude of rubber bands, did it make you play any better?

InfiniteStruggle ,

Nope. It was uncomfortable and I’d argue we played worse because of the discomfort. We were also pretty bad at the game so I think we wanted the socks with rubber bands as a scapegoat instead of accepting we were shit.

Anticorp ,

Why didn’t you guys just buy good socks? Or those sock suspenders?

mrsgreenpotato ,

That costs money

yum13241 ,

That’s like md5(sha512(“somefile.blah”))

Coehl , in JSON, I hardly know 'er
@Coehl@programming.dev avatar

Did he turn off notifications this time? I bet he didn’t. I BET HE DIDN’T.

Let’s check it out…

clobubba , in No Scrum - Parody of TLC "No Scrubs"

deleted_by_author

  • Loading...
  • victron ,
    @victron@programming.dev avatar

    I actually laughed, I sing like shit

    jalda , in The Password Game

    “Your password must include the URL of a 23 minute 42 second long YouTube video.”

    lol

    canpolat OP ,
    @canpolat@programming.dev avatar

    Careful with Paul. He may starve.

    rockyTron ,
    DonjonMaister ,
    @DonjonMaister@programming.dev avatar

    I quit after I got that…

    where_am_i , in No Scrum - Parody of TLC "No Scrubs"

    deep into YouTube?

    blomkalsgratin , in Shower thought:

    But is it web scale?

    tja OP ,
    @tja@sh.itjust.works avatar

    For webscale you might want to use mongodb

    Edit: oh shit. This is old.

    blomkalsgratin ,

    Does it require a lot of configuration though? Does it work?

    NegativeLookBehind , in No Scrum - Parody of TLC "No Scrubs"
    @NegativeLookBehind@kbin.social avatar

    No.

    LawfulPirate ,
    @LawfulPirate@sh.itjust.works avatar

    I don’t want no scrum

    ruffsl OP ,
    @ruffsl@programming.dev avatar

    Scrum 's a thing that can’t get no love from me

    HiddenLayer5 , (edited ) in Golang be like

    Sometimes I think Go was specifically made for Google to dictate its own preferences on the rest of us like some kind of power play. It enforces one single style of programming too much.

    philm ,

    Is this a hard error? Like it doesn’t compile at all?

    Isn’t there something like #[allow(unused)] in Rust you can put over the declaration?

    flame3244 ,

    Yes it is a hard error and Go does not compile then. You can do _ = foobar to fake variable usage. I think this is okay for testing purposes.

    nomadjoanne ,

    Ew, that’s awful. Go is not one of my programming languages but I had always held it in high esteem because Ken Thompson and Rob Pike were involved in it.

    flame3244 ,

    Honestly, it does not happen often that I have a ln unused variable that I want to keep. In my mind it is the same thing when wanting to call a function that does not exists. Also my editor is highlighting error Long before I try to compile, so this is fine too for me.

    merc ,

    That’s the main reason it has had any success. It’s not that it’s a good language, it’s just that it has good references.

    MonkCanatella ,

    I think that’s even worse because it increases the likelihood you’ll forget you faked that variable just for testing

    flame3244 ,

    Worse than not having a unused variable check at all? Dunno, the underscore assignment are very visible for me and stand out on every code read and review.

    AeonFelis ,

    Yes, worse, because now if you want to use the underscore assignment to indicate that you really want to discard that variable - it gets confused with underscore assignments that were put there “temporarily” for experimentation purpose.

    merc ,

    Exactly.

    Say I’m having some issue with a function. I comment out half the function to see if that’s where the weirdness is. Golang says “unused variable, I refuse to compile this dogshit!” I completely fool Golang by just using _ = foo. Yes, I was correct, that’s where the problem was. I rewrite that section of the code, and test it out, things work perfectly. Only now, it turns out I’m not using foo anymore, and Golang has no idea because I so cleverly fooled it with _ = foo.

    Now, something that could be caught by a linter and expressed as a warning is missed by the language police entirely, and may make it into production code.

    Police the code that people put into a repository / share with others. Don’t police the code that people just want to test on their own.

    AstridWipenaugh ,

    The underscore is used in production code too. It’s a legitimate way to tell the compiler to discard the object because you don’t intend to use the pointer/value.

    HiddenLayer5 , (edited )

    Never really coded in Go outside of trying it out, but as far as I know it’s a hard error.

    space_comrade ,

    From what I’ve heard from Google employees Google is really stringent with their coding standards and they usually limit what you can do with the language. Like for C++ they don’t even use half the fancy features C++ offers you because it’s hard to reason about them.

    I guess that policy makes sense but I feel like it takes out all the fun out of the job.

    frezik ,

    As far as C++ goes, that’s probably the only sane way to use the language.

    Sloogs ,

    Just about any place I know that uses C++ also does that with C++ so that’s nothing unusual for C++ specifically. It’s too big of a language to reason about very well if you don’t, so you’ve gotta find a subset that works.

    skeletorsass ,

    Too many patterns. If you do not do this every author will have a different use of the language and you will have to read a book of documentation each time you change files.

    flame3244 ,

    I think this is a good thing. The styles are just opinions anyway and forcing everyone to just follow a single style takes a lot of bikeshedding away, which I really like.

    Crashumbc , in Golang be like

    The best part of these threads is no matter what someone comments, at least 2 people will reply either correcting or “clarifying” the original commenter.

    Lol

    dudewitbow , in Shower thought:

    I couldnt even imagine trying to port any non assembly language to circuits in verilog.

    hardware26 ,

    It is easier to implement ALU, memory and interpreter in Verilog and run the code with that at that point.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines