Repository navigation
fix: remove the shared indentation of the commit body - #91
Merged
Merged
Conversation
Issue #54 showed the body of a commit on one line in the preview. The plenary job gave the lines of `git log`, and the parser joined them without a separator. 4fe8024 replaced plenary with vim.system, so the parser now reads the full output and keeps the newlines. The parser still trimmed the whole body, so the first line lost its indentation and the other lines kept theirs. A body that is indented as a whole, as in the issue, showed `## what` and then ` ## how`. The parser now removes the indentation that all lines with text share, as textwrap.dedent of Python does. Lines with only whitespace do not count, and they become empty. A tab and a space do not match. A body without a shared indentation is trimmed as before. When the first line is not indented, the parser takes the old path without a copy or a split. A test runs git with the body of the issue and checks the documentation of the item. The fuzz test of the parser now also checks the dedent against a reference that uses line lists. Fixes #54.
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.
4fe8024 already fixed the lost newlines of #54: the parser reads the full output of
git loginstead of the plenary lines that it joined without a separator.This PR fixes the indentation that was left. The trim of the body removed the indentation of the first line only, so an indented body showed
## whatand then## how. The parser now removes the indentation that all lines with text share, astextwrap.dedentof Python does.make cipasses.make bench-compareagainst main shows 0 regressions.Fixes #54.