Conversation
- Add --changed-only/-c flag to filter output to only changed files - Skip git log for files without meaningful history: * Ignored files (I) - not tracked by git * Untracked files (??) - not yet in git * .git directory (*) - git metadata * Newly added files (A*, AM, AD) - staged but not committed - Early filtering before git log reduces work significantly - Performance: 2.5s -> 1.5s in large repos (40% improvement) - Add comprehensive tests for filtering logic
3 tasks
llimllib
added a commit
that referenced
this pull request
Apr 8, 2026
…y was added (#43) - The `filesNeedingLog` filter introduced with `--changed-only` (#41) inadvertently excluded unmodified tracked files (empty `status`). For an empty string, `strings.SplitSeq` yields `""`, the `len(status) > 0` guard is false, `allNew` stays `true`, and the file is dropped from the git log query — so hash/author/message show up blank. - Fix adds an explicit `status == ""` guard that includes clean tracked files in `filesNeedingLog` before the `allNew` logic runs. - Adds `TestUnmodifiedFileGetsGitInfo`, an integration test that creates a real repo, commits a file, runs the full filtering pipeline, and asserts the file gets its commit info populated. This test would have caught the regression.
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.
Adds a
--changed-only/-cflag to filter output to only show files that appear in git status.Features
--changed-only/-cto show only changed filesPerformance Optimizations
I) - not tracked by git??) - not yet in git.gitdirectory (*) - git metadataA,AM,AD) - staged but not committedTesting
Usage
git-ls --changed-only git-ls -c # short form