Repository navigation
Name the commits' real authors in git dockets - #15
Merged
Merged
Conversation
GitAdapter::authors passed the revision range after `--`, so git read it as a pathspec rather than a range. That matched no path and exited 0, so the call returned an empty list instead of failing. adjudicate_3way treats an empty list as "unknown author" and substitutes the literal @git-author, so every git docket recorded a fabricated provenance rather than the commits' actual authors. The error branch at git.rs:115 never fired either, because git exited successfully. Move the range before `--`. Adds test_git_adapter_3way_reports_real_commit_authors, which commits as a named author and asserts the docket names them. src/adapter/git.rs | 5 +++- tests/git_adapter_test.rs | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GitAdapter::authors(src/adapter/git.rs:108) passed the revision range after--:After
--git reads its argument as a pathspec, not a revision range. A range is not a path, so nothing matches and git exits 0. The call therefore returned an empty author list instead of failing, and the error branch at git.rs:115 never fired.adjudicate_3way(git.rs:210-213) reads an empty list as unknown provenance and substitutes the literal@git-author. So every git-authored docket carried a fabricated author instead of the commits' real authors. Nothing in the suite coveredauthors;grep authors tests/git_adapter_test.rsreturned nothing.Proof it was broken
Run against a real repo whose HEAD commit is authored by
Dana Feature <dana@example.com>:The old form's empty output is what drove the
@git-authorfallback.Change
Range moved before
--. One behavioral line, plus a comment saying why the position matters so it is not "tidied" back.The new test commits as a named author and asserts the docket names them, so the regression cannot come back silently.
Verification
cargo check -p oot --all-targets→ Finished, exit 0.cargo fmt --all -- --check→ clean, exit 0.authors()code path standalone against a real repo, sincecargo testcannot run on the audit box: old form →[]→ docket["@git-author"], assertion FAILS; new form →["Dana Feature"].Full suite and clippy verdict come from CI.
Not shipped
Findings from the same pass, left alone as separate concerns. No code changed for them.
src/visibility.rs:207-212—VisibilityPolicy::checkre-implements private-branch matching inline with a barecontains(pb), whilebranch_is_private(visibility.rs:107) does segment-aware matching. Withprivate_branches = ["main"], a change nameddomain-modelis cloaked bycheckbut not private perbranch_is_private. Adjudication and export disagree. Duplicated policy, so worth one source of truth, but the fix changes which changes get cloaked and needs the owner's call on the intended semantics.src/store.rs:3989—message_names_private_pathhand-rolls private-path matching and has no wildcard branch, so a policy using*.pemnever triggers the message-leak warning.src/andtests/:get_head_branch(store.rs:183),has_ref(store.rs:414),resolve_change_id(adapter/jj.rs:138),embargo_verify(store.rs:3177).src/adapter/jj.rs:217-220— the conflict-marker predicate looks unreachable for real jj and git markers. Could not settle it here: thejjv0.44 musl binary SIGBUSes under proot, so the conflicting-merge path never ran.tests/jj_adapter_test.rs:223asserts the opposite and CI installs jj and is green, which argues against the finding. Unverified either way.CONTRIBUTING.md:51says a dispute has four fields;Dispute(src/dispute.rs:44) has five, the fifth beingdetail.CONTRIBUTING.md:42showsscope:in the docket contract; the renderer emitsintent:(src/dispute.rs:223), andscopesurvives only as a serde alias.README.md:23andCONTRIBUTING.md:15name the policy schema asprivate-to,embargo-until,public. None of those keys exist;VisibilityPolicy(src/visibility.rs:18) hasprivate_paths,embargo_until,private_branches,resign_key_id,embargo_recipients. Neither struct setsdeny_unknown_fields, so a policy written from the README parses into defaults and reads as enforcement while doing nothing.README.md:60says exit 0 isadjudicatedand everything else nonzero so CI can gate on it.--docket(src/main.rs:268-272) andoot docket(src/main.rs:771-776) return SUCCESS whatever the stored verdict.