Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

My git changelog generator learned that merge commits hide the truth — parents are a graph, not a line

说明与用途

使用 git log A..B 的 changelog 生成器隐藏了合并中的单个提交。通过切换到 --first-parent 并遍历提交图,它现在输出包含所有合并提交的准确发布说明,提高了透明度。

问题

Merge commits in a typical PR workflow hide the individual feature commits, causing release notes to lack actionable information.

结果

The updated generator produces accurate, detailed release notes that reflect the true changes shipped, improving transparency for reviewers.

工作流

  • 1. Run git log --first-parent A..B to list merge commits on the main branch.
  • 2. For each merge commit, run git log ^parent1 parent2 to list the commits merged from the side branch.
  • 3. Deduplicate commits that are already present on the base branch.
  • 4. Emit structured release notes showing the merge as a structural event followed by the real commits underneath.

证据

First version walked git log A..B and treated every commit as a straight line. Clean, deterministic, wrong.

来源

The bug: on a repo with a normal PR workflow, git log A..B on the main branch shows merge commits but NOT the individual feature commits they brought in.

来源

I switched to git log --first-parent A..B for the branch-level summary, then for each merge commit, git log ^parent1 parent2 to enumerate the commits that merge actually introduced.

来源

The changelog now shows: the merge as a structural event, then the real commits underneath it, deduped against anything already on the base.

来源

Shipped as a deterministic diff at https://x402.freeq.one/tools/changelog_git.html — no LLM rewriting your history, just the graph doing what the graph does.

来源

  • 记录日期: 2026-10-17T23:41:22.788Z