From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90878 invoked by alias); 20 Jun 2015 06:52:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 90867 invoked by uid 89); 20 Jun 2015 06:52:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout24.012.net.il Received: from mtaout24.012.net.il (HELO mtaout24.012.net.il) (80.179.55.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 20 Jun 2015 06:51:59 +0000 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NQ800A00D82BQ00@mtaout24.012.net.il> for gdb-patches@sourceware.org; Sat, 20 Jun 2015 09:43:28 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQ80086TDCGOQ20@mtaout24.012.net.il>; Sat, 20 Jun 2015 09:43:28 +0300 (IDT) Date: Sat, 20 Jun 2015 06:52:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] Add option to remove duplicate command history entries In-reply-to: <1434756821-7423-1-git-send-email-patrick@parcs.ath.cx> To: Patrick Palka Cc: gdb-patches@sourceware.org, patrick@parcs.ath.cx Reply-to: Eli Zaretskii Message-id: <83egl6kh2u.fsf@gnu.org> References: <5578539E.1020806@redhat.com> <1434756821-7423-1-git-send-email-patrick@parcs.ath.cx> X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00414.txt.bz2 > From: Patrick Palka > Cc: Patrick Palka > Date: Fri, 19 Jun 2015 19:33:41 -0400 > > This patch implements the new option "history remove-duplicates", which > controls the removal of duplicate 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. > > The option takes an integer denoting the number of history entries to > look back at for a history entry that is a duplicate of the latest one. > "history remove-duplicates 1" is equivalent to bash's ignoredups option, > and "history remove-duplicates unlimited" is equivalent to bash's > erasedups option. > > [ I decided to go with this integer approach instead of a tri-state enum > because it's slightly more flexible and seemingly more intuitive than > leave/erase/ignore. ] > > gdb/ChangeLog: > > * NEWS: Mention the new option "history remove-duplicates". > * top.c (history_remove_duplicates): New static variable. > (show_history_remove_duplicates): New static function. > (gdb_add_history): Conditionally remove duplicate history > entries. > (init_main): Add "history remove-duplicates" option. > > gdb/doc/ChangeLog: > > * gdb.texinfo (Command History): Document the new option > "history remove-duplicates". > > gdb/testsuite/ChangeLog: > > * gdb.base/history-duplicates.exp: New test. OK for the documentation parts. Thanks.