frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Git Commands I Run Before Reading Any Code

https://piechowski.io/post/git-commands-before-reading-code/
116•grepsedawk•2h ago

Comments

gherkinnn•51m ago
These are some helpful heuristics, thanks.

This list is also one of many arguments for maintaining good Git discipline.

pzmarzly•46m ago
Jujutsu equivalents, if anyone is curious:

What Changes the Most

    jj log --no-graph -r 'ancestors(trunk()) & committer_date(after:"1 year ago")' \
      -T 'self.diff().files().map(|f| f.path() ++ "\n").join("")' \
      | sort | uniq -c | sort -nr | head -20
Who Built This

    jj log --no-graph -r 'ancestors(trunk()) & ~merges()' \
      -T 'self.author().name() ++ "\n"' \
      | sort | uniq -c | sort -nr
Where Do Bugs Cluster

    jj log --no-graph -r 'ancestors(trunk()) & description(regex:"(?i)fix|bug|broken")' \
      -T 'self.diff().files().map(|f| f.path() ++ "\n").join("")' \
      | sort | uniq -c | sort -nr | head -20
Is This Project Accelerating or Dying

    jj log --no-graph -r 'ancestors(trunk())' \
      -T 'self.committer().timestamp().format("%Y-%m") ++ "\n"' \
      | sort | uniq -c
How Often Is the Team Firefighting

    jj log --no-graph \
      -r 'ancestors(trunk()) & committer_date(after:"1 year ago") & description(regex:"(?i)revert|hotfix|emergency|rollback")'
Much more verbose, closer to programming than shell scripting. But less flags to remember.
palata•39m ago
To me, it makes jujutsu look like the Nix of VCSes.

Not meaning to offend anyone: Nix is cool, but adds complexity. And as a disclaimer: I used jujutsu for a few months and went back to git. Mostly because git is wired in my fingers, and git is everywhere. Those examples of what jujutsu can do and not git sound nice, but in those few months I never remotely had a need for them, so it felt overkill for me.

ramon156•38m ago
> The 20 most-changed files in the last year. The file at the top is almost always the one people warn me about. “Oh yeah, that file. Everyone’s afraid to touch it.”

The most changed file is the one people are afraid of touching?

mememememememo•35m ago
Yes. Because the fear is butressed with necessity. You have to edit the file, and so does everyone else and that is a recipe for a lot of mess. I can think back over years of files like this. Usually kilolines of impossible to reason about doeverything.
dewey•34m ago
I've just tried this, and the most touched files are also the most irrelevant or boring files (auto generated, entry-point of the service etc.) in my tests.
nulltrace•12m ago
Yeah same thing happens with lockfiles and CI configs. You end up filtering out half the list before it tells you anything useful.
szszrk•14m ago
Could be also that a frequently edited file had most opportunity to be broken. And it was edited by the most random crowd.
rbonvall•9m ago
Just like that place that's so crowded nobody goes there anymore.
mchaver•9m ago
Definitely not in my experience. The most changed are the change logs, files with version numbers and readmes. I don't think anyone is afraid of keeping those up to date.
seba_dos1•30m ago
> If the team squashes every PR into a single commit, this output reflects who merged, not who wrote.

Squash-merge workflows are stupid (you lose information without gaining anything in return as it was easily filterable at retrieval anyway) and only useful as a workaround for people not knowing how to use git, but git stores the author and committer names separately, so it doesn't matter who merged, but rather whether the squashed patchset consisted of commits with multiple authors (and even then you could store it with Co-authored-by trailers, but that's harder to use in such oneliners).

theshrike79•19m ago
Can you explain to me (an avid squash-merger) what extra information do you gain by having commits that say "argh, let's see if this works", "crap, the CI is failing again, small fix to see if it works", "pushing before leaving for vacation" in the main git history?

With a squash merge one PR is one commit, simple, clean and easy to roll back or cherry-pick to another branch.

seba_dos1•11m ago
These commits reaching the reviewer are a sign of either not knowing how to use git or not respecting their time. You clean things up and split into logical chunks when you get ready to push into a shared place.
zaphirplane•7m ago
[delayed]
Aachen•9m ago
If someone uses git commits like the save function of their editor and doesn't write messages intended for reading by anyone else, it makes sense to want to hide them

