Re: [PATCH] bash-4.2-release-with-unlimited-history-by-crq.diff

2012-11-08 Thread Chet Ramey
On 10/31/12 3:43 PM, cheng renquan wrote:

> 1) HISTFILESIZE has a bug that current bash manual saying if HISTFILESIZE
> is unset, then HISTFILE will be unlimited, but it seems there is no way to
> unset it in bash_profile or any rc file?

Yeah, that's a problem.  The next release of bash will change things so
that setting HISTFILESIZE to a value < 0 in a startup file will result in
the history file not being truncated.

> 2) remove duplicates in HISTFILE also, not just in current history in
> memory, we can say this a deep dedup? it only run deep dedup when
> HC_ERASEDUPS set,

I'd rather see this done (and have adapted your previous code submission to
do so) in a separate program that links with the history library and can
operate on arbitrary history files outside of bash.  There are applications
besides bash that use readline, save history, and could benefit.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



Re: [PATCH] bash-4.2-release-with-unlimited-history-by-crq.diff

2012-11-08 Thread cheng renquan
On Thu, Nov 8, 2012 at 3:22 PM, Chet Ramey  wrote:
>> 2) remove duplicates in HISTFILE also, not just in current history in
>> memory, we can say this a deep dedup? it only run deep dedup when
>> HC_ERASEDUPS set,
>
> I'd rather see this done (and have adapted your previous code submission to
> do so) in a separate program that links with the history library and can
> operate on arbitrary history files outside of bash.  There are applications
> besides bash that use readline, save history, and could benefit.

while the current erasedups logic is implemented in bash, I want this
also get into bash,
we may define another control like "erasedupsinfile" if the user set
that we will erase dups in history file as well

HISTCONTROL=ignorespace:ignoredups:erasedups:erasedupsinfile


if we contribute a binary to dedup in history file, we still need the
logic to call it automatically, depending some similar control
variable is set