<div dir="ltr">I like this idea. And this kind of "breaking" wouldn't be that bad: instead of their files being changed by the script, users will get a diff on their screen and should figure out easily what's wrong.<br>
<div class="gmail_extra"><br></div><div class="gmail_extra">And this mode will be consistent with clang-format's command line interface, which is really useful.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
<div class="gmail_quote">On Fri, Oct 4, 2013 at 10:28 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Thinking outside the box, it almost makes sense to have Alexander's mode<br>
as the default for this tool because it already works in terms of<br>
patches, then have -i to do an inplace update if requested.<br>
<br>
I like the semantics of diff-in-diff-out and it avoids the question of<br>
what to call the new flag, but it would be a breaking change. Of course<br>
since there are no tests, it wouldn't technically be breaking anything ;-)<br>
<br>
Alp.<br>
<div><div class="h5"><br>
On 04/10/2013 21:02, Daniel Jasper wrote:<br>
><br>
> ================<br>
> Comment at: tools/clang-format/clang-format-diff.py:40<br>
> @@ -36,1 +39,3 @@<br>
>                                     'Reformat changed lines in diff.')<br>
> +  parser.add_argument('-n', action='store_true', default=False,<br>
> +                      help='don\'t change files, instead display what diffs'<br>
> ----------------<br>
> Why "-n" is there precedence in other tools? Otherwise, how about a named parameter? Maybe --dry_run?<br>
><br>
> Or maybe two parameters "--dry_run" (do not apply changes) and "-v" (display diffs)?<br>
><br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D1840" target="_blank">http://llvm-reviews.chandlerc.com/D1840</a><br>
</div></div>> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></blockquote></div>
</div></div>