For other cases, you lose the information about why things are this way. It's too verbose to //comment on every like with how it came to be this way but on (non-rare in total, but rare per line) occasion it's useful to see what the change was that made the line be like this

filcuk•18m ago
Having the tree easy to filter doesn't matter if it returns hundreds of commits you have to sift through for no reason.
arnorhs•12m ago
The author is talking about the case where you have coherent commits, probably from multiple PRs/merges, that get merged into a main branch as a single commit.

Yeah, I can imagine it being annoying that sqashing in that case wipes the author attribution, when not everybody is doing PRs against the main branch.

However, calling all squash-merge workflows "stupid" without any nuance.. well that's "stupid" :)

traceroute66•29m ago
> The 20 most-changed files in the last year. The file at the top is almost always the one people warn me about.

What a weird check and assumption.

I mean, surely most of the "20 most-changed files" will be README and docs, plus language-specific lock-files etc. ?

So if you're not accounting for those in your git/jj syntax you're going to end up with an awful lot of false-positive noise.

theshrike79•17m ago
Why would you touch the README file hundreds of times a year?

You're right about package.json, pnpm-lock etc though, but those are easy to filter out if the project in question uses them.

traceroute66•7m ago
> Why would you touch the README file hundreds of times a year?

You're right, perhaps I should have said CHANGELOG etc.

Although some projects e.g. bump version numbers in README....

JetSetIlly•28m ago
Some nice ideas but the regexes should include word boundaries. For example:

git log -i -E --grep="\b(fix|fixed|fixes|bug|broken)\b" --name-only --format='' | sort | uniq -c | sort -nr | head -20

I have a project with a large package named "debugger". The presence of "bug" within "debugger" causes the original command to go crazy.

aa-jv•6m ago
Great tips, added to notes.txt for future use ..

Another one I do, is:

    $alias gss='git for-each-ref --sort=-committerdate'

    $gss

    ce652ca83817e83f6041f7e5cd177f2d023a5489 commit refs/heads/project-feature-development
    ce652ca83817e83f6041f7e5cd177f2d023a5489 commit refs/remotes/origin/project-feature-development
    1ef272ea1d3552b59c3d22478afa9819d90dfb39 commit refs/remotes/origin/feature/feature-removal-from-good-state
    c30b4c67298a5fa944d0b387119c1e5ddaf551f1 commit refs/remotes/origin/feature/feature-removal
    eda340eb2c9e75eeb650b5a8850b1879b6b1f704 commit refs/remotes/origin/HEAD
    eda340eb2c9e75eeb650b5a8850b1879b6b1f704 commit refs/remotes/origin/main
    3f874b24fd49c1011e6866c8ec0f259991a24c94 commit refs/heads/project-bugfix-emergency
    ...

This way I can see right away which branches are 'ahead' of the pack, what 'the pack' looks like, and what is up and coming for future reference ... in fact I use the 'gss' alias to find out whats going on, regularly, i.e. "git fetch --all && gss"

Asdsd

https://news.ycombinator.com/submit
1•hemanshudev•7s ago•0 comments

Greece to ban under-15s from social media from next year

https://news.sky.com/story/greece-to-ban-under-15s-from-social-media-from-next-year-13529181
1•austinallegro•22s ago•0 comments

Men Are Buying Hacking Tools to Use Against Their Wives and Friends

https://www.wired.com/story/men-are-buying-hacking-tools-to-use-against-their-wives-and-friends/
1•joozio•34s ago•0 comments

Breakthrough in AI Solving Math Conjectures: Peking Univ. Team's Exploration

https://chinaresearchcollective.substack.com/p/a-new-breakthrough-in-ai-solving
1•seekdeep•1m ago•0 comments

Did it get dumber? Tracking Claude Code and Codex according to HN comments

https://diditgetdumber.com/
1•lebek•1m ago•0 comments

OCC – YAML-defined workflow orchestrator for LLMs with parallel execution

https://github.com/lacausecrypto/OCC
1•lacausecrypto•4m ago•0 comments

RFC 0015: Pi Licensing

https://rfc.earendil.com/0015/
1•tosh•5m ago•0 comments

