Skip to content
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

fix(stats): Ignore leading environment variables when calculating stats #2659

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

BinaryMuse
Copy link
Member

This PR updates atuin_history::stats::compute so that it makes a best attempt at ignoring leading environment variables when calculating the stats. This includes a new helper function strip_leading_env_vars that has a few tests at the bottom of the file.

Closes #2594

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@BinaryMuse BinaryMuse force-pushed the mkt/ignore-env-vars-in-stats branch from 43fe47b to 21bedb0 Compare March 31, 2025 20:24
@BinaryMuse BinaryMuse marked this pull request as ready for review March 31, 2025 20:24
@BinaryMuse BinaryMuse force-pushed the mkt/ignore-env-vars-in-stats branch from 21bedb0 to 9abab9a Compare March 31, 2025 20:31
@BinaryMuse BinaryMuse changed the title Ignore leading environment variables when calculating stats fix(stats): Ignore leading environment variables when calculating stats Mar 31, 2025
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀 🚀 🚀

@ellie ellie merged commit 6072241 into atuinsh:main Apr 1, 2025
19 checks passed
@douglascamata
Copy link

douglascamata commented Apr 1, 2025

@ellie @BinaryMuse: you might want to add a few more tests to cover the syntax env VAR=VALUE <command>.

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.

[Bug]: When command is prefixed with env vars, the first env var is what counts for atuin stats
3 participants