[PR PATCH] Simple samba fixes

Uri Simchoni uri at samba.org
Tue Oct 20 20:06:22 UTC 2015


On 10/20/2015 11:02 PM, Jeremy Allison wrote:
> On Tue, Oct 20, 2015 at 10:52:16PM +0300, Uri Simchoni wrote:
>> On 10/20/2015 09:21 PM, Jeremy Allison wrote:
>>> LGTM - pushed. However, there were still whitespace errors that I
>>> had to fix. If you're not going to use vim please learn to flag
>>> whitespace errors in whatever editor you are currently using.
>>> Jeremy.
>> At the risk of stating the obvious... "git clang-format" anyone? :)
>>
>> clang-format really takes the hassle out of formatting, and the git
>> integration (git-clang-format script) makes sure it only re-formats
>> the patch and not adding "formatting hunks".
>>
>> My workflow is to just run "git clang-format" after "git add" and it
>> goes over the staged changes and re-formats them. Then I review the
>> changes made by clang-format and stage them too (or, recently, not
>> review them and just stage them), then commit.
>>
>> I have the following in my ~/.clang-format:
>> BasedOnStyle: LLVM
>> IndentWidth: 8
>> UseTab: true
>> BreakBeforeBraces: Linux
>> AllowShortIfStatementsOnASingleLine: false
>> IndentCaseLabels: false
>>
>> And the following in my ~/.gitconfig:
>> [clangFormat]
>>          style = file
> No you're not stating the obvious. At least I didn't
> know about that command. Git is full of strange little
> nooks and crannies like this :-).
It's not part of git, I think if you do "git foo" then it searches for a 
"git-foo" command and runs it. So you install clang and copy 
git-clang-format to /usr/bin or something similar.



More information about the samba-technical mailing list