This is an archive of the discontinued LLVM Phabricator instance.

Fix quiet mode in git-clang-format
ClosedPublic

Authored by Gvald on Aug 6 2020, 4:08 PM.

Details

Summary

Do not generate output in quiet mode, when no modified files exists

Diff Detail

Event Timeline

Gvald created this revision.Aug 6 2020, 4:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2020, 4:08 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Gvald requested review of this revision.Aug 6 2020, 4:08 PM

Quiet mode is very useful for scripting, when only the diff format output is required, or no output if not formatting is needed.
In case of no modified files, git-clang-format will output to screen even though the quiet mode enabled.

This patch changes this behavior, so if quiet flag passes in - no output will be available, even if no modified files exists.

serge-sans-paille accepted this revision.Aug 7 2020, 1:55 AM
serge-sans-paille added inline comments.
clang/tools/clang-format/git-clang-format
151–152

nit: PEP8 recommends opts.verbose >= 0. LGTM otherwise.

This revision is now accepted and ready to land.Aug 7 2020, 1:55 AM
Gvald updated this revision to Diff 286531.Aug 19 2020, 4:15 AM
Gvald edited the summary of this revision. (Show Details)
Gvald added a project: Restricted Project.

PEP8 compliance fix

Gvald marked an inline comment as done.Aug 19 2020, 4:35 AM

Tried to arc land but don't have the permissions.
From LLVM docs:

It is sufficient to add a comment to the approved review indicating you cannot commit the patch yourself

So here it is, the comment... 😃

Gvald accepted this revision.Aug 25 2020, 6:40 AM
Gvald added a comment.Aug 25 2020, 7:02 AM

@serge-sans-paille - the diff is PEP8 compliant now.
Care to commit, as I don't have the right permissions?

Sure, thanks for your patience!

I'll need a contact email to preserve authorship information, can you send me one at sguelton@redhat.com? Thanks!

This revision was landed with ongoing or failed builds.Aug 26 2020, 9:17 AM
This revision was automatically updated to reflect the committed changes.