722 points · by frankjr · 4y ago · 188 comments
https://github.com/obsproject/obs-studio/pull/5875/commits/8...
provides an excellent example of why commit messages matter. This is more than 1000 lines diff to the build system (and thus potentially very dangerous because of possible supply chain attacks) which has the commit message of
"CI: Update build scripts and Github actions workflow"
Never say what you ware doing (it's obvious this commit is updating build scripts). Say why you are doing it, especially when your commit feels unrelated or at most very tangentially related to the objective of your PR.
DEFINITELY say what you are doing. And then say why.
This blog post is a good description of the most prevalent convention in how to write good and useful messages (e.g. this is what the Linux Kernel does and given the history of git there's some flow down): https://cbea.ms/git-commit/
The key thing that means you should start with what is having a short one-line summary of what you're doing so you can look at a simple log and see which commit you're interested in.
The commit should summarize what IT does, not what YOU did. In ten years, nobody will care who you are or what you did, but they will care what the code does and why.
my personal observation: because writing down „what“ is hard. Writing down „why“ is even harder.
The commit message is lazy, but breaking these into separate commits because of some "also" rule of thumb is just blindly following a rule for the sake of it.
Ruthless interactive rebase is one way to fix that last point, but if you take the final result and squash that into a single changeset, there's a point to be made about that as well.
See also:
https://google.github.io/eng-practices/review/developer/cl-d...
https://microsoft.github.io/code-with-engineering-playbook/c...
My favored github PR template has 3 sections:
- What does this PR do?
- Why is that valuable?
- Link to bug tracker.* Description: (What this does, and why)
* Ref: (Ticket/task link)
* To test: (Specific instructions to make sure things are working as expected)
* To deploy: (What specific servers/services to restart, and operations to perform)
https://github.com/obsproject/obs-studio/pull/5875#issuecomm...
And it looks like they're just going to set the PR to a draft until after 5155 is merged, so it will get cleaned up and be easier to review then:
https://github.com/obsproject/obs-studio/pull/5875#issuecomm...
HN is usually better about sussing out the real story.
Trying to understand the changes and their full implications is nearly impossible. 100 loc is a better top end imho.
When people start doing multiple things in a single commit with 1000's of changes, it does become mentally exhausting to review. Unfortunately, it requires either being extremely diligent when making the commits or being familiar with git rebase -i.
Of course, sometimes it's just thousands of lines of new code and impossible to review :).
this is why we have line printers, custom reading tables with balanced soft lighting (print proofing lamps) and more recently, rostrum cameras operated by foot switch.
review with fanfold might be a habit only acquired by formative experience, but once you physically manage the printout, and are comfortably seated with several hundred well spaced lines that aren't directly emitting typically exhausting spikey spectrum light forcing your brain to perform extremely complex colour management to balance your vision, which is the primary factor in concentration depletion in every attempt at testing we've tried over the years, and you mix in modern handwriting recognition and a pico projector display of feedback comments if necessary, I have only witnessed very high productivity. Anyone who is subject to audits will know the satisfaction of dumping fanfold boxes on the auditors desk. Or should.
Also HN: no, not like that!
I don't see how adding an additional capture framework backend would require meaningful changes to the build system.
With some likelihood, in this case, Apple probably won't have the resources to rework their PR and thus the PR will stay un-merged until somebody of the project has time to merge/reimplement the relevant parts.
Which of course is a total shame and I wonder why Apple didn't have "mergeability" in mind when they decided to create their PR. They must have known that "rework the build system" can't be part of a PR adding a capture backend if they wanted any chance of this being merged.
[0] https://github.com/obsproject/obs-studio/pull/5155/commits
Aren't Apple the richest corporation in the World, how would they not have resources; am I missing a joke? Maybe you meant 'will choose not to'?
1. The reviewer
2. Someone scanning commit logs for patches of interest
3. Archaeologists
Archaeologists are people a year, five years, 10 years down the road who are trying to figure out how the code got to be the way that it is, so they can feel confident changing it. (See also "Chesterton's Fence"[1].) Those people should not have to dig out the conversation from some random PR to figure out what's going on.
Don’t say what you were doing, say what the commit does. A good commit message completes the sentence “when merged this will …”.
Adding a more detailed description on the second line including why things were done is also not bad, but I have a strong opinion that design notes do not belong in the commit log but in code comments or markdown files that are in the repo, so that they can be found more easily and updated.
The subject describes what is being affected (think easily greppable keywords)
Then, then body should go into detail about the contents and rationale for the changes.
Use specific terms like “add” or “remove” and avoid subjective descriptions like “prepare” “clean” and “fix”
For example this patch says:
> Clean up consistency of tabs/spaces in include_directories.
Well, what does clean up tabs/spaces actually mean? Saying “remove tabs in favor of spaces” is much clearer.
https://user-images.githubusercontent.com/65677710/151421432...
--
(This and 2 other videos are linked in PR conversation tab: https://github.com/obsproject/obs-studio/pull/5875)
It usually comes in two flavors - individual contribution as you doing something on your own time and equipment and official contributions when the company itself contributes to a project.
This looks to be the latter rather than the former so it would make sense it would come from an Apple account.
My understanding is that Apple's policy is highly unusual in that "individual contribution as you doing something on your own time and equipment" are pretty much not allowed at all.
"When Steve came back, one of his company-wide edicts was that the names of individuals must be removed from about boxes."
He also went further than that by illegally colluding with competitors to lower wages for employees. [0] [1]. What a great man.
[0] https://www.businessinsider.com/emails-eric-schmidt-sergey-b...
[1] https://9to5google.com/2012/01/27/court-filings-show-steve-j...
Judging by the Engineering account being used to submit this patch, this is likely to be an example of the latter.
It’s better than bitching about bad support without doing anything. But at the most fundamental of levels it’s really the company working for their customers, through a third party’s project.
I’m perfectly happy to celebrate win-win outcomes.
Well done to who ever it was.
It could also be that someone would rather not be out in public, which is also understandable.
It's open-source software for video recording and live streaming.
So they are mindful of people with old Macs. This is good!
https://github.com/Developer-Ecosystem-Engineering?tab=overv...
https://github.com/obsproject/obs-browser/pull/310
Strangely, a lot of contributions to numpy.
I just so wish to see this sleek and fast app replacing old cranky Xcode on macOS by adding missing features.
I've internalized that there's a difference between the PR description, commit messages, and code comments. For me there's different intended audiences for all three, and their contents should thus be shaped accordingly. This PR basically combines all three into one and uses that as the commit message, and I'm not sure of what to make of it. Is this good practice?
Personally I find the contents of the "#### Summary of Changes" list to be super-neat and helpful. But should these not be more helpful as comments inside the code? On the other hand, it does explain what the code is doing at this snapshot in time: which makes it more precise than comments in the code -- since future changes might eventually make those comments incorrect.
What's your take?
If changes are made to the code, the comments should be updated accordingly. Getting from code to a PR text is a non-obvious and difficult process and when parts of the code are updated, the trail is easily lost.
Seems like a money YouTuber, I've never watched him myself.
EDIT: ...and another one... https://youtu.be/HBXUy5fZNYU?t=890
The branch on GitHub should change its reference until the build system is merged into the main branch.
0: https://github.com/carlosonunez/obs-installer-for-apple-sili...
Natively.
There's an open PR[0], #5155, to get OBS native on Apple Silicon. That's also what your weird fork uses.
Apple's PR is on top of that work: you'll see that there are 10 or so initial commits. Thus #5155 will need to be merged first, before Apple's.
#5155 is a huge PR and has been open for 5 months. Its release will also necessitate OBS get an M1 testing solution figured out. Here's a quote[2] from an OBS team member two days ago:
> [This PR is] top of our priority list once we release 27.2. We're keenly aware of how badly people want a native Apple Silicon build, and I can assure you that we will definitely be publishing official test builds of OBS with M1 support as soon as we are able.
I would nevertheless expect for all of this to take quite a while.
[0] https://github.com/obsproject/obs-studio/pull/5155
[1] https://github.com/obsproject/obs-studio/pull/5155#issuecomm...
Some time later, I tried OBS on Windows, and it just worked, first time, no fiddling required. And I realised the problem was on the Mac side, not Obs.
I know, its just one anecdote.
I couldn't duplicate the OBS issues on older Macs that didn't have the T2 chip.
Blackhole does its job, except your volume buttons stop working when you're on a multi-output device. Quite a pain.
While nice it seems to be a trend where Apple seems to contribute to open source projects now to improve its own performance only on their own devices (blender comes to mind). Maybe Im being a bit cynical.
Still a positive I guess.
You can provide a nice higher-level API (like ScreenCaptureKit) to access such "privileged" capabilities from normal apps, so that arbitrary open-source software (like OBS) can hook into it.
It seems like Apple already made ScreenCaptureKit for their platforms, and wanted to help OBS by hooking it up to ScreenCaptureKit to take advantage of that work.
The alternative, which is to do all the private/privileged stuff directly in OBS, means that Apple would have to give the general ability for arbitrary software to do what ScreenCaptureKit is doing, which may be a security issue (spyware that snoops on what's being displayed on screen comes to mind.) Making something like ScreenCaptureKit as the supported interface to do this kind of thing, can ensure the app triggers the proper permissions dialog/etc so that screen recording doesn't happen without user knowledge.
The point of open source (not just a free binary blob) is that you can fix the parts that matter to you.
In the case of companies, they typically work on the parts that matter to them. This has been true since the free software movement started to reach into businesses, with companies like Cygnus (of course) but also Sun, SGI, IBM etc all working just on their own platforms.
I also got a Linux preinstalled conputer, so I’m hoping (selfishly perhaps) that open source projects have great first rate open source OS support. It seems like open source is always resource strapped.
But you are right it’s not like IBM, SGI, Sun weren’t proprietary..
Make no mistake: for all of these companies, this funding was in support of their commercial activities. They have no desire, say, to write a shell so if one is popular they'll go that way. One thing we taught then in the 90s was that stepping off the mainline simply added to your support cost; this lesson is why so many proprietary companies do contribute back.
Apple's case is interesting: they think more deeply than many about this. Thus they are enthusiastic about standards when they are weak in the domain: e.g. Apple was explicit up to the Jobs level that they embraced open standards like JPEG and MP3 when trying to dig the Mac out of a deep hole; once they had a solid foothold they felt comfortable trying out proprietary formats. They went USB-C (and handed over a majority of the work on its design to the USB consortium, or so a couple of friends who worked on the standard claimed to me) because it helps adoption of the Mac and iPad; but aren't afraid to make a MagSafe connector.
It's all about strength and weakness to Apple, an approach which frankly more companies should adopt (looking at you MediaTek, AllWinner and your competitors).
If Apple, Intel, AMD, NVIDIA, Arm, Qualcomm, etc. would all contribute to open source to make everything work on all their devices with good perf, then that would be very good for all users.
Expecting AMD to make open source contributions to improve software on Apple's hardware or Arm GPUs is "naive", not cynical.
It would be like expecting Tesla to go to VW and help them improve their combustion engines for free.
Many OSS contributions are "scratching your own itch", no?
Are they supposed to contribute the Windows 11 screen cap?
WebKit, LLVM, Swift… these are pretty fundamental open source projects, in addition to a bunch of other stuff.
You can’t please everyone all the time, and society is too addicted to outrage these days.
>One of the first uses of LLVM was an OpenGL code compiler for OS X
The LLVM project originally intended to use GCC's front end.
Apple chose to develop Clang, a new compiler front end that supports C, Objective-C and C++.
https://en.wikipedia.org/wiki/Clang#Background
Here's video of Apple's Chris Lattner giving a tech talk on the Google campus introducing Clang and LLVM 2.0 in 2007:
- #if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15
+ #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500 // __MAC_10_15
ah, yes, clean code> plugins/mac-capture/mac-display-capture.m:621 - The __MAC_10_15 define may not exist on devices running < 10.15, resulting in this section not being appropriately avoided during compilation. Swapping to 101500 should work for all versions of macOS.
#if QT_VERSION > QT_VERSION_CHECK(5, 15, 0)
...
#endif
and works also for Qt 5.1 or Qt 4 or 3 (i think that's when this macro was introduced, pretty much at the same time than os x 10.1 ?)Not even just “potential” in QT’s case, a quick search turned up https://forum.qt.io/topic/31071/moc-and-qt_version_check-bug and https://forum.qt.io/topic/37882/qt-4-8-qt_version_check-and-... as cases where folks have been bit by some tooling in a Qt4 environment not understanding the macro properly.
https://www.steveonstuff.com/2022/01/27/no-such-thing-as-cle...
The article says we need to use more precise words. In this case, the macro can create a bug, so is using the macro "cleaner"?