Clang-tidy and version control software

Hi!

My work code base is stored in ClearCase, and files need to be checked
out before making changes. This need to be done before allowing
Clang-tidy to do automatic fixes.

My previous work database used CVS set up in such way, so write
permission need to be added manually.

I think will be good idea to provide possibility in CLang-tidy to call
arbitrary script with file name as parameter which will make necessary
preparation steps in version control software before making changes in
this particular file.

Other tools like Include What You Use or Clazy could benefit from this too.

Eugene.

[Please reply *only* to the list and do not include my email directly
in the To: or Cc: of your reply; otherwise I will not see your reply.
Thanks.]

In article <CAJm83LTY2FcasUnDoRLDrUEYM5iXa_7vvdZ4fA9r_jH62jkXGg@mail.gmail.com>,
    Eugene Zelenko via cfe-dev <cfe-dev@lists.llvm.org> writes:

I think will be good idea to provide possibility in CLang-tidy to call
arbitrary script with file name as parameter which will make necessary
preparation steps in version control software before making changes in
this particular file.

This is not the responsibility of clang-tidy.

It is the responsibility of whatever automated/build framework you
have that is invoking clang-tidy.

[Please reply only to the list and do not include my email directly
in the To: or Cc: of your reply; otherwise I will not see your reply.
Thanks.]

In article <CAJm83LTY2FcasUnDoRLDrUEYM5iXa_7vvdZ4fA9r_jH62jkXGg@mail.gmail.com>,
Eugene Zelenko via cfe-dev <cfe-dev@lists.llvm.org> writes:

I think will be good idea to provide possibility in CLang-tidy to call
arbitrary script with file name as parameter which will make necessary
preparation steps in version control software before making changes in
this particular file.

This is not the responsibility of clang-tidy.

It is the responsibility of whatever automated/build framework you
have that is invoking clang-tidy.

That can’t know ahead of time which files will be changed. I think a hook in clang tooling’s refactoring that users plug into might be a good idea.

Cheesy as it is, when I’ve had to deal with tools like this, I’ve just marked all files as open, done the changes, then unopened any files that didn’t have changes (or, some tools like this have an option to force write a file that’s not open, then to list the files that have changes but aren’t open - so simply pipe that list to the open command)

But yeah, may not be applicable to all such environments, and either option is hardly ‘clean’

Probably running Clang-tidy with option ti fix problem in headers will
benefit most suggested feature, since it's hard to predict which
headers are affected.

Eugene.