Skip to content

freedreno: Re-indent

Rob Clark requested to merge robclark/mesa:wip/whitespace into master

So I did recently realize that git-blame has an option to ignore whitespace, which previously was one of my concerns about re-indenting to match the rest of mesa. And git-rebase has an --ignore-whitespace arg, although it doesn't seem to be very good.. maybe there is some git-filter-branch magic or something like that?

Also, that indent commend isn't quite right (messes up else statements, and open brace for things like structs lands on the next line.

If we did this, ir3/etc would get similar treatment.

Command:

  find . -name \*.\[ch\] -print -exec indent -br -i3 -npcs --no-tabs \{\} \;
  find . -name \*~ -delete

Useful notes:

  • git/tig blame has a -w option to ignore whitespace changes, if you land on this commit while digging thru history add the -w arg
  • git-rebase has an --ignore-whitespace option, but you may potentially need to re-run the indent command at each step in the series you are rebasing

Open questions:

  • Is this going to be a headache for cherry-picking fixes back to stable? Is there a way to mitigate that?

update: I end up going with clang-format.. neither clang-format nor indent are perfect, they both mess up different things. See commit msg for clang-format command.

Edited by Rob Clark

Merge request reports