On 7/3/25 8:29 AM, Dr. Werner Fink wrote:
On 2025/06/26 09:48:03 -0400, Chet Ramey wrote:On 6/26/25 4:01 AM, Hongbo Li wrote:This issue is observed in bash with various distributions (SLES12, SLES15, Debian12, etc). When HISTFILESIZE is set to be less than or equal to HISTSIZE, the timestamp of the oldest command will be truncated.Thanks for the report. This was fixed back in March, 2023 as the result of https://lists.gnu.org/archive/html/bug-bash/2023-03/msg00063.html and the fix is in bash-5.3.Hi, just out of curiosity, is there a specific commit for this fix? We have identfied the commit 622d318652fff7eb5ad5ff3ecdcfc3c6b82ebfd7 but that is a huge one
In general, the way to deal with changes that you don't want in the commits is 1. Identify the commit(https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=64b2b7c08d427796d75411f5d3ea46e585ad2d4b)
Navigate to that commit on savannah. (I don't know which commit you're looking at, but this is the one in the devel branch.) Here is the commit message: "fixes for glibc time/gettimeofday issue; fix issue with history file containing one line too few if saving timestamps; fix for signal arriving while displaying readline completions" 2. Look at the change log in the source tree, identify the changed files. +lib/readline/history.c + - history_truncate_file: fix off-by-one error that resulted in the + timestamp associated with the first history entry not being written + to the truncated history file + From a report by Grisha Levit <grishale...@gmail.com> 3. Look at the parts of the commit you're interested in (the diffs are there on savannah). diff --git a/lib/readline/histfile.c b/lib/readline/histfile.c index a3c8d9bf..2af71d35 100644 --- a/lib/readline/histfile.c +++ b/lib/readline/histfile.c ... 4. Extract the diff, apply it to whatever sources you want, and test. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature