Skip to content

Commit 294e190

Browse files
Gvaldserge-sans-paille
authored andcommitted
Fix quiet mode in git-clang-format
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. Differential Revision: https://reviews.llvm.org/D85485
1 parent a0aed80 commit 294e190

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/tools/clang-format/git-clang-format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ def main():
148148
for filename in changed_lines:
149149
print(' %s' % filename)
150150
if not changed_lines:
151-
print('no modified files to format')
151+
if opts.verbose >= 0:
152+
print('no modified files to format')
152153
return
153154
# The computed diff outputs absolute paths, so we must cd before accessing
154155
# those files.

0 commit comments

Comments
 (0)