Fork me on GitHub
#clojure-europe
<
2020-11-02
>
dharrigan06:11:45

Good Morning!

plexus07:11:31

Good morning!

pez07:11:37

Good morning! I am sooo tired. Worked late with https://github.com/BetterThanTomorrow/calva/pull/838, and then was so up to speed I couldn't fall asleep until 3AM-ish. Generating test data doesn't work as well as counting sheep, obviously. 😃

💀 3
dominicm07:11:36

How do you work after doing that? I'm always so tired when I do that.

pez07:11:50

Usually not a problem for me. I accumulate sleep debt and then pay it in one long 16h+ sleep or so. While reading for my kids, for example. ”Dad? You are reading gibberish.” Haha.

maleghast09:11:10

Morning All 🙂

borkdude09:11:44

Hello Clojure friends, good morning

orestis11:11:32

Good morning from rainy Copenhagen

borkdude11:11:26

Anyone familiar with emacs/elisp/flycheck?

simongray11:11:41

Another good morning from Copenhagen here.

👋 3
borkdude11:11:58

Never mind, I think I got it

simongray11:11:19

So I just got a 25k line PR of around a hundred changed or added files - and no PR description. How do I teach my clueless coworker to stop doing this?

borkdude11:11:41

Shock therapy?

😅 3
dharrigan11:11:43

reject the PR?

simongray11:11:38

I did, but I also want to teach him that's it's bad... He's a linguist trying to upgrade his skills so he doesn't really get it. We lack a shared language (kind of ironic).

simongray11:11:28

I need some kind of github prs for dummies article

ordnungswidrig11:11:49

G̴̝̈́ủ̷̢͚͍̽͛̓̉̃̈́̉̈͜͝t̷̩̲͕̳̯͇͆̃̈́̆̀̃͝ë̶̡͓̠̺̙́͑n̴͕͉̖̗̼͙̹̫̺̔ͅ ̴̟̳̈́̑́̈̉́̚m̵̳̆̍̍͂̿̑̉̍͝ǒ̷̡̨̨̪̬̯̦r̵̨͉̖͚͊́͆̏̃͋͘͜͠ģ̶̬̫̖̤͓̦̦̬̓͗̀̍́̄̚͝ȩ̶̡͍͙̗̞͔̞́̃͋͂͆͌͗̄͒͜͠ñ̴̦̩͙͎̯͎̟̌̽͋̀̒̎͠!̸̹͛̋̾̽͂

ordnungswidrig11:11:30

@simongray point him to the confluence page 🙂

borkdude11:11:56

@simongray Don't accept PRs, only patches through JIRA, Clojure style :P

borkdude11:11:48

with strict demands on formatting of whitespace of course

simongray11:11:32

@ordnungswidrig I don't work at UFST anymore, which is great for my sanity in many ways 😄

ordnungswidrig11:11:12

I expected every project large enough that you can have a 25k LOC PR to have at least something like confluence 😛

simongray11:11:32

Haha. The project is just me - and then this guy who really wants to contribute stuff to it. Much of the code in the PR is copy-pasted from existing files and also includes some datasets, so it's not like he wrote 25k lines of code himself.

simongray12:11:33

what’s going on there?

borkdude12:11:08

accidentally pushed some local java file

simongray12:11:28

ah… and they didn’t revert…?

borkdude12:11:55

not yet I guess

mpenet11:11:43

PRs are better gatekeepers than email I guess

borkdude11:11:44

yeah, I saw that ;)

ordnungswidrig11:11:51

One important thing is to make people read to repository history, IMHO. That often opens their eyes on how much of a mess it can be.

borkdude11:11:33

@mpenet btw I did some worrying and writing about http clients and servers, graalvm and babashka here: https://github.com/borkdude/babashka/issues/628. Looking forward to your Java 11 wrapper.

ordnungswidrig11:11:36

