QA/Bibisect/Automation/en

Automation can be done on different levels. Some shells and plugins like Oh My Zsh already have aliases for git. Or we can create our own aliases for efficiency. Or we can use fully automated bibisect.

Tidbits for efficiency
The repetitive nature of bibisecting gets tedious fast, so every trick you can use to make the process quicker is valuable. A typical way is to define aliases for complex commands in your .bashrc file.

The .bashrc of an active bibisecter might include a block such as this:

We have commands for jumping to the next or previous commit, "pycache" for dealing with a Windows-specific annoyance and finally "source" for quickly displaying source commit information. The command named "source" assumes you are in a bibisect repository, grabs the source hash of the currently checked out commit and feeds it to a git command targeting a full clone of the LibreOffice source code. To get a breakdown of the command, see the Bash Reference Manual. "sof" introduces single command for newer repos with instdir and older with opt directories.

The above examples are not exclusive to *nix systems, but work fine in a cygwin environment on Windows. If you want to open documents from the cygwin command line, enclose the ordinary Windows path in single quotes like so: instdir/program/soffice 'c:\users\test\downloads\example.ods'

Another approach would be to assume one will also do reverse bibisects, so use "before" and "after" instead of "good" and "bad". soffice command remains separate and can be replaced with "sof" and combined with "gen" or "skia". "skip" is useful when LO doesn't start, but it can also be temporarily modified when a specific file cannot be loaded. "loexit" is used with "time" to measure loading time with auto exit.

Alias "buildc" opens web page with current commit, showing it's time and author. Function "build" opens master, while "build d376297c643785564e7bda1a74b573c35ade6cb8" checks the specific commit. Function "log 3678e0efcb8bedc58dd329a430da0ac3b1572df8" finds bisect commit of source commit in current repo.

For example, with those commands one can bibisect change in fileopen time, inlcuding in old versions, as:

Automation with scripts
It is possible to automate bisecting with the help of scripts. Command to run bibisect is always the same, we start bibisect and mark old commit as good and new as bad. That works for finding a regression and if we need to find a fix we must compensate in a script. Command git bisect run is run with a script. In simple case, script is run from the current directory and files are already there with contiguous names. But script can be more complex, have parameters and be predefined for user's bug files download folder where original file names are used. Further are examples. Script needs to be executable.

Here is an example with fixed values, finding if convert is correct by looking at PDF size.

Here is the script to check export time for any original and exported extension, comparing to some good time that is determined by user when looking at oldest and master times. Script can also be used to find a fix, if optional last parameter is a word "fix".

Here is the script to use macro and exit, measuring execution time and comparing to some good time. It's advantage is that file can be modified from within. This script also uses timeout time check in case of hang or crash. Command is more complex as it allows for any file name. Exact statuses are found with testing oldest and master commits and script can be modified accordingly.