{"record":{"id":"9641d51707f6d366","repo":"plandex-ai/plandex","slug":"no-timestamp-found-in-log","errorCode":null,"errorMessage":"no timestamp found in log","messagePattern":"no timestamp found in log","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/git.go","lineNumber":224,"sourceCode":"\n\tres, err := exec.Command(\"git\", \"checkout\", path).CombinedOutput()\n\tif err != nil {\n\t\tlog.Println(\"Error checking out file:\", string(res))\n\n\t\treturn fmt.Errorf(\"error checking out file %s | err: %v, output: %s\", path, err, string(res))\n\t}\n\n\treturn nil\n}\n\nconst GitLogTimestampFormat = \"Mon Jan 2, 2006 | 3:04:05pm\"\n\nvar GitLogTimestampRegex = regexp.MustCompile(`\\w{3} \\w{3} \\d{1,2}, \\d{4} \\| \\d{1,2}:\\d{2}:\\d{2}(am|pm) UTC`)\n\nfunc GetGitLogTimestamp(log string) (time.Time, error) {\n\tmatches := GitLogTimestampRegex.FindStringSubmatch(log)\n\tif len(matches) < 2 {\n\t\treturn time.Time{}, fmt.Errorf(\"no timestamp found in log\")\n\t}\n\n\treturn time.Parse(GitLogTimestampFormat, strings.TrimSuffix(matches[0], \" UTC\"))\n}\n\nfunc parseConflictFiles(gitOutput string) []string {\n\tvar conflictFiles []string\n\tlines := strings.Split(gitOutput, \"\\n\")\n\n\tinFilesSection := false\n\n\tfor _, line := range lines {\n\t\tif inFilesSection {\n\t\t\tfile := strings.TrimSpace(line)\n\t\t\tif file == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconflictFiles = append(conflictFiles, strings.TrimSpace(line))","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/git.go#L206-L242","documentation":"GetGitLogTimestamp extracts a timestamp line from a git-log entry using GitLogTimestampRegex (format like 'Mon Jan 2, 2006 | 3:04:05pm UTC'). If the regex cannot find a timestamp capture group in the supplied log string, the library returns this error instead of a time value. It indicates the log text does not match the expected git log pretty format.","triggerScenarios":"Calling GetGitLogTimestamp(log) with a string that lacks a matching timestamp: an empty log, a truncated entry, log output produced with a different pretty format, or a locale where abbreviated weekday/month names differ.","commonSituations":"Feeding raw `git log` output that wasn't formatted with the library's GitLogTimestampFormat, running under a non-English locale (LC_TIME) so 'Mon'/'Jan' become localized names, or parsing an empty result from `git log` in a repo with no commits.","solutions":["Verify the log string came from a git log invocation using the expected pretty format containing 'Mon Jan 2, 2006 | 3:04:05pm UTC' style timestamps.","Ensure git runs with English locale (e.g. LC_ALL=C) so abbreviations match.","Check the repo actually has commits (empty log output yields no match).","Test the string against GitLogTimestampRegex directly to see which part of the format diverges."],"exampleFix":"// before\nt, err := GetGitLogTimestamp(rawLog)\n// after\nif !GitLogTimestampRegex.MatchString(rawLog) {\n    return fmt.Errorf(\"log entry has no parseable timestamp: %q\", rawLog)\n}\nt, err := GetGitLogTimestamp(rawLog)","handlingStrategy":"try-catch","validationCode":"var tsRegex = regexp.MustCompile(`\\w{3} \\w{3} \\d{1,2}, \\d{4} \\| \\d{1,2}:\\d{2}:\\d{2}(am|pm) UTC`)\nif !tsRegex.MatchString(logLine) {\n    // skip entry or use a fallback timestamp\n}","typeGuard":null,"tryCatchPattern":"t, err := GetGitLogTimestamp(logLine)\nif err != nil {\n    log.Printf(\"timestamp missing, skipping entry: %v\", err)\n    return time.Time{}, nil // or skip the entry\n}","preventionTips":["Generate log lines with the same pretty format the parser expects","Force LC_ALL=C so weekday/month abbreviations stay English","Handle empty `git log` output (no commits) before parsing","Unit-test the regex against your actual log output"],"tags":["git","parsing","regex"],"backgroundTag":"log-parse-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}