• fix • try again • change fumble • Make foo actually to bar • Make fumble do bar • Merge master into this-branch • Fix test • Merge master into this-branch • Make it deployable

ordnungswidrig11:11:08

I’m so fed up with these kinds of repositories ^^^^ 😉

mpenet11:11:19

@borkdude I need to document it, and add more tests really. If I can I ll try to get it done this week (we're crunching on stg else right now)

borkdude11:11:51

@ordnungswidrig That's usually how my repositories start (experimental). Once they mature I prepend every commit message with an issue number, so everything has a rationale

ordnungswidrig11:11:32

Yes! And squash things down a little before mergeing. The problem is that developers never are taught git but only github.

borkdude11:11:46

github does a great job of squashing PRs btw

mpenet11:11:52

pr squasing should be the default imho

3
borkdude11:11:12

git merge --squash is also nice if you want to do it locally

mpenet11:11:12

it's good to have a detailed track for reviews, but then later on nobody cares you changed a typo in a docstring

borkdude11:11:52

yeah, for PRs I discourage using force-push. Nothing is more irritating than trying someones code locally and not being able to pull in changes

borkdude11:11:05

and once they are done, I squash

ordnungswidrig11:11:39

I think for huge PRs like the one mentioned by Simon you want to do selective sqashing.

borkdude11:11:54

Btw, it's weirdly warm here for november. Can't help thinking this is because of climate change...

simongray11:11:12

I also asked him to squash it, but he insists it can't be done :face_with_rolling_eyes:

borkdude11:11:15

git checkout -b pr-squashed
git merge pr-branch --squash
git commit -am "the squashed PR" 

ordnungswidrig11:11:22

@simongray you can work together on a branch. Maybe show him what you mean.

simongray12:11:40

yeah, I guess I will have to… I did already show him once before, though.

dominicm12:11:57

Force pushing in response to feedback is great. Github's review system isn't good.

javahippie12:11:37

@simongray abolish Pull Requests altogether 😬

simongray12:11:11

the nuclear option

borkdude12:11:20

@dominicm as always, it depends on how you collaborate. I generally find it annoying in OSS projects

dominicm12:11:20

I'm experimenting with http://sr.ht atm, I'm strongly considering switching to mailing lists. I presume I'll get the same # of contributions 😛

😆 6
mpenet15:11:39

Paired with Gerrit it would be quite decent

javahippie12:11:37

Aaah had not seen this. Open Source is difficult withour PRs, that’s true

borkdude12:11:04

@dominicm I recently saw this thing: https://tara.ai/ Might be nice to try out

dominicm14:11:12

Looks like task management, rather than change management?

borkdude14:11:52

I forgot you're working for a company which probably has a better product in this realm ;)

dominicm14:11:11

No, we don't do this kind of thing :p

borkdude12:11:45

Hmm, not open source it seems

orestis12:11:27

@simongray Do the review side-by-side with him and think aloud? Or ask him to give you a tour… Writing reviewable PRs is all about thinking about how the other people will read the PR, so he needs to see how it looks like on the other end…

simongray12:11:24

yeah. The issue is more that the PR comes totally out of the blue and he’s quite impatient, wanting to get it merged ASAP. I have tried to explain to him that it often took several days of back-and-forth at my old job to get a ~1000 line PR through the review process, so what am I supposed to do with a 25k line PR. He’s not a developer, though, he’s a linguist who knows just enough Python to be able to do some NLP so all he knows is copy-pasting bits of code around. I don’t have time to teach him to be a software developer.

orestis12:11:51

I’m guilty as charged with the “fix foo” type of commits but for some reason while I know about squash etc it’s hard to make everything work with github. I need to make a new branch, then squash things, then what? Link the old PR with this new branch? How do I link the “dev” branch with the “commit” branch so that people know where to look?

simongray12:11:27

I usually either squash ahead of the review or squash after the review, but before merging. Never need to make a new branch. I just force push to my feature branch and the PR is updated with the correct commits. Then I merge.

simongray12:11:26

As long you follow the golden rule of rebasing that’s enough process IMO.

orestis13:11:03

I thought force pushing is discouraged in git? I learned git before github and PR was a thing so I’m kind of out the loop these days 🙂

simongray13:11:06

force pushing is fine if you know what you’re doing. You just shouldn’t be doing it EVER with any shared branches, i.e. master.

ordnungswidrig13:11:00

I force-with-lease push a lot.

borkdude12:11:34

btw, you can download a .patch file for a PR and review it locally using your favorite tools (emacs)

borkdude12:11:18

e.g. this is an open PR in clj-kondo. Just add .patch to the PR link and you'll get the patch: https://patch-diff.githubusercontent.com/raw/borkdude/clj-kondo/pull/879.patch

simongray13:11:39

I accepted his PR because none of the files touch my own code, but asked him at the very least to squash his commits… he said “yessir”, but 5 minutes later all of the commits are in master 😡 no more lenience from me…

ordnungswidrig13:11:34

aaah that’s hostile

simongray13:11:00

I’ll be nice to him…

genRaiy14:11:13

since git is a haha social haha coding tool, can we get him on here and throw emoji tomatoes either at you or him?

simongray15:11:43

*dodges tomatoes*

🍅 3
genRaiy21:11:36

direct hit 🙂

genRaiy14:11:07

feels like this is probably the most direct way I can help 🙂

ordnungswidrig15:11:55

Takling of social, I had created a weird tool to convert a sha256 into easy to recognize words:

$ git rev-parse HEAD | xargs java -jar sha-words.jar
observation-obedient-bedroom-sweet-electric
Get it at https://github.com/ordnungswidrig/sha-words

ordnungswidrig15:11:12

I should actually port this to babashka

pez15:11:24

That’s awesome. I’ve been wanting to do something similar with uuid, and two-way.

borkdude15:11:14

@ordnungswidrig What do you mean port to babashka? It seems it already works with babashka :)

