[PATCH] dim: Sort sparse output after remapping
Jani Nikula
jani.nikula at linux.intel.com
Fri Aug 2 13:13:42 UTC 2019
On Fri, 05 Jul 2019, Arkadiusz Hiler <arkadiusz.hiler at intel.com> wrote:
> If patch happens to move lines around it's easy to end in a situation
> where we end up with errors just moving around:
>
> -error1:123
> error2:124
> +error1:125
>
> With remapping, sorting and then diffing without context we end up with:
> -error1:123
> +error1:123
>
> Which is quite confusing and should not generate warning in the first
> place.
>
> This can be fixed by sorting the lines *after* the remapping.
Pushed, thanks for the patch, and sorry for the delay.
These are some of the more confusing lines for me in dim...
BR,
Jani.
>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Reported-by: Oleg Vasilev <oleg.vasilev at intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> ---
> dim | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/dim b/dim
> index bada79c..1cfe090 100755
> --- a/dim
> +++ b/dim
> @@ -1792,13 +1792,13 @@ function dim_sparse
>
> for commit in "${commits[@]}"; do
> touch --no-create $(git diff --name-only $commit~...$commit)
> - prev_sr="$(make C=1 -j$(nproc) drivers/gpu/drm/ 2>&1 1>/dev/null | sort)"
> + prev_sr="$(make C=1 -j$(nproc) drivers/gpu/drm/ 2>&1 1>/dev/null)"
>
> git checkout --detach $commit >/dev/null 2>&1
> - sr="$(make C=1 -j$(nproc) drivers/gpu/drm/ 2>&1 1>/dev/null | sort)"
> + sr="$(make C=1 -j$(nproc) drivers/gpu/drm/ 2>&1 1>/dev/null)"
>
> prev_remapped="$(echo "$prev_sr" | $remap_log <(git diff HEAD~ | $remap_log))"
> - diff_result="$(diff -u <(echo "$prev_remapped") <(echo "$sr") || true)"
> + diff_result="$(diff -u <(echo "$prev_remapped" | sort) <(echo "$sr" | sort) || true)"
>
> echo "Commit: $(git log -n1 --format='%s' $commit)"
> if [ -n "$diff_result" ]; then
--
Jani Nikula, Intel Open Source Graphics Center
More information about the dim-tools
mailing list