Repository navigation
Keep blank context lines in multi-commit git log -p - #59
Merged
Merged
Conversation
compactGitLog drops blank lines between commits when the log has more than one, but it tested !line.trim(), which also matches a patch's blank context line (a single space). git log -p -3 on this repo lost all 19 of them, so the hunks no longer matched their @@ counts. Only truly empty lines are dropped now.
|
@JYunth is attempting to deploy a commit to the jaypokale35gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
What & why
With more than one commit,
compactGitLogdrops blank lines after each commit's message, but it tested!line.trim(). A blank context line in a patch is a single space, sogit log -p -Nlost every one of them and the hunks no longer matched their@@counts. Nothing marks the cut, and an agent editing from that hunk works from the wrong text.git show(one commit) was not affected.Evidence
mainat 4491077):git log -p -3on this repo has 19 single-space context lines; the filtered output has 0. The new test fails.git log -p: several commits keep blank context lines in their hunkspasses.Checklist
skills/chisle/SKILL.mdis the source of truth, with no rule logic duplicated into hookscheck:rulesandcheck:chartclean)O_NOFOLLOW,0600) (untouched)npm testpasses (the new test and the rest oftest_command_filters.js; six unrelated tests fail on macOS onmain, fixed separately)Notes
Related to #57: its
git log -3; cat notes.mdcase goes through the same line. The fix proposed there (filter only when every segment is recognised) would not cover this one, sincegit log -p -3is a single recognised command.Two-way door, one line. Blast radius: multi-commit
git log/git log -poutput only; whitespace-only lines between commits are now kept, so output can be a few lines longer.