Reading /etc./passwd through a translation file upload (CVE-2026-32251)

https://simonkoeck.com/writeups/tolgee-xxe-translation-import
1•soeckly•5m ago•0 comments

Hugging Face Contributes Safetensors to PyTorch Foundation

https://www.linuxfoundation.org/press/pytorch-foundation-announces-safetensors-as-newest-contribu...
1•rbanffy•5m ago•0 comments

DuckLake's 900x Speed Claim:A Database in Your Catalog Is Worth Two in the Cloud

https://www.banandre.com/blog/ducklake-900x-speed-claim-data-inlining-analysis
1•pholanda•8m ago•0 comments

Why Your Engineering Team Is Slow (It's the Codebase, Not the People)

https://piechowski.io/post/codebase-drag-audit/
2•grepsedawk•8m ago•0 comments

Defender – Local prompt injection detection for AI agents (no API calls)

https://www.npmjs.com/package/@stackone/defender
2•Hiskias•9m ago•0 comments

Countries are considering teen social media bans – why experts warn it's 'lazy'

https://www.cnbc.com/2026/04/08/teen-social-media-ban-countries-tech-experts-warning.html
1•cebert•12m ago•0 comments

Claude Mythos Preview: Available in Private Preview on Vertex AI

https://cloud.google.com/blog/products/ai-machine-learning/claude-mythos-preview-on-vertex-ai
1•Topfi•14m ago•0 comments

Optimize Norm Gathering Asm

https://blog.serenedb.com/norm-gathering
1•MBkkt•15m ago•0 comments

Show HN: Android SSH client with full Terminal, server monitoring and runbooks

https://saltserv.com/posts/cura-sysadmin-server-monitoring-android/
2•0dayman•18m ago•0 comments

From Engineer to Director

https://danielgriesser.com/posts/from-engineer-to-director/
1•tosh•19m ago•0 comments

ZeroKeep – Private AI workspace on WebGPU. Zero cost, zero setup

https://zerokeep.dev
1•bozmen•26m ago•0 comments

Earendil Inc. announcing Pi acquisition and Lefos

https://earendil.com/posts/press-release-april-8th/
1•czottmann•26m ago•0 comments

Show HN: DryRun – PostgreSQL MCP and schema advisor that works offline

https://github.com/boringSQL/dryrun
2•radimm•28m ago•1 comments

Mamba-3 and the State Space Model Renaissance

https://ngrislain.github.io/blog/2026-3-29-reading-note-mamba3-and-the-state-space-model-renaissa...
1•ngrislain•30m ago•0 comments

Zapfino, the Typeface with Built-In Magic

https://thatkeith.com/articles/zapfino-the-typeface-with-built-in-magic/
2•arm•30m ago•0 comments

Grid Battery storage is now cheap enough to unleash India's full solar potential

https://ember-energy.org/latest-insights/battery-storage-is-now-cheap-enough-to-unleash-indias-fu...
2•alephnerd•32m ago•0 comments

Reddit vs. SerpApi et al.

https://www.documentcloud.org/documents/26193527-reddit-v-serpapi-et-al/
2•doener•33m ago•0 comments

The Age-Old Urge to Destroy Technology

https://www.newyorker.com/culture/infinite-scroll/the-age-old-urge-to-destroy-technology
1•chrisaycock•36m ago•0 comments

Richard Feldman: language runtime overhead (2022) [video]

https://vimeo.com/653510682
1•tosh•38m ago•0 comments

Show HN: I built an open protocol for Agent-to-agent commercial negotiation

https://a2cn.io/
2•cmagorr1•38m ago•0 comments

Rare China visit, Taiwan's opposition leader calls for reconciliation

https://www.aljazeera.com/news/2026/4/8/on-rare-china-visit-taiwans-opposition-leader-calls-for-r...
2•_tk_•42m ago•0 comments

Did WordPress VIP leak my phone number?

https://shkspr.mobi/blog/2026/04/did-wordpress-vip-leak-my-phone-number/
3•ColinWright•43m ago•0 comments

OpenAI Codex reaches 3M weekly active users, up from 2M in under a month

https://twitter.com/thsottiaux/status/2041655710346572085
3•alecco•44m ago•0 comments