惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
V
V2EX - 技术
S
Secure Thoughts
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
S
Securelist
S
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
H
Hacker News: Front Page
Microsoft Azure Blog
Microsoft Azure Blog
I
Intezer
Google Online Security Blog
Google Online Security Blog
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
T
The Exploit Database - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Webroot Blog
Webroot Blog
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
P
Proofpoint News Feed
The Cloudflare Blog
I
InfoQ
L
LangChain Blog
U
Unit 42
P
Proofpoint News Feed
S
Schneier on Security
S
Security Affairs
Y
Y Combinator Blog
T
Tenable Blog
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
量子位
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
D
Darknet – Hacking Tools, Hacker News & Cyber Security
GbyAI
GbyAI
AWS News Blog
AWS News Blog

Julia Evans: TIL

You don't have to close <p> or <li> tags Advice for writing alt text Al Sweigart's Python books are available for free Resources for upgrading Django esbuild can build css In CSS you can populate `content:` with a `data-` attribute fx: a jq replacement pip install --user can override system libraries You can run `tty` to see your current TTY CSS supports nested selectors now! strace's `--tips` `**` works for globbing in the shell Environment variables with no equals sign Tiny IP-KVM devices exist Two ways the mouse wheel works in the terminal why the text disappers from my PDF when I print it Emoji Kitchen strace has a --stack-traces option Some programming languages buffer stdout and some don't
You can use `fzf` to review git commits
Julia Evans · 2026-05-31 · via Julia Evans: TIL

« back to all TILs

You can use `fzf` to review git commits

fzf is a tool that you can use to select items from a list. I think it’s most popularly used to search your shell history (as a Ctrl+R replacement in bash).

I’ve honestly still never found a use for fzf myself (other than fzf.vim which is amazing) but I just learned that you can use it to review a git commit like this and I thought that was really cool. You can scroll up and down through the files on the left and it’ll display the diff on the right:

#!/bin/bash
commit=${1:-HEAD}
git show --stat=120 --format="" "$commit" | \
           grep '|' | \
           fzf --ansi \
               --disabled \
               --bind 'j:down,k:up,q:abort' \
               --preview="echo {} | sed 's/ *|.*//' | xargs -I% git show --color=always $commit -- %" \
               --preview-window=right:60%

You can also use fzf as a sort of “jq playground” like this:

#!/bin/bash

printf '' | fzf --print-query \
  --preview "jq -C {q} '$1' 2>&1" \
  --preview-window=up:80%

I think it’s really cool that you can use fzf (which is theoretically a search tool) to implement lots of UIs that aren’t doing search at all, like these two!