Skip to content

Enhance console and history.rb: add '-f' flag to ARGV and reverse his…#2

Merged
Syati merged 1 commit into
mainfrom
fix-order
Jan 17, 2026
Merged

Enhance console and history.rb: add '-f' flag to ARGV and reverse his…#2
Syati merged 1 commit into
mainfrom
fix-order

Conversation

@Syati
Copy link
Copy Markdown
Owner

@Syati Syati commented Jan 17, 2026

…tory filtering

Copilot AI review requested due to automatic review settings January 17, 2026 09:53
@Syati Syati merged commit 8417c0d into main Jan 17, 2026
7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the history filtering behavior in the fzf history search and adds the '-f' flag to the development console. The title references adding a '-f' flag and reversing history filtering.

Changes:

  • Modified history filtering to reverse the array before deduplication, changing which duplicate entries are preserved
  • Removed the --tac flag from the fzf command options
  • Added the -f flag to ARGV in the console script to prevent loading .irbrc files

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/reline_pac/packages/history.rb Changed history processing order by reversing the array before filtering and removed the --tac fzf flag
bin/console Added -f flag to ARGV to prevent IRB from loading initialization files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


seen = {}
filtered = all_history.filter_map do |h|
filtered = all_history.reverse.filter_map do |h|
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

Reversing the history array before filtering changes the deduplication behavior. Previously, when a command appeared multiple times in history, the oldest occurrence was kept (since the array was processed chronologically and the first occurrence was added to the 'seen' hash). Now, the newest occurrence will be kept. While this might be the intended behavior, it's a semantic change that affects which duplicate entry is preserved. Consider whether this change in deduplication logic is intentional and whether it should be documented or tested.

Copilot uses AI. Check for mistakes.
@Syati Syati review requested due to automatic review settings March 24, 2026 01:55
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.

2 participants