This is a simple function for returning the list of config-mode scripts, ordered by priority, that will be called for the proposed commit. As it may have general use it is added here, with motivation from the need to prune scheduled config dependency scripts (T5660).
Note also that in reasoning about priorities and script execution order, one needs to keep in mind the analysis in T5492 while we are still in the situation of the legacy commit-algorithm; conversely, the reference tree data will allow correcting this in the future algorithm, similar to the (simple) construction in the first commit below.