Skip to content

codemap --diff output unbounded in showDiffVsMain #23

@JordanCoin

Description

@JordanCoin

Problem

In cmd/hooks.go:231, for repos under 5000 files, showDiffVsMain runs codemap --diff and pipes directly to stdout without the 60KB hard cap.

The tree output path captures into a buffer and truncates, but the diff path does not. On a branch with many changed files in a medium-sized repo, this could produce unexpectedly large output.

Suggested fix

Capture codemap --diff output into a buffer and apply the same limits.MaxContextOutputBytes truncation used for tree output.

Context

Flagged during review of #22. Low risk since it only applies to repos under 5000 files, but inconsistent with the tree output which has the hard cap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions