review-design: report incomplete fix history in a shallow clone

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, javascript, node.js
Domain
cli, devtools

Research direction

Start with tools/review-design/fix-history.mjs and reproduce the shallow clone case using the commands in the issue. Check how the script reads first-parent history and handles Git's shallow boundary. Done means it reports incomplete history and does not claim an unchanged file was added at the boundary.

Written by the indexing model from the issue text.

Description

type/bug
Problem

Step 1 of review-design uses fix-history.mjs to list the landing commits that changed a path. Its --help text says that it reads the whole first-parent line. In a shallow clone, Git stops at the boundary commit and treats it as a root commit. The script reports success without saying that earlier commits are missing. It can also report an unchanged file as added at the boundary.

The script is introduced in #83. Related: #77 tracks incorrect line attribution in trace-decision at the same Git boundary.

Steps to reproduce
git init review-design-shallow
cd review-design-shallow
git fetch --depth=1 https://github.com/c-w-z/commit-decision-record.git 892a4206a6ced9c9fd629a3749473760a95e344c
git checkout --detach FETCH_HEAD
node tools/review-design/fix-history.mjs CONTRIBUTING.md
Expected and actual result

Expected: The script reports that the history is incomplete. It does not report an addition based on a diff against the empty tree at the shallow boundary.

Actual: The script exits with 0 and reports 105 added lines for CONTRIBUTING.md at 892a420. That commit does not change CONTRIBUTING.md against its parent. The output does not say that the history is incomplete.

Version

892a420

Environment

Windows x64 (build 26300), Git 2.47.1.windows.1, Node.js 24.22.2.

Log
--- first-parent line: HEAD
892a420 fix: list the landing commits of origin/HEAD in the fix history of review-design

105	0	CONTRIBUTING.md
Dominant language
Shell
Stars
1
Forks
0
Avg merge
6h 59m
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from c-w-z/commit-decision-record

All issues in c-w-z/commit-decision-record

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.