Skip to content

Fix inline --diff ref handling - #2

Merged
fadiuniv1 merged 1 commit into
mainfrom
fix-1-diff-inline
Nov 26, 2026
Merged

fadiuniv1 merged 1 commit into
mainfrom
fix-1-diff-inline

Conversation

@fadiuniv1

Copy link
Copy Markdown
Owner

Summary

Closes #1.

parseArgs() supported inline values (--format=json, --budget=100) for every option except --diff. The --diff branch only looked at argv[i + 1], so --diff=main silently became --diff HEAD.

This honours the inline value when present, while keeping --diff main and bare --diff unchanged. Added test/cli.test.js, and updated the README option table and CHANGELOG.md.

How tested

  • node --test test/cli.test.js → 5/5 pass (inline, separate, bare, flag-following, other inline flags).
  • Ran every test file individually with node --test on Windows / Node 24.15.0 → 33 passing, 0 failing across cli, gitignore, glob, pack, redact, tokens.
  • npm test itself crashes in this environment with Node 24's "Releasing the double mapped memory failed" before running tests; running the files directly works and avoids that wrapper issue.
  • No behavior change beyond argument parsing; secret redaction and file collection are untouched.

AI use is disclosed in the commit message: OpenCode hy4-flash-free helped inspect the parser and draft the change and tests; I opened the issue first, ran the tests, and reviewed the diff.

parseArgs ignored --diff=<ref> because it only looked at the next argv entry. Honour the inline value while keeping --diff [ref] and bare --diff unchanged. Added test/cli.test.js and updated README/CHANGELOG.

AI disclosure: I used OpenCode hy4-flash-free to inspect the parser, draft the fix and tests, and write this message. I opened issue #1 first, ran every test file locally (33 passing), and verified the change myself.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T18:27:24.518762Z
We couldn’t complete this review. Comment @codex review to try again.
490080c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@fadiuniv1
fadiuniv1 merged commit d323751 into main Nov 26, 2026
4 of 12 checks passed
@fadiuniv1
fadiuniv1 deleted the fix-1-diff-inline branch November 26, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: --diff=<ref> is ignored, falls back to HEAD

1 participant