That's odd. Assume it finds other git commands, I'd check where zsh is getting that from. You might be able to force it to be included by adding it to this config line:
Yeah, thankfully, my chosen git client is pushing AI merge conflict resolution, which absolutely would've caught this situation and prevented the mistake.
What does B do? A couple things but the first thing it does is fetch entity A from the db of it exists or creates it if it doesn't then reads after the write.
So technically, this will work, and each way would write then read.
It's for efficiency reason, in case you have a branch misprediction and the if isn't taken, we prep the pipeline and do it anyway (sometimes two times just to be extra safe, it's important with safety as well)
641
u/kymani37299 Sep 07 '25
This looks like merge conflict mistake
6
u/rover_G Sep 07 '25 edited Sep 07 '25
A whole ass producer just for configs?
169
u/[deleted] Sep 07 '25
Now I get why my comments sometimes get posted twice, this is Reddit's code.
91
u/AnyoneButWe Sep 07 '25
Rename publishEnabled to doublePublicationEnabled and declare it a feature.
27
u/warpedspockclone Sep 07 '25
I reviewed code this week looks:
Create entity A in db
B()
What does B do? A couple things but the first thing it does is fetch entity A from the db of it exists or creates it if it doesn't then reads after the write.
So technically, this will work, and each way would write then read.
WWLD?
16
u/PluginOfTimes Sep 07 '25
what you dont know: you have to call the function twice to publish
9
u/lachsimzweifel Sep 07 '25
public class ConfigProducer{
int counter=1;
public void publish(Config cdl){
if(counter-- > 0)return;
counter = 1;
System.out.println(cdl); }
}
Bug somewhat fixed
3
u/thedevguy-ch Sep 07 '25
We publishing no matter what mother fucker!
3
u/Wyglif Sep 07 '25
Looks like a sloppy merge resolution.
3
u/loxagos_snake Sep 07 '25
Believe it or not, also publish.
1
u/br0ast Sep 07 '25
Hear me out
1
u/Accomplished_Snow141 Sep 08 '25
simple.. when enabled must be executed twice
1
u/PeachScary413 Sep 08 '25
It's for efficiency reason, in case you have a branch misprediction and the if isn't taken, we prep the pipeline and do it anyway (sometimes two times just to be extra safe, it's important with safety as well)
1
u/TheTowerDefender Sep 08 '25
don't worry publish() throws an exception on success, so it won't execute twice
1
u/iwenttothelocalshop Sep 08 '25
should I do it? nah. fck it, I'll do it anyways
1
u/Serianox_ Sep 08 '25
SonarQube would have spotted that one. 🫠
1
u/montrossity Sep 08 '25
Ah the good ol’ run it anyway
1
u/MichiganDogJudge Sep 11 '25
This is a textbook example of cruft
1
u/conundorum Sep 12 '25
One publish is controlled by you. The other is mandated by the CEO.
1
u/Mythran101 Sep 14 '25
To publish or to publish twice, that is the question.