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
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-
owenca 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 "informational"?
Di
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
owenca wrote:
> > It seems that `git-clang-format` was not designed for its output to be
> > consumed by another utility as it prints everything to `stdout` instead of
> > `stderr`. Adding an option like`--print0` (especially just for `--staged`)
> > looks odd to me.
>
> No, the approach of p
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
@@ -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
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
owenca 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 uses. I
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
@@ -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
@@ -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
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
@@ -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
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
@@ -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
@@ -205,6 +205,12 @@ def main():
"commits"
),
)
+p.add_argument(
+"-0",
+"--null",
createyourpersonalaccount wrote:
Done in e2ecb4bfc9dc8d43d7020d0d7476e86a6a29cadf,
9bd8510d2e4739dbb0347694c84360820a5343b1.
https:
@@ -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
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
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
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
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
@@ -205,6 +205,12 @@ def main():
"commits"
),
)
+p.add_argument(
+"-0",
+"--null",
owenca wrote:
Please move it (and `--diff_from_common_commit` above) up to keep the options
sorted.
I would use `--print0` (without
@@ -205,6 +205,12 @@ def main():
"commits"
),
)
+p.add_argument(
+"-0",
+"--null",
+action="store_true",
+help="print the affected paths with null-terminated characters",
owenca wrote:
```suggestion
@@ -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="")
owenca wrote:
> Shouldn't you copy the the indentation of the printed files
@@ -261,14 +267,14 @@ def main():
"ignored by clang-format):"
)
for filename in ignored_files:
-print("%s" % filename)
+print_filename(filename, opts.null)
owenca wrote:
```suggestion
@@ -869,5 +876,12 @@ def convert_string(bytes_input):
return str(bytes_input)
+def print_filename(filename, null=False):
+if null:
+print(filename + "\0", end="")
+else:
+print("%s" % filename)
owenca wrote:
```suggestion
owenca 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?
https://github.com/llvm/llvm-project/pull/123926
___
cfe-commits mailing
https://github.com/owenca 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
@@ -205,6 +205,12 @@ def main():
"commits"
),
)
+p.add_argument(
+"-0",
+"--null",
+action="store_true",
+help="print the affected paths with null-terminated characters",
HazardyKnusperkeks wrote:
I t
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
@@ -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
https://github.com/mydeveloperday 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
@@ -205,6 +205,12 @@ def main():
"commits"
),
)
+p.add_argument(
+"-0",
+"--null",
+action="store_true",
+help="print the affected paths with null-terminated characters",
mydeveloperday wrote:
if you
https://github.com/mydeveloperday requested changes to this pull request.
on reflection, I think better named arguments might be better
https://github.com/llvm/llvm-project/pull/123926
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
mydeveloperday 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 i
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
@@ -869,5 +875,12 @@ def convert_string(bytes_input):
return str(bytes_input)
+def print_filename(filename, null=False):
HazardyKnusperkeks wrote:
If this were C++ I'd say yes, you touched all calls (since you added it). Don't
know if in Python it i
HazardyKnusperkeks 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:_, ev
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
https://github.com/mydeveloperday approved this pull request.
This seems reasonable to me, but wait for the others, maybe @owenca
https://github.com/llvm/llvm-project/pull/123926
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.ll
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
@@ -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
@@ -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
@@ -869,5 +875,12 @@ def convert_string(bytes_input):
return str(bytes_input)
+def print_filename(filename, null=False):
HazardyKnusperkeks wrote:
Why setting a value for null?
https://github.com/llvm/llvm-project/pull/123926
___
@@ -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="")
HazardyKnusperkeks wrote:
Shouldn't you copy the the indentation of the pri
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: Nikolaos Chatzikonstantinou (createyourpersonalaccount)
Changes
This makes the `git clang-format` tool compose nicely with other shell
utilities in case of maliciously (or innocently) crafted filenames.
---
Full diff: https://githu
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
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
49 matches
Mail list logo