Linus Torvalds Is Sick Of Useless Git Merges
Key Takeaways
Linus Torvalds discusses his frustration with useless Git merges in the Linux kernel, emphasizing the importance of good commit messages and proper Git usage, including rebasing to simplify merge commits. He expects developers to use Git effectively and follow clear guidelines for development and merging.
Full Transcript
do you know what time it is it is time once again for a quarterly lioness 12 volt rant and as is generally the case it's about holding the Linux kernel up to really high development standards when we see the kernel from the outside whether that's as a desktop user a server user or anything else out there we see the result of that development we see 6.0 6.1 6.2 and anything else out into the future but when you're dealing with thousands upon thousands of commits every single release certain practices need to be followed to ensure things go over in a relatively smooth fashion and maintainers retain their sanity one such practice is how you handle mergers so recently there was a kernel patch set ready to merge by a developer called keys cook hi Linus please pull these hardening updates for 6.3 rc1 Beyond some specific load pin ubisan and fortify features there are blah blah blah doesn't really matter the specifics aren't too important the important part is how the commits were handled now overall it was mostly all well and good with the exception of a couple of these commits so I've pulled this but while looking at it I see Commit This string merge Branch for Linus hardening into four next slash hardening and that one line of short log part is literally the whole commit message I've said this before and apparently I need to say this again if you cannot be bothered to explain why a merge exists then that merge is buggy garbage by definition when we are talking about a project on the scale of the Linux kernel lack of documentation in and of itself is a bug we are not talking about some you know 500 line 10 terminal app where if there's something wrong with it you can read the entire code base in like 10 15 minutes maybe 20 minutes if you're a bit slow we're not talking about a couple thousand Lane application which probably should be documented but you can work around it not being so we are talking about a project that has millions of lines of code with thousands of lines being changed every single update if there ever happens to be a problem commit and that commit needs to be reverted which does happen from time to time it's incredibly useful to have that commit documented with both a short log message that explains what is being done and if relevant a longer description for those bigger commits that might need them now obviously if you're averting a commit you should be reading the code to find out exactly what it's doing so you know like what problem it was actually causing it and how you might go on address asset however having a good description there gives you a better idea of what you're looking at without having to First go and examine the code this really should be a rule that every single developer should take to heart I'm not just putting random words together in a random order now obviously that's an exaggeration that's hyperbole this isn't random words in a random order if you've ever used git before if you've ever used remotes like GitHub and gitlab you've probably seen commits like this plenty of times what is being done is merging the work from one branch into another Branch this is a totally normal function and for most repos is a totally normal way to name the commit but why are you merging work from one branch into another Branch all this says is the work is being merged but for what purpose what is it doing what is it adding was there any other way you could do it why is it named like this I repeat if you cannot explain a merge then just don't do it it's really that simple there is absolutely never an excuse for mergers without explaining why those merges exist in this case I really think that merge should not have existed at all and the lack of explanation is because there is no explanation for it but if there was a reason for it then just state it and make that merge commit look sensible because right now it just looks entirely pointless and I literally detest pointless mergers they only make the history look worse and harder to read now unless you're developing everything on a single Branch or before you send the code up to the kernel you throw everything away and rebuild a very clean commit log obviously you're going to have mergers inside of your development firstly name those merge as well so people know why they exist and what they're actually doing secondly you don't need to leave traces of a merge behind what you can do instead is have a read of the get documentation and you'll find things like rebase this will basically take the commits from one branch and stick them on another and this even lets you take multiple commits that don't need to be separate at all and then squash them down into fewer commits overall and there are a lot of videos out there a lot of guides on how to do exactly this and how to generally effectively use git and seeing as though lioness is the one who made git he expects that everybody involved in his project is using it in an effective way as well and one of those ways is handling merge commits in a sensible way this Dev was definitely not looking to start a fight with Linus 12 volts and said this in response once okay understood this was a merge of the fixes for 6.2 I'll explain that more clearly in the log from now on this would still be a better message than what was there but is still a fairly surface level description either way he says he's going to explain it better in the future totally fair now Linus also did continue he's used this as a platform to basically further explain with a lot to go on here uh why this is such a big deal if you want to go check out the full thing for yourself but we're just gonna skim over it for example one reason why people do these kinds of mergers as in the merge he's complaining about is because they are starting to do some new development for the next release and that new development then depends on fixes or infrastructure that they had in another Branch like a four Linus branch in case of fixes so then they mindlessly just do a git merge on that branch and the end result looks very much like what you sent me in a slightly better World they then actually write an explanatory commit message for that merge knowing that I ask for them and the merge commit message ends up being exactly that kind of slightly odd now I'm starting a new thing that depends on the fixes I already Upstream so I'm merging that branch which while certainly better than no explanation at all sounds a bit odd doesn't it yeah add a few details on just what you depend on and why and it gets much better but it's all going to be a bit of hand wavy about future work that you haven't even written yet and that will then maybe make you then go ah I'm doing things wrong because the nice Gateway through that kind of thing is to actually realize oh I'm starting new work that depends on the fixes I already sent Upstream so I should just make a new topic branch and start at that point that I needed and then once you've done all the new work that depend on that state only at that point do you merge the topic Branch instead of having to Waffle about future work depends on this feature there was in another Branch so I'm merging this Branch your merge commit now makes sense you're not merging some old state in order to create new features you are literally just merging the completed feature and the most important takeaway for why liners care so much is this because we have a very real history where people did mindlessly daily back mergers like this just because with absolutely no Rhyme or Reason Just because they want to start each day with the most recent bass and it really gets very ugly the development history can go from a dag that actually visualizes the different development streams nicely to a spider nest Maze of inexplicable mergers very quickly lioness is very proud of the fact that the Linux kernel has very clear guidelines and developers are expected to follow them he said in the past how he's really happy that the Linux kernel is basically the gold standard of how to run a fast project how to run git how to actually do development in this fashion in a really productive and effective way but what do you think do you think Linus cares too much do you think the way that most git reapers are run is totally fine it works for a small project so it's probably going to work on a large scale as well I would love to know your thoughts so if you liked the video remember to go and like the video and if you really like the video and you want to become one of these amazing people over here go check out my patreon Scrabble linked down below that's gonna be it for me and [Applause] [Music] thank you [Music]
Original Description
It's time once a again for a Linus Torvalds rant, this time he's annoyed with the way that people have been handling merges cluttering up the git history of the Linux kernel
==========Support The Channel==========
► $100 Linode Credit: https://brodierobertson.xyz/linode
► Patreon: https://brodierobertson.xyz/patreon
► Paypal: https://brodierobertson.xyz/paypal
► Liberapay: https://brodierobertson.xyz/liberapay
► Amazon USA: https://brodierobertson.xyz/amazonusa
==========Resources==========
Phoronix Article: https://www.phoronix.com/news/Linus-Torvalds-Git-Merge-Wisdom
Mailing List: https://lore.kernel.org/lkml/63efd7ab.170a0220.3442b.6609@mx.google.com/
Git Rebase: https://git-scm.com/docs/git-rebase
=========Video Platforms==========
🎥 Odysee: https://brodierobertson.xyz/odysee
🎥 Podcast: https://techovertea.xyz/youtube
🎮 Gaming: https://brodierobertson.xyz/gaming
==========Social Media==========
🎤 Discord: https://brodierobertson.xyz/discord
🎤 Matrix Space: https://brodierobertson.xyz/matrix
🐦 Twitter: https://brodierobertson.xyz/twitter
🌐 Mastodon: https://brodierobertson.xyz/mastodon
🖥️ GitHub: https://brodierobertson.xyz/github
==========Credits==========
🎨 Channel Art:
Profile Picture:
https://www.instagram.com/supercozman_draws/
🎵 Ending music
Music from https://filmmusic.io
"Basic Implosion" by Kevin MacLeod (https://incompetech.com)
License: CC BY (http://creativecommons.org/licenses/by/4.0/)
#Git #LinusTorvalds #Linux #OpenSource #FOSS
DISCLOSURE: Wherever possible I use referral links, which means if you click one of the links in this video or description and make a purchase I may receive a small commission or other compensation.
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Brodie Robertson · Brodie Robertson · 22 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
▶
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This Linux Patch Removes Spectre & Meltdown Protections
Brodie Robertson
Linux's Most Degenerate Terminal Application
Brodie Robertson
You Can Buy Modern Linux Distros On A DVD??
Brodie Robertson
Bypass Paywalls Vanishes From Firefox Addon Store
Brodie Robertson
CoreJS: The Web & Open Source Are Broken!
Brodie Robertson
Begone GTK4, Long Live The New King GTK5
Brodie Robertson
Flathub Finally Adds Much Needed Flatpak Feature
Brodie Robertson
Google Should Be Worried About ChatGPT Bing
Brodie Robertson
How To Never Improve The Linux Wayland Experience
Brodie Robertson
Fedora Linux Unveils New 5 Year Roadmap
Brodie Robertson
Linux Desktop Randomly Stuttering? Here's Why #shorts
Brodie Robertson
Why We Need Even More Linux Distros!?!
Brodie Robertson
This Wayland Change Will Improve Linux Forever
Brodie Robertson
Ubuntu Linux Was Once Spyware Says EFF & Stallman
Brodie Robertson
Rise Of A New Kind Of Linux Package Manager
Brodie Robertson
Rolling Release Linux Distro Probably Isn't For You
Brodie Robertson
Ubuntu Flavors Put An End To Shipping Flatpak
Brodie Robertson
WINE Will Finally Run On Wayland NATIVELY!!
Brodie Robertson
No ZDNET, Linux 6.2 WILL NOT Run On M1 Macs
Brodie Robertson
Ubuntu Linux Announces New Kind Of Mini ISO??
Brodie Robertson
Fedora Linux Finally Kills Off Delta RPM
Brodie Robertson
Linus Torvalds Is Sick Of Useless Git Merges
Brodie Robertson
Arch Linux Bricks Dual Boot With One Kernel Change
Brodie Robertson
Linux AppImage Finally Addresses Greatest Flaw!!
Brodie Robertson
Refusing To Use Windows For "Religious Reasons"
Brodie Robertson
GNOME Shell & Mutter Finally Drop GTK3!!
Brodie Robertson
11 Documents Showing Microsoft Tried To Destroy Linux
Brodie Robertson
Manjaro Linux Is The Joke That Never Ends
Brodie Robertson
The New Ubuntu Linux "Flavor" We All Expected
Brodie Robertson
NEVER Write Git Commit Messages With ChatGPT
Brodie Robertson
Why GNOME? Why Didn't KDE Takeover Linux?!?
Brodie Robertson
Discord Tried To END This Reverse Engineered Server
Brodie Robertson
Mesa 23 Makes Linux Shader Stuttering A Thing Of The Past
Brodie Robertson
Linux Kernel Broke A Feature NOBODY Uses!
Brodie Robertson
Manjaro Broke Asahi Linux... AGAIN!!!
Brodie Robertson
Linux Hasn't Become Complicated & Limiting | Distrotube Reply
Brodie Robertson
Ubuntu Linux's Steam Snap Is Almost Stable
Brodie Robertson
Wayland Is Linux's Future, But Why Do I Care?
Brodie Robertson
John Deere Refuses To Respect Free Software & GPL
Brodie Robertson
Why BSD Documentation Is Just Better Than Linux
Brodie Robertson
KDE Fixes Discord On Wayland Because Discord Can't
Brodie Robertson
Xorg Foundation Has A Serious Problem
Brodie Robertson
Manjaro Linux's Biggest Drama That Never Happened
Brodie Robertson
I'm Leaving Arch Linux For A Better Distro!!
Brodie Robertson
Red Hat Linux Once Featured A REDNECK Translation
Brodie Robertson
Android Authority Doesn't Understand Linux or Android
Brodie Robertson
Switching To Wayland: Why I'm Daily Driving Hyprland
Brodie Robertson
Private Security Patching Is A Nightmare In Open Source
Brodie Robertson
Xorg Vs Wayland Is Just A Technical Detail
Brodie Robertson
Why Did Fedora Linux Drop Its Wacky Release Names?
Brodie Robertson
KDE App Theming On Other Desktops Is A Mess
Brodie Robertson
Xenocara: That X11 Server That Isn't Xorg
Brodie Robertson
PopOS New COSMIC Desktop Has Me Excited Again!
Brodie Robertson
Hilarious GNOME Archive Bug Finally Gets Addressed
Brodie Robertson
Rust Foundation Has A Serious Trademark Problem
Brodie Robertson
Top 5 Best Hyprland Linux Features
Brodie Robertson
Installing Linux Software Is More Confusing Than Ever
Brodie Robertson
Clipboard: Simple Unified Linux Clipping Tool
Brodie Robertson
Solus Linux Returns From The Distro Afterlife
Brodie Robertson
uBlue Linux: Immutable Fedora With Batteries Included
Brodie Robertson
More on: LLM Foundations
View skill →Related Reads
📰
📰
📰
📰
If you use Google, you’re training its AI. Here’s how to opt out.
TechCrunch AI
Broadcom extends its Apple chip work through 2031 in a fresh custom-silicon deal
The Next Web AI
How Nations Are Deploying AI for Strategic Priorities
NVIDIA AI Blog
There Are Three Levels of Using AI. Most People Are Stuck on Level One.
Medium · AI
🎓
Tutor Explanation
DeepCamp AI