[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-09 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount closed https://github.com/llvm/llvm-project/pull/123926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-09 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: I don't know what you're talking about. I know however that you're bikeshedding. Sad. https://github.com/llvm/llvm-project/pull/123926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-09 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: > Diagnostic output should go to stderr, but the informational output of > git-clang-format is sent to stdout instead. What does that mean? The printing of null-terminated paths on stdout is pretty standard on unix utilities. What's "diagnostic" and "information

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-08 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: @owenca ping https://github.com/llvm/llvm-project/pull/123926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-08 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -260,15 +265,13 @@ def main(): "Ignoring the following files (wrong extension, symlink, or " "ignored by clang-format):" ) -for filename in ignored_files: -print("%s" % filename) +print_f

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: > > > From #123921, it seems that you only want the new option to work with > > > `--staged`, but should it also work with other options that may print a > > > list of filenames? > > > > > > I don't know; I only use `git clang-format` as in #123921 and I am no

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount edited https://github.com/llvm/llvm-project/pull/123926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -260,15 +265,13 @@ def main(): "Ignoring the following files (wrong extension, symlink, or " "ignored by clang-format):" ) -for filename in ignored_files: -print("%s" % filename) +print_f

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-01 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: @owenca @mydeveloperday @HazardyKnusperkeks I'll ping now that it's the weekend, perhaps you have some time to look at this more; in particular now I got the `--null` option to work for `--staged`, but I'm not sure how you'd like it to work for other options. I

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -869,5 +875,12 @@ def convert_string(bytes_input): return str(bytes_input) +def print_filename(filename, null=False): createyourpersonalaccount wrote: I removed the default value of the argument in c47ce3ca8946f81f39757c82bfa5eb4cddc863a5. https

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount updated https://github.com/llvm/llvm-project/pull/123926 >From 9dfbb9a3cc7f6bc557bc1ccf25cc727a02c4274c Mon Sep 17 00:00:00 2001 From: Nikolaos Chatzikonstantinou Date: Wed, 22 Jan 2025 05:43:02 -0500 Subject: [PATCH 1/8] [clang-format] Add null-term

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -205,6 +205,12 @@ def main(): "commits" ), ) +p.add_argument( +"-0", +"--null", +action="store_true", +help="print the affected paths with null-terminated characters", createyourpersonalaccount wrot

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -205,6 +205,12 @@ def main(): "commits" ), ) +p.add_argument( +"-0", +"--null", createyourpersonalaccount wrote: Done in e2ecb4bfc9dc8d43d7020d0d7476e86a6a29cadf, 9bd8510d2e4739dbb0347694c84360820a5343b1. https:

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -261,14 +267,14 @@ def main(): "ignored by clang-format):" ) for filename in ignored_files: -print("%s" % filename) +print_filename(filename, opts.null) createyourpersonalaccount wro

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount updated https://github.com/llvm/llvm-project/pull/123926 >From 9dfbb9a3cc7f6bc557bc1ccf25cc727a02c4274c Mon Sep 17 00:00:00 2001 From: Nikolaos Chatzikonstantinou Date: Wed, 22 Jan 2025 05:43:02 -0500 Subject: [PATCH 1/7] [clang-format] Add null-term

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount updated https://github.com/llvm/llvm-project/pull/123926 >From 9dfbb9a3cc7f6bc557bc1ccf25cc727a02c4274c Mon Sep 17 00:00:00 2001 From: Nikolaos Chatzikonstantinou Date: Wed, 22 Jan 2025 05:43:02 -0500 Subject: [PATCH 1/4] [clang-format] Add null-term

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount updated https://github.com/llvm/llvm-project/pull/123926 >From 9dfbb9a3cc7f6bc557bc1ccf25cc727a02c4274c Mon Sep 17 00:00:00 2001 From: Nikolaos Chatzikonstantinou Date: Wed, 22 Jan 2025 05:43:02 -0500 Subject: [PATCH 1/3] [clang-format] Add null-term

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-26 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: > From #123921, it seems that you only want the new option to work with > `--staged`, but should it also work with other options that may print a list > of filenames? I don't know; I only use `git clang-format` as in #123921 and I am not familiar with all its

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-24 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount updated https://github.com/llvm/llvm-project/pull/123926 >From 9dfbb9a3cc7f6bc557bc1ccf25cc727a02c4274c Mon Sep 17 00:00:00 2001 From: Nikolaos Chatzikonstantinou Date: Wed, 22 Jan 2025 05:43:02 -0500 Subject: [PATCH 1/2] [clang-format] Add null-term

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-24 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -205,6 +205,12 @@ def main(): "commits" ), ) +p.add_argument( +"-0", +"--null", +action="store_true", +help="print the affected paths with null-terminated characters", createyourpersonalaccount wrot

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-23 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: > > > This seems reasonable to me, but wait for the others, maybe @owenca > > > > > > I'm wondering if `-0` should turn off all informational messaging as well > > and _only_ print the paths. As it is, it will print things like _Running > > clang-format on the

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-23 Thread Nikolaos Chatzikonstantinou via cfe-commits
createyourpersonalaccount wrote: > This seems reasonable to me, but wait for the others, maybe @owenca I'm wondering if `-0` should turn off all informational messaging as well and *only* print the paths. As it is, it will print things like _Running clang-format on the following files:_, even

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-23 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount edited https://github.com/llvm/llvm-project/pull/123926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-22 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -869,5 +875,12 @@ def convert_string(bytes_input): return str(bytes_input) +def print_filename(filename, null=False): createyourpersonalaccount wrote: I think that was a reflex, I set it to `False`, which is what `opts.null` is by default. Do you

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-22 Thread Nikolaos Chatzikonstantinou via cfe-commits
@@ -869,5 +875,12 @@ def convert_string(bytes_input): return str(bytes_input) +def print_filename(filename, null=False): +if null: +print(filename + "\0", end="") createyourpersonalaccount wrote: I don't think so, because indentation is m

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-22 Thread Nikolaos Chatzikonstantinou via cfe-commits
https://github.com/createyourpersonalaccount created https://github.com/llvm/llvm-project/pull/123926 This makes the `git clang-format` tool compose nicely with other shell utilities in case of maliciously (or innocently) crafted filenames. >From 9dfbb9a3cc7f6bc557bc1ccf25cc727a02c4274c Mon Se