[PATCH] Added option to clang-format-diff.py to just output diff without changing files.

Alexander Kornienko alexfh at google.com
Mon Oct 7 07:20:34 PDT 2013


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.

And this mode will be consistent with clang-format's command line
interface, which is really useful.

On Fri, Oct 4, 2013 at 10:28 PM, Alp Toker <alp at nuanti.com> wrote:

> Thinking outside the box, it almost makes sense to have Alexander's mode
> as the default for this tool because it already works in terms of
> patches, then have -i to do an inplace update if requested.
>
> I like the semantics of diff-in-diff-out and it avoids the question of
> what to call the new flag, but it would be a breaking change. Of course
> since there are no tests, it wouldn't technically be breaking anything ;-)
>
> Alp.
>
> On 04/10/2013 21:02, Daniel Jasper wrote:
> >
> > ================
> > Comment at: tools/clang-format/clang-format-diff.py:40
> > @@ -36,1 +39,3 @@
> >                                     'Reformat changed lines in diff.')
> > +  parser.add_argument('-n', action='store_true', default=False,
> > +                      help='don\'t change files, instead display what
> diffs'
> > ----------------
> > Why "-n" is there precedence in other tools? Otherwise, how about a
> named parameter? Maybe --dry_run?
> >
> > Or maybe two parameters "--dry_run" (do not apply changes) and "-v"
> (display diffs)?
> >
> >
> > http://llvm-reviews.chandlerc.com/D1840
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131007/3f037160/attachment.html>


More information about the cfe-commits mailing list