Fork me on GitHub
#clojure-europe
<
2023-03-07
>
mdiin08:03:34

Good morning

simongray08:03:19

good morning

dharrigan09:03:04

Good Morning!

simongray09:03:49

rebasing with git… I always get confused about who is ours and whos is theirs… anybody else?

💯 2
mccraigmccraig09:03:44

i don't think i've had that confusion ... whenever i rebase i always make sure that i tag/copy the current branch though, so that i can go back and try again when the rebase screws up (because there were merge-commits with changes or similar)

simongray09:03:51

I think I am confused because it switches position when you rebase vs when you merge

simongray09:03:00

so I can never remember which is which :S

Mario Trost09:03:13

Yes! So much this!

🙌 2
mccraigmccraig09:03:04

oh wow - i had never noticed that... tbh i have only used the auto-resolve strategies once or twice ever - i mostly page through conflicts manually with magit

borkdude09:03:21

it's as if ours and theirs always mean the reverse thing you would expect, even if you would take that into account

😁 4
simongray09:03:50

Git's law

😂 6
borkdude09:03:23

Same with ln -s until someone told me it's analogous to cp old new

4
simongray09:03:34

That's a good rule of thumb

rolt10:03:59

vscode uses "current" and "incoming" which kinda feels natural for both merge and rebase. i don't use vscode though 🙃

😂 2
reefersleep11:03:53

I think my mental model is “The stuff that I want to rebase onto is the tree trunk, ‘our base’/`ours`, and the stuff that I want to rebase is the branch, ‘it’/`theirs`“. I even visualise it with a tree and a branch. But I’m unsure if I’m even remembering it right.

dharrigan11:03:15

My aide-memorie is when I do a rebase, I imagine all my commits just flying off into the ether, somewhere in a holding pattern, then the point from when I branched from is brought up to date with whatever I'm rebasing from (normally master), then my commits come into land on top of the rebase afterwards.

simongray13:03:12

you’re thinking of merge

simongray13:03:41

that’s the issue, it is the other way around depending on rebase and merge for no obvious reason 😛

reefersleep13:03:56

I refer to Git’s Law 😛

reefersleep13:03:18

It’s such a shame that the git ux is generally confusing

2
simongray13:03:42

git is a great tool with bad ux, same with the Clojure CLI really 😛

⚒️ 2
🔥 2
ray01:03:28

Stockholm syndrome. Yes Linus is Swedish.

ray01:03:17

Self-blaming energy is strong in this 🧵

ray01:03:58

Unlike others I think git is genuinely terrible

🙌 2
😅 2
simongray08:03:51

Swedish-speaking*, not Swedish

reefersleep08:03:28

what do you prefer instead, @U04V5V0V4 ? Tbh I've tried little else

ray08:03:04

ha - I'm just complaining cos I'm hoping that git is not the end of code version tools

reefersleep08:03:00

I’m finding it hard to imagine that anything else will take the lead within our careers, but of course, there’s always room for improvement 🙂

mccraigmccraig08:03:10

i would think something else would need a model which was much superior to git's ... in the way that git's model is superior to subversion, CVS &c ... aiui git's model wasn't particularly original (following in the footsteps of bitkeeper), although its implementation was, but is there even any newer/different model of revision control which is better than git's ?

ray09:03:00

for me, semantic awareness will be big

dharrigan09:03:17

I think there are a few. I went from mercurial to git (simply because I had to, due to external demands). I really liked mercurial. I think also there is something in "fossil" that is intersting - unlike git - you can never ever rewrite history.

mccraigmccraig09:03:07

i seem to recall using hg once or twice... it's got a very similar model to git doesn't it @U11EL3P9U ?

dharrigan09:03:27

(For a brief stint in my career I even had to use IBM Rational Clearcase - now that was the worse version control system I had ever used - and I've used CVS 🙂 )

😂 2
plus_one 2
dharrigan09:03:06

Yeah, hg and git paradoxially were created at roughly the same time by different people. Git just gained more traction because the author was more famous 🙂

dharrigan09:03:05

I would like to try out fossil more

mccraigmccraig09:03:53

what dyu mean by rewriting history in git @U11EL3P9U? you can write a new history (and point a branch at the new history), but you can't rewrite history - can you ?

dharrigan09:03:17

yah, easily. Any rebase rewrites history (commit hashes change) also nothing stopping you from doing a force push

dharrigan09:03:53

I can check out the codebase, force reset to an eariler part in time, modify some code, force push it

mccraigmccraig09:03:37

rebase creates new commits - it doesn't change any existing commits - and a force-push just changes the branch pointer - all the old commits are still there and can be reverted to

mccraigmccraig09:03:41

but changing the branch-pointer is definitely more "rewrite" like than a merge...

dharrigan09:03:30

Git is ntorious for the ease on which you can rewrite history. There are numerous articles (even on the official scm book) on rewriting git history

dharrigan09:03:13

For example, even if you do a force push and even if you think you can get to it via the prior SHA1, if you force a garbage collection using fsck, then poof gone.

mccraigmccraig09:03:14

true - garbage collection can mess your life up! what does fossil do differently ?

dharrigan09:03:11

Not quite sure of the internals of fossil, but that question I believe is answered here: 2.7 What you should have done vs. What you actually did from the link

mccraigmccraig09:03:41

ah, so - primarily fossil gets rid of rebasing and squashing, which i guess leaves a pure merge-based workflow

dharrigan10:03:31

I would seriously consider switching to fossil for some of my stuff that I do

dharrigan10:03:47

but one thing that I would need to sort out - which github/lab gives you - is a build pipeline.

dharrigan10:03:22

natch, I could cobble something together to perform a pipeline on commits, but I'm too lazy 🙂