Skip to content

docs: clarify --from/--to merge-base semantics (#579) - #613

Open
Ritvvvik wants to merge 2 commits into
alibaba:mainfrom
Ritvvvik:docs/clarify-ref-comparison-579
Open

docs: clarify --from/--to merge-base semantics (#579)#613
Ritvvvik wants to merge 2 commits into
alibaba:mainfrom
Ritvvvik:docs/clarify-ref-comparison-579

Conversation

@Ritvvvik

Copy link
Copy Markdown
Contributor

Problem

Three sources documented ocr review --from x --to y inconsistently:

  • README.md — didn't specify two-dot (a..b) vs three-dot (a...b)
    semantics at all.
  • Website Quickstart (en/ja/zh) — explicitly described it as
    main..feature-branch (two-dot), which is wrong.
  • CLI --help (cmd/opencodereview/flags.go:206) — correctly
    describes it as "merge-base mode" (three-dot semantics).

Root cause confirmed

internal/diff/git.go's ModeRange computes the range via the two
refs' common ancestor (merge-base) — i.e. three-dot semantics, matching
the CLI help text. The Quickstart pages contradicted this.

Fix

Updated the single-line comment above ocr review --from main --to feature-branch in all four affected files to describe the actual
behavior in plain language, rather than relying on git's ../...
notation (which was the source of the original ambiguity):

  • README.md
  • pages/src/content/docs/en/quickstart.md
  • pages/src/content/docs/ja/quickstart.md
  • pages/src/content/docs/zh/quickstart.md

No behavior change — documentation only. flags.go's help text was
already correct and untouched.

Note on translations

I'm not a native Japanese or Chinese speaker; I'd appreciate a quick
sanity check on the ja/zh wording from a maintainer or native speaker
before merge.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 1 comment(s)

Comment thread examples/codeup_ci/post_review.py Outdated
Fixes alibaba#579. internal/diff/git.go's ModeRange computes the range via
the two refs' merge-base, matching the CLI --help text (flags.go:206,
'merge-base mode'). The three Quickstart locales incorrectly described
this as a..b (two-dot) comparison; README.md was ambiguous. All four
now describe the actual merge-base behavior in plain language rather
than relying on git dot-notation.
@Ritvvvik
Ritvvvik force-pushed the docs/clarify-ref-comparison-579 branch from f5f41d3 to b93d374 Compare July 30, 2026 19:12
@lizhengfeng101

Copy link
Copy Markdown
Collaborator

Review

The change itself is correct and valuable — I verified that internal/diff/git.go does indeed use git merge-base (line 260) to compute the range, so the new wording accurately reflects the actual behavior.

Issue: Missing localized README updates

The following localized README files contain the same outdated description but were not updated in this PR:

File Current (stale) line
README.zh-CN.md:138 # 分支范围 —— 比较两个引用
README.ja-JP.md:138 # ブランチ範囲 — 2つのrefを比較
README.ko-KR.md:138 # Branch range: 두 ref 비교
README.ru-RU.md:138 # Диапазон веток — сравнение двух ref'ов

These should be updated to match the new merge-base description for consistency.

Suggestion: PR title

The current title "Fixes #579" is quite terse for commit history. Consider something like docs: clarify --from/--to merge-base semantics (#579) so the change is self-describing in git log.

Addresses review feedback on alibaba#613 — zh-CN, ja-JP, ko-KR, ru-RU README
comments still described the old (incorrect) two-dot comparison.
@Ritvvvik Ritvvvik changed the title Fixes #579 docs: clarify --from/--to merge-base semantics (#579) Jul 31, 2026
@Ritvvvik

Ritvvvik commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Good catch on the locale files pushed a fix for zh-CN, ja-JP, ko-KR and ru-RU with the same merge-base wording. I'm not a native speaker in any of the five non-English locales touched across this PR, so I'd really appreciate a native speaker sanity-checking the phrasing before merge.

Also updated the PR title per your suggestion.

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.

2 participants