> On Feb 28, 2015, at 8:57 PM, Leif Hedstrom <zw...@apache.org> wrote:
> 
> 
>> On Feb 28, 2015, at 9:35 PM, Phil Sorber <sor...@apache.org> wrote:
>> 
>> On Wed Feb 25 2015 at 9:15:38 AM James Peach <jpe...@apache.org> wrote:
>> 
>>> 
>>>> On Feb 24, 2015, at 1:59 PM, Leif Hedstrom <zw...@apache.org> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> clang-format has finally gotten to the point where we can get it to
>>> format our code similar, but not quite identical, to what we have today.
>>> Doing all formatting programmatically has several benefits:
>>>> 
>>>> It’s no longer up to subjective or personal preferences, we’ll learn to
>>> live and love the clang-format coding style.
>>>> It can be automated.
>>>> It can also be used as a tool for people who want to work / see code in
>>> a different style, but commit in our standard style.
>>>> 
>>>> 
>>>> I have updated the .clang-format files that is in our Git master, we
>>> might need to do a few more tweaks, but it’s getting pretty close. It does
>>> require a very recent version of clang-format, the one I used is
>>>> 
>>>>     clang-format version 3.6.0 (tags/google/testing/2015-01-13)
>>> 
>>> Does this completely destroy code history?
>>> 
>>> J
>> 
>> 
>> The simple answer to this is: "No, we still use git."
>> 
>> But what I think you are really asking is, "Does `git blame` become less
>> useful?"
>> 
>> While it's true that a simple `git blame` will show lots of format changes
>> instead of what you may deem more useful, I would argue there are better
>> ways to find what you are looking for anyway:
>> http://jfire.io/blog/2012/03/07/code-archaeology-with-git/
> 
> 
> Yeah, that’s a good article. Even a simple -w -M fixes most of the pain. On  
> a clang-format’ed file, e.g.
> 
> heimdall (21:56) 300/0 $ git blame proxy/http/HttpSM.cc | grep 'Leif' | wc -l
>    1465
> heimdall (21:56) 301/0 $ git blame -w -M proxy/http/HttpSM.cc | grep 'Leif' | 
> wc -l
>     680

but top of tree is

jpeach$ git blame -w -M proxy/http/HttpSM.cc | grep 'Leif' | wc -l
     382

So it seems like you will still lose some history, but when I manually compared 
the blame before and after it didn't seem too bad

J


Reply via email to