Idea #20508

Manage committing whitespace changes

Added by Eric Flumerfelt over 2 years ago. Updated over 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


We should try and avoid commits which have formatting changes alongside actual code changes. There are a couple ways of doing this, such as using clang-format on a regular basis or somehow instructing Git to ignore all whitespace changes (or using a pre-commit hook to avoid them).

.clang-format (2.54 KB) .clang-format .clang-format from Gennadiy (In-use in artdaq_database) Eric Flumerfelt, 09/07/2018 11:52 AM
.clang-format (2.76 KB) .clang-format .clang-format from Eric (Similar to formatting used elsewhere in artdaq) Eric Flumerfelt, 09/07/2018 11:52 AM


#1 Updated by Kyle Knoepfel over 2 years ago

Eric, the title of this issue states a possible solution to an unstated problem. I argue that making whitespace-only changes is perfectly reasonable as long as they are not conflated with more substantive changes. A better title would be something like "develop a protocol for making clean commits", where the description can then list possible solutions (e.g.):

  • Formatting-only changes should have separate commits from those with substantive ones
  • Pursue feasibility of instituting common source-code formatting
  • etc.

#2 Updated by Eric Flumerfelt over 2 years ago

  • Subject changed from Avoid committing whitespace changes to Manage committing whitespace changes

#3 Updated by Eric Flumerfelt over 2 years ago

I'm attaching two different .clang-format files. If we can agree on a standard .clang-format file to use for all repositories, we can then run clang-format at regular intervals and commit the resulting white-space changes.

#4 Updated by Eric Flumerfelt over 1 year ago

  • Status changed from New to Closed

.clang-format has been included in all repositories for some time. As of artdaq v3_06_01, all files on all branches are clang-format'ed at each release during the update merge.

Also available in: Atom PDF