<div dir="ltr">That appears to only work against a diff though.  Which means I would have to generate a diff, format it, reset my HEAD back to before I generated the diff, then re-apply it.  Is there nothing that just operates directly on the repo?</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 11:38 AM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Use clang-format-diff.py checked into cfe/tools/clang-format.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 11:25 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>+djasper</div><div><br></div>Ok, just for the record, here's what I do (for context, this discussion is about how to reformat the contents of an existing CL, without touching lines that were not modified by the CL).<div>


<br></div><div>1) Checkout chrome  (wtf right?  I'm sure there's a better workflow, I just don't know what it is.  djasper might though, which is why I've added him)</div><div>2) set the CHROMIUM_BUILDTOOLS_PATH environment variable to point to d:\src\chromium\src\buildtools   (update this for your situation)</div>


<div>3) Update PATH environment variable to point to the version of git that is in chrome's depot_tools</div><div>4) Commit some changes to my local git repo, but don't dcommit them yet.</div><div>5) git cl format<br>


</div><div><br></div><div>This will look through your commit log and collect all the changes that are not upstreamed yet, and reformat those changes, leaving the result in your working copy.  For me, this is usually just a single commit that hasn't been upstreamed yet, so I just git commit --amend to add the formatting to it.</div>


<div><br></div><div>I'm not sure how to do this without chrome's "git cl format" command.  Daniel?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 11:13 AM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Zach,<div><br></div><div>It'd be great if you posted the command line you run to do that.  I'm sure there are others (myself included) that would love to see how that works.</div>


<div><br></div><div>
Thanks!</div><div><br></div><div>-Todd</div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 11:06 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Definitely agree with you on this.  I have no plans to go fixup old code, and I don't think others should either.  And if we see a change go through that does attempt to fix up old code, we should block it.  <div>




<br></div><div>That said, I'm working on a clang-format file that will automate this formatting for us (or at least, for me, should nobody else choose to use it), and I plan to run it against all my changelists before submitting them.  Note that this only reformats lines that have already been touched by the CL, so there's no risk of formatting-only changes making it in.</div>




</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 11:00 AM, Sean Callanan <span dir="ltr"><<a href="mailto:scallanan@apple.com" target="_blank">scallanan@apple.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">One point about this discussion, by the way.<div><br></div><div>While I support adherence to a consistent style for new/changed code, this should in no way be taken as support for going through and fixing indentation/style on old code.</div>




<div>We have internal branches that become hell to merge when e.g. spacing has been altered subtly, or brace depth is changed…</div><div>If we all do our part to clean the parts we’re touching, then I think that will be enough to keep LLDB clean.  </div>




<span><font color="#888888"><div><br></div></font></span><div><span><font color="#888888"><div>
<div>Sean</div>

</div>
<br></font></span><div><blockquote type="cite"><div><div>On Aug 19, 2014, at 10:16 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br></div><div>
<div><div><div dir="ltr">I brought this up in a thread on lldb-commits, but since it is of more general interest, I want to make a thread here as well.<div><br></div><div>Can we have clear direction on LLDB coding style?  Ideally in the form of an update to <a href="http://lldb.llvm.org/" target="_blank">lldb.llvm.org</a>, but as that might require a little more effort, even some details in a response to this thread would be a help.  Some things I've deduced from looking at the code, and other things I'm not so sure about, because of inconsistencies in the code or just no clear rule.</div>





<div><br></div><div>Indentation width: 4</div><div>Column limit: 140  (does this apply to comments too?  Most function-declaration comments seem to wrap at 80)</div><div>Brace style: Allman</div><div>    if (foo)</div><div>





    {</div><div>        // code here</div><div>    }</div><div><br></div><div>Break after function return type: Always, only on declarations, only on definitions, only in headers, or never?</div><div><br></div><div>Space before function parentheses: When?</div>





<div><br></div><div>Indent case labels inside switch: A or B below?</div><div>    switch (foo)</div><div>    {</div><div>        case A:</div><div>    case B:</div><div>    }</div><div><br></div><div>Indent braces inside of a case: A or B below?</div>





<div>    switch (foo)</div><div>    {</div><div>        case A:</div><div>        {</div><div>        }</div><div>        case B:</div><div>            {</div><div>            }</div><div>    }</div><div><br></div><div>Any other rules I should be cognizant of?</div>





</div></div></div><div>
_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>




</div></div></blockquote></div><br></div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div><br><br clear="all"><span><font color="#888888"><div><br></div></font></span></div></div><span><font color="#888888"><span><font color="#888888">-- <br><div dir="ltr">
<table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'">
<tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>



<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>



<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</font></span></font></span></div>
</blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>