Re: Fwd: Default time for unmarked history lines

2016-01-19 Thread Reuben Thomas
On 18 January 2016 at 22:21, Chet Ramey wrote: > On 1/18/16 11:53 AM, Reuben Thomas wrote: > > > So, how about instead interpreting a missing/0 date as a NaD (Not A > Date), > > rather as readline does anyway with time 0, and providing a slightly more > > meaningful message than the current "??".

Re: Fwd: Default time for unmarked history lines

2016-01-18 Thread Chet Ramey
On 1/18/16 11:53 AM, Reuben Thomas wrote: > So, how about instead interpreting a missing/0 date as a NaD (Not A Date), > rather as readline does anyway with time 0, and providing a slightly more > meaningful message than the current "??". Then a) I would be able to remove > all my bogus "1" timest

Fwd: Default time for unmarked history lines

2016-01-18 Thread Reuben Thomas
[ ​Forwarding reply erroneously not sent to the list.]​ On 15 January 2016 at 15:26, Chet Ramey wrote: > On 1/11/16 11:54 AM, Reuben Thomas wrote: > > On 11 January 2016 at 14:22, Chet Ramey > > wrote: > > > > For a history file without any timestamps, using > >

Fwd: Re: Default time for unmarked history lines

2016-01-18 Thread Chet Ramey
--- Begin Message --- On 1/11/16 11:54 AM, Reuben Thomas wrote: > On 11 January 2016 at 14:22, Chet Ramey > wrote: > > For a history file without any timestamps, using > the current default and setting the history entry timestamp to the current > time is mo

Re: Default time for unmarked history lines

2016-01-18 Thread Reuben Thomas
On 11 January 2016 at 14:22, Chet Ramey wrote: > For a history file without any timestamps, using > the current default and setting the history entry timestamp to the current > time is more appropriate. > ​Why is that? The only similar thing I can think of is file systems, where if you zero the

Re: Default time for unmarked history lines

2016-01-11 Thread Chet Ramey
On 1/7/16 11:21 PM, Eduardo A. Bustamante López wrote: > BTW, the timestamp = 0 thing is a bug in readline. Since it uses (time_t) 0 as > a return value for errors in history_get_time, and later there's code similar > to this: > > t = history_get_time(...) > if(t) > strftime(...) >

Re: Default time for unmarked history lines

2016-01-11 Thread Chet Ramey
On 1/7/16 11:33 AM, Reuben Thomas wrote: > Would it be better to have the default time for unmarked history lines to > be the epoch rather than the current time? It is circumstance-dependent. The default you propose would be appropriate for your situation: a history file where you s

Re: Default time for unmarked history lines

2016-01-08 Thread Reuben Thomas
On 8 January 2016 at 04:21, Eduardo A. Bustamante López wrote: > > I now understand your points. > ​Thanks very much for taking a look at this.​ > dualbus@hp ...src/gnu/bash % cat ~/.bash_history > echo 1 > #1452197044 > echo a; sleep 1 > #1452197045 > echo b; sleep 1 >

Re: Default time for unmarked history lines

2016-01-07 Thread Eduardo A . Bustamante López
On Thu, Jan 07, 2016 at 08:56:06PM +, Reuben Thomas wrote: [...] > ​Yes, and it's not at the moment (or wasn't, until I added timestamps to > every line in my history), because the lines at the start of the history, > with no timestamp, were given the current date and time, and lines at the > e

Re: Default time for unmarked history lines

2016-01-07 Thread Reuben Thomas
On 7 January 2016 at 20:07, Eduardo A. Bustamante López wrote: > (2) The history should be ordered monotonically (increasing?) > ​Yes, and it's not at the moment (or wasn't, until I added timestamps to every line in my history), because the lines at the start of the history, with no timestamp, w