$ bb -cp src -m sha-words.main b67d6eafeae1d5a424a609864fad10665453afa5
packing-yesterday-sugar-cup-awkward

borkdude16:11:20

$ bb -cp src -m sha-words.main --uberjar sha-words.jar
$ bb sha-words.jar b67d6eafeae1d5a424a609864fad10665453afa5
packing-yesterday-sugar-cup-awkward

ordnungswidrig16:11:25

“acking-yesterday-sugar-cup-awkward”

ordnungswidrig16:11:34

I like the weird stream of words it produces

ordnungswidrig16:11:45

nice! I thought I’d need to do someting about IO.

ordnungswidrig16:11:08

@pez should work with uuids, too

ordnungswidrig16:11:15

but two-way it a good idea!

borkdude16:11:42

@ordnungswidrig uberscript:

$ bb -cp src -m sha-words.main --uberscript ~/Dropbox/bin/sha-words.clj

# prepend shebang
$ bb -e '(spit "/Users/borkdude/Dropbox/bin/sha-words.clj" (str "#!/usr/bin/env bb\n\n" (slurp "/Users/borkdude/Dropbox/bin/sha-words.clj")))'
$ chmod +x ~/Dropbox/bin/sha-words.clj

# yay, script now on path!
$ sha-words.clj b67d6eafeae1d5a424a609864fad10665453afa5
packing-yesterday-sugar-cup-awkward

ordnungswidrig16:11:35

@borkdude what am I doing wrong?

$ bb -cp src -m sha-words.main
clojure.lang.ExceptionInfo: Unable to resolve classname: BigInteger

ordnungswidrig16:11:17

babashka v0.0.86

borkdude16:11:24

try upgrading

ordnungswidrig16:11:45

Oh, brew found a stale link in /usr/local/bin

ordnungswidrig16:11:02

Thanks it workds now!

🎉 3
ordnungswidrig22:11:00

And, boom, another project one must maintain 😛

😄 3