Skip to content

Add shrink and optimize commands #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NoSmint
Copy link

@NoSmint NoSmint commented Jan 16, 2025

Add shrink and optimize commands

I felt the available cleaning functions could use some minor improvements
so I added two new commands.

  • hist shrink <length> <delta>: Recursively consolidates entries that exceed
    a specified length, matching up to a given delta. Compress works quite
    similar in this regard. The key difference is that compress works only
    on adjacent entries while shrink scans the whole history recursively.
    For this reason the values of length and delta are evaluated before
    the process begins. A warning message will be presented if the process
    might take a significant amount of time due to extensive pattern matching.

  • hist optimize <maxlength>: Discards multiline entries and any entries
    exceeding a given maxlength.

Before submitting your Pull Request (PR), please check the following:

  • There is no other PR (open or closed) similar to yours. If there is, please first discuss over there.
  • Your new code in each file follows the same style as the existing code in that file.
  • Each commit messages follows the Seven Rules of a Great Commit Message.
  • Each commit message includes Fixes #<bug> or Resolves #<issue> in its body (not subject, that is, the
    first line) for each issue it resolves (if any).
  • You have squashed any redundant or insignificant commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant