Skip to content

log/show/diff/grep/blame/notes/reflog family vs git: log --notes silently ignored, show rejects ^{tree}, diff-tree can't emit raw plumbing format, grep/log regex-default mismatch, shortlog rejects ranges, reflog bare flags rejected; apply is check-only #478

Description

@genedna

Summary

Comparison of log / show / diff / diff-tree / diff-index / diff-files / grep / blame / shortlog / describe / notes / reflog / apply / format-patch / am / mailinfo / fast-export / fast-import / bundle / for-each-ref / rev-list (libra 0.22.5 vs git 2.55), flag-by-flag, run in /run/media/genedna/data/tmp/cmp.

log

  • Verified matching: --oneline, --format/--pretty placeholders (%h %an %s), --stat, --graph, -p, --name-only, --name-status, --grep, --author, --committer, --since/--until, -n, --skip, --reverse, --first-parent, --all, range main..feat, --follow (accepted), -<n> (issue [r2cn-测试任务] 修复[libra] 不支持 log -<n> 语法 #183 fixed).
  • Divergence: --grep is a regex in libra, Git is default fixed-string (POSIX basic regex via --extended-regexp selection; plain --grep=foo in Git matches substring literally). libra's rev-list --grep help says "using a regular expression" — a pattern containing regex metacharacters (e.g. --grep "c++ (fix)") behaves differently from Git. Git parity needs fixed-string default + --extended-regexp/--fixed-strings selectors (missing).
  • Divergence: log --format does not honor --notes/%N, and --notes flag on log verified inconsistent (git log --notes embeds notes; libra log -1 --notes produced no Notes block with a note present — see notes section).
  • --all order differs from Git (libra emits reverse-chronological but interleaves ranges differently with --graph); hard to pin without a stable tiebreak — low priority.

show

  • show <commit>, --stat, --format, show <tag> (annotated tag object header — issue [r2cn-测试任务] libra show does not display annotated tag information correctly #178 fixed), show HEAD:<path> blob output — verified.
  • Divergence: show HEAD^{tree} fails (fatal: bad revision 'HEAD^{tree}', exit 129) while rev-parse HEAD^{tree} resolves the same expression fine. Git prints the tree listing. The ^{tree}/^{commit} peel suffix is supported in rev-parse but not in show's revision resolver — inconsistent peeling between two libra commands.

diff family

  • Verified matching: --stat, --numstat, --shortstat, --name-only, --patch, -U<n>, --cached, HEAD~1 HEAD, path limiters, --exit-code, --quiet, --color=never, --word-diff, --patience (accepted), --binary (accepted), --check (accepted).
  • --dirstat missing (unexpected argument). Git's t4004 covers it; libra gap.
  • diff --cached with no HEAD (fresh repo) — untested edge in libra suite; Git handles (diffs against empty tree). Low risk.
  • diff-tree default output is patch format (diff --git …), but Git's diff-tree defaults to raw (:000000 100755 …) unless -p. Scripts consuming raw plumbing output will misparse. -r, --name-only, --raw flags are missing on libra diff-tree (unexpected argument '-r'), so the Git raw plumbing format is unreachable entirely.
  • diff-index/diff-files verified producing patch format with Scanning working tree … progress noise on stdout path (issue diff: "Scanning working tree ..." progress line fires for a ~30 ms local op and is not TTY-gated under --progress auto #466 covers TTY-gating of the progress line).
  • apply is --check only ("actually applying the patch is not yet supported" per help) — so the am pipeline is the only way to apply patches; --stat, -R, --3way, --index, --exclude all absent. This is the biggest functional gap in the patch workflow (Git t4100-t4150 families).

grep

  • Basic -n, -c, -e, -i, -v, --max-count verified working with path:line:content output.
  • --fixed-strings missing (same regex-default problem as log --grep); -E, -P, -w, --and/--or boolean expressions, --untracked, --no-index, -p/--show-function, -<n> context lines, --heading, --break unimplemented (spot-checked several; --untracked accepted but verified only as no-op for untracked search). Git's t7810 is the reference suite.

blame

  • blame <file> (line-annotated), --porcelain verified; output header format matches Git's (<author> <date> <lineno>) shape; -L <n>,<m> verified with proper error for out-of-range (Invalid range 1,2 (total lines: 1) — Git instead clamps/errors differently: fatal: file … has only 1 lines; exit differs 129 vs 128 — cosmetic).
  • Missing: -w (ignore whitespace), -M/-C (move/copy detection), --date=, --incremental, -e/--show-email. Git's t8001/t8002 cover these.

shortlog

  • -s, -n, -e (emails) verified; output 7 T formatting matches Git.
  • Divergence: shortlog <range> rejects HEAD~2..HEAD (failed to resolve revision 'HEAD~2..HEAD': invalid reference) while plain log HEAD~2..HEAD and shortlog HEAD work. Range support in shortlog's resolver lags log's.

describe

  • describe, --tags, --long (v0.9-0-g<sha>, matches Git), --dirty verified; --match, --exclude, --first-parent, --abbrev=<n>, --candidates exist per help (spot-checked --long/--dirty only). Good parity.

notes

  • add -m, show, list, remove, append -m verified; ref stored as refs/notes/commits like Git.
  • Divergence: log --notes does not render the note (Git appends a Notes: block). git log --notes is a documented output modifier; libra's log accepts --notes silently but the note body never appears — silent misbehavior, worse than rejecting the flag.
  • Missing: notes merge, notes prune, notes get-ref, -C/-c reuse.

reflog

  • reflog, reflog show <ref>, --number N, --grep, --stat, --patch, --no-abbrev (via show subcommand spelling only — bare reflog -3/--grep/--date/-n are rejected: unexpected argument), expire --all verified.
  • Divergence: Git exposes reflog -n/--date/--grep on the bare command AND reflog show; libra only on the subcommand. libra reflog -3 (documented Git reflex) errors. Also --date=iso missing entirely — timestamps print in a fixed format, scripts parsing dates can't request ISO.
  • reflog delete, reflog exists missing. t1410 coverage gap.

format-patch / am / mailinfo

  • format-patch -1 (writes 0001-cfb.patch), --stdout (mbox From …, Subject: [PATCH] … headers) verified; --cover-letter, -o, --numbered, --start-number, --thread, --signature, --subject-prefix exist per help (spot-checked -1/--stdout).
  • am verified applying a libra-generated patch; guards (cannot start am with staged or tracked changes, no am operation is in progress for --abort/--skip/--continue) match Git semantics.
  • Divergence: am refuses a patch that doesn't apply with patch does not apply to 'cf.txt' exit 0 (!) — the fatal error printed but process exit was 0 in one observation path; re-ran and got correct behavior on a clean tree. Flaky exit-code propagation around am failures worth a test. (mailinfo requires explicit <PATCH> argument; Git's mailinfo takes <msg> <patch> two-output form — libra's single-arg form diverges; undocumented.)

fast-export / fast-import / bundle

  • Cross-tool interop verified: libra fast-export --all piped into git fast-import produced valid Git commits (git log lists them). Big win; the stream format is compatible for the basic blob/mark/data/commit features.
  • fast-import reads --input <FILE> or stdin; no positional argument (Git's git fast-import <file> reflex errors: unexpected argument '/path' found); no --dry-run; --max-count, --quiet exist. Git's --force, --quiet, --stats, --big-file-threshold, checkpoint/progress/feature directives unverified.
  • bundle create/verify/list-heads verified, Git-compatible headers (The bundle uses this hash algorithm: sha1 from git bundle verify on a libra bundle is the acid test — not yet cross-verified; libra bundle verify of a libra bundle passes; a git bundle verify /tmp/.../l.bundle cross-check is needed and cheap). unbundle exists; --quiet, --progress, --version=<n> unverified.

rev-list

  • Rich surface verified: --count, --reverse, --skip, --first-parent, --boundary, --author/--grep/--since/--until, --merges/--no-merges, --left-right, --cherry-pick/--cherry-mark/--cherry, --parents, --children, --timestamp.
  • --objects missing (rev-list --objects HEAD silently printed commits only — the flag was accepted? Actually output shows plain commit list; --objects/--objects-edge/--disk-usage/--no-walk are absent: --no-walk errored unexpected argument). Git plumbing consumers (gc, pack scripts) rely on these; libra's own pack-objects path uses internal APIs so impact is contained to user scripts.

Test gaps vs Git

  • t4202-log (grep/regex semantics, --notes rendering), t7810-grep (fixed-strings, boolean combinators), t8001-blame (-M/-C/-w), t4150-am (exit-code propagation on failure), t6000-rev-list (--objects/--no-walk), t1410-reflog (bare-command flag parity, --date) — the strongest gaps, each mapped above.
  • Add a cross-tool round-trip test: libra fast-export → git fast-import → git fsck (the happy path already works; a regression test locks it).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions