Commit Briefs

Thomas Adam

fix refs_str memory leaks

Pointed out by op@


Thomas Adam

rework how reference labels are rendered in the tog log view

Draw reference labels and log message as separate strings. The previous code contained calculations mixing variables which represent an amount of wide characters in a string vs the display width of the string. We can avoid such nonsense by keeping the strings separate, though we have to be a bit careful about keeping horizontal scrolling intact. Also fix a bug where we failed to account for reference labels while setting view->maxx which made the $ key not scroll far enough. ok op@


Thomas Adam

typo: character -> characters


Thomas Adam

stop showing backup references in the tog log and diff views

Backup references clutter the log view too much now that we display labels next to commit messages. They were accidentally added to the log and diffs view by me, via build_refs_str(), when support for listing backup references was added to the ref view.


Thomas Adam

fix 'tog log' display regression with long reference lists

When the terminal becomes smaller horizontally we did not properly account for remaining columns and the log message of a commit could overflow into the next line, garbling the display.


Thomas Adam

relax build_refs_str to allow a NULL reflist, simplifes the callers

ok stsp@


Thomas Adam

tog: fix segfault in draw_commit

build_refs_str() can succeed returning a NULL string if a commit has some refs pointing to it but that were all filtered out, resulting in a NULL-deref. ok stsp@


Thomas Adam

simplify previous; avoid temporary string

blind ok stsp@


Thomas Adam

show reference labels next to commit messages in tog log view

requested by mpi@ ok op@


Thomas Adam

tog regress: TAB instruction + test for diff J keymap

Add the TAB instruction to the test harness, and a test case for the previous commit: scroll down the log from the diff view with the J keymap when on the last loaded commit. ok stsp@


Thomas Adam

tog: resize log view if toggling fullscreen from child view

We call resize_log_view() when toggling 'F'ullscreen from the log view, but forgot to do this when toggling fullscreen from a child view if its parent is the log view. This fixes a bug that prevents scrolling down the log view from the diff view with the J keymap if already on the last loaded commit. Regress test in the following commit. ok stsp@


Thomas Adam

tog: mark HSPLIT_SCALE as float; unbreak regress on i386

On i386 view_split_begin_y() computed a value slightly different than on other arches, breaking the regress. Casting HSPLIT_SCALE as float unbreaks it. Diff from jamsek, committing on his behalf. Thanks!


Thomas Adam

tog: open screendump file early during regress

we can't open arbitrary files after unveil(), and that's a feature! So, open it early and truncate it before use just in case screendump() ends up being called more than once. ok/tweak stsp, ok jamsek


Thomas Adam

tog: don't check whether stdin is a tty during regress

ok stsp, jamsek


Thomas Adam

tog: don't open /dev/tty during regress

as it might not be there (for e.g. if ran under cron). Reuse instead /dev/null since it's not expected to get input from stdin. ok jamsek


Thomas Adam

tog: always use alternate charset for vertical/horizontal line

ncurses(3) will use the line drawing characters from the VT100 alternate graphics character set if the terminal supports this as indicated by termcap/terminfo, otherwise it will fall back to ASCII replacement characters. ok jamsek stsp


Thomas Adam

tog: teach test harness to count and basic tree tests

Add count instruction to the test harness to simulate count modifier compound keys (e.g., 11j), and add basic tests for the tree view. ok stsp@


Thomas Adam

tog regress: zap needless defines and use "vt220" TERM

Also, overwrite - and | unconditionally when capturing screen dumps, and unset TOG_COLORS and TOG_DIFF_ALGORITHM in regress setup. All tweaks suggested by naddy@ ok stsp@


Thomas Adam

tog regress: use pthread conditions for wait instruction

As suggested by stsp, rather than busy wait in the view loop, use pthread conditions to wait for the blame thread to signal completion before drawing the screen. We can add more conditions for other views when needed, but by keeping the general WAIT_FOR_UI instruction and flag, this should make their use context-dependent so we won't need more test harness WAIT_* instructions. ok stsp@


Thomas Adam

tog: lock mutex if leaving view_loop() on a script read error

ok stsp@


Thomas Adam

tog: tweak blame tog_view deallocation fix from 2ca2f982

Both view_close() and close_blame_view() are called from view_loop() irrespective of error, so only call these from cmd_blame() to ensure the tog_view structure is not leaked when open_blame_view() errors. ok stsp@


Thomas Adam

tog: blame regress and new test framework wait instruction

Basic blame view test required adding the WAIT_FOR_UI instruction to delay screen dumps till the ui has been completely rendered. This will also apply to future test cases such as limited log views and further blame test cases. ok stsp@


Thomas Adam

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@



Thomas Adam

tog: plug tog_view structure leak on open_*_view() error

ok stsp@