This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Prune duplicate command history entries
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 3 Jun 2015 09:20:36 +0100
- Subject: Re: [PATCH] Prune duplicate command history entries
- Authentication-results: sourceware.org; auth=none
- References: <1433301766-20101-1-git-send-email-patrick at parcs dot ath dot cx>
* Patrick Palka <patrick@parcs.ath.cx> [2015-06-02 23:22:46 -0400]:
> This patch implements pruning of duplicate command-history entries using
> a modest amount of lookbehind. The motivation for this patch is to
> reduce the prevalence of basic commands such as "up" and "down" in the
> history file.
Dropping commands such as up / down could be pretty annoying if you
wanted to figure out where you were in the past. Dropping things like
bt from the history would be less annoying.
I wonder if we should classify commands into navigation or
state-changing commands and diagnostic commands.
I'd be happier see repeated diagnostic commands disappear, and less so
for commands that change inferior state, or navigate me around the
stack.
> The maximum lookbehind is fixed to 50 (an arbitrary number) so that the
> operation will be guaranteed to not take too long.
I think at the very least you should make this threshold
configurable. I'd then argue for off by default due to the loss of
state changing commands being too annoying (for me).
You should probably have some tests too, we already test C-p in
readline.exp, so it should be possible to test that this feature
works.
Thanks,
Andrew