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•8mo ago

Comments

johnrob•8mo 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•8mo ago
Oh that’s clever, I’ll try that out. Looks like you could just do a git diff > file.patch.

Neat.

johnrob•8mo 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•8mo 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•8mo 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•8mo 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•8mo 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•8mo ago
That’s a great idea, and very timely for me.
d3ckard•8mo ago
Thank you, will try. Useful bit of knowledge.
OskarS•8mo 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•8mo 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•8mo ago
Generating app passwords for those would work.
pm215•8mo 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•8mo ago
For Gmail, you can use https://github.com/google/gmail-oauth2-tools/tree/master/go/....
mathstuf•8mo 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•8mo ago
davmail supports smtp through outlook(365)
ndegruchy•8mo 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•8mo 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•8mo ago
I use an app password but https://github.com/AdityaGarg8/git-credential-email apparently supports OAuth with Gmail, yahoo and outlook
arthurmorgan123•8mo 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•8mo 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•8mo 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•8mo 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•8mo ago
If you work with git and patches a lot, stgit is worth a look.

https://stacked-git.github.io

johnisgood•8mo ago
At that point, why not just use Pijul or even Darcs?
smcameron•8mo 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/

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
453•xnx•4h ago•273 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
114•vecti•1h ago•47 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
47•i5heu•2h ago•37 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
230•aktau•6h ago•120 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
207•ostacke•5h ago•48 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
40•eljojo•2h ago•24 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
78•limoce•3d ago•27 comments

I spent 5 years in DevOps – Solutions engineering gave me what I was missing

https://infisical.com/blog/devops-to-solutions-engineering
25•vmatsiiako•4h ago•3 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
171•surprisetalk•3d ago•22 comments

I now assume that all ads on Apple news are scams

https://kirkville.com/i-now-assume-that-all-ads-on-apple-news-are-scams/
832•cdrnsf•8h ago•364 comments

Masked namespace vulnerability in Temporal

https://depthfirst.com/post/the-masked-namespace-vulnerability-in-temporal-cve-2025-14986
8•bmit•1h ago•0 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
135•lstoll•5h ago•106 comments

Show HN: Smooth CLI – Token-efficient browser for AI agents

https://docs.smooth.sh/cli/overview
49•antves•1d ago•45 comments

Planetary Roller Screws

https://www.humanityslastmachine.com/#planetary-roller-screws
10•everlier•3d ago•1 comments

Show HN: BioTradingArena – Benchmark for LLMs to predict biotech stock movements

https://www.biotradingarena.com/hn
9•dchu17•4h ago•1 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
286•todsacerdoti•7h ago•168 comments

Claude Composer

https://www.josh.ing/blog/claude-composer
4•coloneltcb•2d ago•0 comments

A new bill in New York would require disclaimers on AI-generated news content

https://www.niemanlab.org/2026/02/a-new-bill-in-new-york-would-require-disclaimers-on-ai-generate...
469•giuliomagnifico•11h ago•186 comments

Things Unix can do atomically (2010)

https://rcrowley.org/2010/01/06/things-unix-can-do-atomically.html
234•onurkanbkrc•15h ago•88 comments

The Monad Called Free

http://blog.sigfpe.com/2014/04/the-monad-called-free.html
48•romes•4d ago•24 comments

Invention of DNA "page numbers" opens up possibilities for the bioeconomy

https://www.caltech.edu/about/news/invention-dna-page-numbers-synthesis-kaihang-wang
129•dagurp•10h ago•84 comments

TikTok's 'addictive design' found to be illegal in Europe

https://www.nytimes.com/2026/02/06/business/tiktok-addictive-design-europe.html
532•thm•9h ago•399 comments

Systems Thinking

http://theprogrammersparadox.blogspot.com/2026/02/systems-thinking.html
245•r4um•15h ago•112 comments

DNS Explained – How Domain Names Get Resolved

https://www.bhusalmanish.com.np/blog/posts/dns-explained.html
119•okchildhood•3d ago•39 comments

Fraud investigation is believing your lying eyes

https://www.bitsaboutmoney.com/archive/fraud-investigation/
99•dangrossman•3h ago•116 comments

LLMs could be, but shouldn't be compilers

https://alperenkeles.com/posts/llms-could-be-but-shouldnt-be-compilers/
103•alpaylan•7h ago•111 comments

NIMBYs aren't just shutting down housing

https://inpractice.yimbyaction.org/p/nimbys-arent-just-shutting-down-housing
98•toomuchtodo•5h ago•205 comments

Product and design are the new bottlenecks

https://www.jampa.dev/p/the-rise-of-one-pizza-engineering
53•jampa•4d ago•62 comments

Claude Opus 4.6

https://www.anthropic.com/news/claude-opus-4-6
2244•HellsMaddy•1d ago•968 comments

Stay Away from My Trash

https://tldraw.dev/blog/stay-away-from-my-trash
154•EvgeniyZh•3d ago•64 comments