Commits


replace date, strftime %G-%m-%d with %F Use the more predictable %F, aka %Y-%m-%d, instead of %G-%m-%d. %G follows the definition of ISO-8601 week-based year, which is weird. In particular, 2024 is one of such years with weird behaviour: $ date -jf %Y-%m-%d +"%F %G-%m-%d" 2024-12-30 2024-12-30 2025-12-30 Diff from Lucas Gabriel Vuotto (thanks!); stsp agrees


tog: add basic regress for log limit and log search This required minor changes to tog.c to teach tog the new test instructions and feed it search terms when driven by the harness. More is needed for these features but this provides some basic coverage for the & and / log keymaps. ok stsp


regress: nix 'set -A' kshism from tests As reported by naddy, this is a non-portable Korn shell construct. Instead, use the one argument array then make faux space-delimited string "arrays" for the other ids; they can still be indexed with pop_idx. improved by + ok naddy@


load tog's worktree base commit marker in the log thread for startup speed Walking the whole file index can take some time. Avoid delaying the perceived start-up time of tog by reading the file index in the background log thread. Problem pointed out by op@ with fixes from + ok jamsek


tog: show work tree base commit marker in log view If tog is invoked in a work tree, prefix the base commit log message summary line with a '*' if the work tree is up-to-date, and with a '~' if the base commit is not up-to-date with respect to the branch tip or it contains mixed commits. While here, plug a couple worktree leaks in cmd_ref() and cmd_tree(). ok stsp@


tog: add support for commit keywords Allow keywords as arguments to options and operands for the blame, diff, log, and tree commands. Also, return 1 when exiting tog with error rather than 0 so regress can discern success from failure. ok stsp@


show reference labels next to commit messages in tog log view requested by mpi@ ok op@


tog: rename regress test script envvar As per stsp's idea: use a more descriptive name, and use the TOG_TEST_SCRIPT envvar both in tog.c and the test scripts. ok stsp@


tog: basic diff view test and fix hardcoded script path ok stsp@


tog: implement automated test harness Add framework for scripting tog tests by capturing screen dumps to compare with expected output. Includes some preliminary log view tests but lots more tests are needed to cover diff, blame, tree, ref, and help views. ok stsp@