Add comment to explain some confusing logic that we do have to keep

This commit is contained in:
David Dworken 2023-11-18 12:22:34 -08:00
parent 5bf734606f
commit 05088d4bed

View File

@ -567,6 +567,10 @@ func maybeSkipBashHistTimePrefix(cmdLine string) (string, error) {
}
func parseCrossPlatformTime(data string) time.Time {
// Note that this code is required to handle the case where timestamps are passed from `date %s%N`.
// As of f1a36d2, this is no longer the case. But, we want to ensure that when people upgrade from
// the old version (where they'll have an active shell session still using date) that we handle it
// properly. So we sadly have to keep this lax parsing code around indefinitely.
data = strings.TrimSuffix(data, "N") // Trim the N suffix that is present on MacOS where the date CLI doesn't support %N
startTime, err := strconv.ParseInt(data, 10, 64)
lib.CheckFatalError(err)