frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Working with Git Patches in Apple Mail (2023)

https://btxx.org/posts/mail/
50•todsacerdoti•4mo ago

Comments

johnrob•4mo ago
Once I discovered how git apply can take diff files (or patch files) as input, I stopped using git stash in favor of plain old files. Easier to list and browse the contents of prior edits, also you can grep the files as method of search. I’ve even found myself copying and editing the diffs before applying.
barbazoo•4mo ago
Oh that’s clever, I’ll try that out. Looks like you could just do a git diff > file.patch.

Neat.

johnrob•4mo ago
You’ll also want to familiarize with “git apply -3 <file name>”, for when a diff can’t be applied cleanly. It will try “harder” to merge (three way method) and if it still fails it invokes the conflict merge “UX”:

<<<<<<<<<

=========

>>>>>>>>>

smcameron•4mo ago
There's also Neil Brown's "wiggle" program for applying patches that don't apply.

https://github.com/neilbrown/wiggle

although on debian based systems I think you can just "apt install wiggle"

johnisgood•4mo ago
What does "applying patches that don't apply" mean exactly?

I know about wiggle, but I have not used it, to be honest.

smcameron•4mo ago
It means that if you do "patch -p1 --dry-run < some.patch", and it complains that it doesn't apply, wiggle can sometimes apply it anyway, and also, if you do "patch -p1 < some.patch", and it partially applies but with rejected hunks, wiggle can try to apply the rejected hunks.
johannes1234321•4mo ago
git diff an pipe works, but committing and then `git format-patch` can export multiple patches and then includes metadata (commit message, date, author, etc.) which can make reasoning about such files a lot easier. In a plain diff you only got filename as metadata.
RaoulP•4mo ago
That’s a great idea, and very timely for me.
d3ckard•4mo ago
Thank you, will try. Useful bit of knowledge.
OskarS•4mo ago
That is a very neat trick, I agree.

I personally approaches stashes as undoable "clean up", and I never have anything really important that I want to save there. If I do have something like that, I just commit with a "WIP <some-descriptive-string>" message and don't push it, then a "git reset --mixed HEAD^" when I want to get back to it.

However, just FYI: you can "grep" your stashes really easily if you want to. just "git stash list -p" gives you the diffs for all the stashes, by default in "less" where you can search them, but you can pipe it to grep if you want. I somewhat frequently do that with "git log", if I want to know "when did this variable change?" or whatever, just "git log -p" to get the log with diffs in less, then search for whatever it was with a slash.

teeray•4mo ago
Maybe slightly O/T, but has anyone found a decent way to `git send-email` with email hosts that demand OAuth? (looking at you Outlook and Gmail)
ravetcofx•4mo ago
Generating app passwords for those would work.
pm215•4mo ago
Yeah, I use an app specific password with Gmail, like the setup suggested by https://git-send-email.io/#step-2

Exchange historically had a tendency to mangle emails sent through it (whitespace changes, line wrap, etc), which is obviously bad news for patchmails. I dunno if it's any better these days.

computerfriend•4mo ago
For Gmail, you can use https://github.com/google/gmail-oauth2-tools/tree/master/go/....
mathstuf•4mo ago
I use msmtp with a tool from the oauth2-tools repo to do the rotation token dance. Need to register your own app with Google though.
dmarinus•4mo ago
davmail supports smtp through outlook(365)
ndegruchy•4mo ago
Yeah, I used DAVMail with Emacs+MSMTP+MPOP+notmuch for ages. Works really well, the only occasional thing I had to do was reauthenticate the token, which pops up in a browser window.
ozarker•4mo ago
I think you could set up postfix to smtp forward to those services. So it could handle the oauth2 and you wouldn’t need to configure your client
p_wood•4mo ago
I use an app password but https://github.com/AdityaGarg8/git-credential-email apparently supports OAuth with Gmail, yahoo and outlook
arthurmorgan123•4mo ago
I tried this with Gmail and Outlook. Works flawlessly and also doesn't need to authenticate frequently. The Authen::SASL thing was a catch though.

git-send-email also has some quirks for Outlook which have been recently merged.

palata•4mo ago
I like doing it with aerc [1]. It's even possible to use aerc in parallel to another email client. Just open aerc for git-related emails, and that's it!

[1]: https://drewdevault.com/2022/07/25/Code-review-with-aerc.htm...

kazinator•4mo ago
View the e-mail raw in your browser, select all, copy, paste into git apply.

Then you don't need that message to be in a file-based inbox that is accessible from your git repo.

And in that case you are still likely going to have to copy and paste something to get the correct path.

sircastor•4mo ago
It looks like Apple Mail has plugin support, I wonder if you could author a plugin that’d provide a button to apply the diff.
smcameron•4mo ago
If you work with git and patches a lot, stgit is worth a look.

https://stacked-git.github.io

johnisgood•4mo ago
At that point, why not just use Pijul or even Darcs?
smcameron•4mo ago
Because the codebase you're working on is on github?

And I think you may underestimate the power of stgit. You can manage thousands of patches concurrently, no problem. If you're a maintainer getting patches from loads of people all the time, this is valuable. stgit has it's origins in quilt, which in turn has its origins in Andrew Morton's patch scripts[1], and I know for a fact that Andrew Morton actually managed thousands of patches at a time for years in his work on the linux kernel, because I once sent him a patch against those scripts, and he complained it was slow because I used an O(n^2) algorithm, which worked fine with a handful of patches, and I asked him how many patches he had, and he told me a number that was multiple thousands, so this isn't a hypothetical example.

[1] https://lwn.net/Articles/13518/

Don’t Look Up: Sensitive internal links in the clear on GEO satellites [pdf]

https://satcom.sysnet.ucsd.edu/docs/dontlookup_ccs25_fullpaper.pdf
179•dweekly•4h ago•47 comments

Copy-and-Patch: A Copy-and-Patch Tutorial

https://transactional.blog/copy-and-patch/tutorial
19•todsacerdoti•1h ago•3 comments

NanoChat – The best ChatGPT that $100 can buy

https://github.com/karpathy/nanochat
1051•huseyinkeles•15h ago•208 comments

Palisades Fire suspect's ChatGPT history to be used as evidence

https://www.rollingstone.com/culture/culture-news/chatgpt-palisades-fire-suspect-1235443216/
82•quuxplusone•5d ago•57 comments

Dutch government takes control of Chinese-owned chipmaker Nexperia

https://www.cnbc.com/2025/10/13/dutch-government-takes-control-of-chinese-owned-chipmaker-nexperi...
398•piskov•20h ago•318 comments

Sony PlayStation 2 fixing frenzy

https://retrohax.net/sony-playstation-2-fixing-frenzy/
103•ibobev•7h ago•37 comments

No science, no startups: The innovation engine we're switching off

https://steveblank.com/2025/10/13/no-science-no-startups-the-unseen-engine-were-switching-off/
408•chmaynard•17h ago•316 comments

vali, a C library for Varlink

https://emersion.fr/blog/2025/announcing-vali/
20•GalaxySnail•3d ago•4 comments

First device based on 'optical thermodynamics' can route light without switches

https://phys.org/news/2025-10-device-based-optical-thermodynamics-route.html
129•rbanffy•5d ago•16 comments

Show HN: SQLite Online – 11 years of solo development, 11K daily users

https://sqliteonline.com/
373•sqliteonline•17h ago•123 comments

Modern iOS Security Features – A Deep Dive into SPTM, TXM, and Exclaves

https://arxiv.org/abs/2510.09272
151•todsacerdoti•12h ago•3 comments

New York Times, AP, Newsmax and others say they won't sign new Pentagon rules

https://apnews.com/article/pentagon-press-access-defense-department-rules-95878bce05096912887701e...
114•baobun•3h ago•24 comments

DDoS Botnet Aisuru Blankets US ISPs in Record DDoS

https://krebsonsecurity.com/2025/10/ddos-botnet-aisuru-blankets-us-isps-in-record-ddos/
106•JumpCrisscross•7h ago•85 comments

America is getting an AI gold rush instead of a factory boom

https://www.washingtonpost.com/business/2025/10/13/manufacturing-artificial-intelligence/
165•voxleone•15h ago•169 comments

LLMs are getting better at character-level text manipulation

https://blog.burkert.me/posts/llm_evolution_character_manipulation/
76•curioussquirrel•10h ago•45 comments

JIT: So you want to be faster than an interpreter on modern CPUs

https://www.pinaraf.info/2025/10/jit-so-you-want-to-be-faster-than-an-interpreter-on-modern-cpus/
111•pinaraf•1d ago•23 comments

Smartphones and being present

https://herman.bearblog.dev/being-present/
235•articsputnik•16h ago•158 comments

Passt – Plug a Simple Socket Transport

https://passt.top/passt/about/
13•zdw•1w ago•1 comments

Why did containers happen?

https://buttondown.com/justincormack/archive/ignore-previous-directions-8-devopsdays/
98•todsacerdoti•18h ago•112 comments

A series of debugging sessions for Strimzi

https://github.com/fvaleri/strimzi-debugging
3•fvaleri•4d ago•0 comments

Strudel REPL – a music live coding environment living in the browser

https://strudel.cc
136•birdculture•11h ago•25 comments

NVIDIA DGX Spark In-Depth Review: A New Standard for Local AI Inference

https://lmsys.org/blog/2025-10-13-nvidia-dgx-spark/
19•yvbbrjdr•5h ago•13 comments

Show HN: AI toy I worked on is in stores

https://www.walmart.com/ip/SANTA-SMAGICAL-PHONE/16364964771
118•Sean-Der•1d ago•113 comments

StreamingVLM: Real-Time Understanding for Infinite Video Streams

https://arxiv.org/abs/2510.09608
22•badmonster•6h ago•0 comments

America's future could hinge on whether AI slightly disappoints

https://www.noahpinion.blog/p/americas-future-could-hinge-on-whether
105•jxmorris12•13h ago•100 comments

JSON River – Parse JSON incrementally as it streams in

https://github.com/rictic/jsonriver
174•rickcarlino•5d ago•80 comments

Scaling request logging with ClickHouse, Kafka, and Vector

https://www.geocod.io/code-and-coordinates/2025-10-02-from-millions-to-billions/
123•mjwhansen•5d ago•18 comments

Abstraction, not syntax

https://ruudvanasseldonk.com/2025/abstraction-not-syntax
79•unripe_syntax•21h ago•44 comments

Optery (YC W22) – Hiring Tech Lead with Node.js Experience (U.S. & Latin America)

https://www.optery.com/careers/
1•beyondd•13h ago

Software update bricks some Jeep 4xe hybrids over the weekend

https://arstechnica.com/cars/2025/10/software-update-bricks-some-jeep-4xe-hybrids-over-the-weekend/
370•gloxkiqcza•16h ago•254 comments