This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add option to remove duplicate command history entries
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Tue, 09 Jun 2015 19:10:10 +0100
- Subject: Re: [PATCH] Add option to remove duplicate command history entries
- Authentication-results: sourceware.org; auth=none
- References: <1433434918-30948-1-git-send-email-patrick at parcs dot ath dot cx>
On 06/04/2015 05:21 PM, Patrick Palka wrote:
> This patch implements the new option "history remove-duplicates", which
> controls whether GDB should remove duplicate command-history entries
> (off by default).
>
> The motivation for this option is to be able to reduce the prevalence of
> basic commands such as "up" and "down" in the history file. These
> common commands crowd out more unique commands in the history file (when
> the history file has a fixed size), and they make navigation of the
> history file via ^P, ^N and ^R more inconvenient.
>
Did you consider bash's erasedups and ignoredups? Specifically,
this seems to implement something like erasedups, and I'm wondering
how you'd fit in ignoredups in this option's UI. Might be good to
prepare for it with an enum instead, something like:
"set history duplicates ignore|erase|leave"
WDYT?
(haven't looked at the patch yet)
Thanks,
Pedro Alves