<div dir="ltr">Hi Jonas,<div><br></div><div>Thanks for suggestions. I knew about those options, but using them still requires extra work as instead of checking the version by doing a simple</div><div><br></div><div>  $ git clang-format --version</div><div><br></div><div>I have to first determine which clang-format binary there is (depending on the way it is installed it may be called clang-format, clang-format-3.9, clang-format-mp-3.9) and then call version on it. This seems like an unnecessary busy work. Of course, once determined, I could use clangFormat.binary to remember it.</div><div><br></div><div>-Andrey</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 28, 2016 at 2:58 AM, Jonas Devlieghere <span dir="ltr"><<a href="mailto:jonas@devlieghere.com" target="_blank">jonas@devlieghere.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andrey,<br>
<br>
Functionality of `git clang-format` is provided by a python script,<br>
which should just call the clang-format binary that is available in<br>
your path. In other words it should use the same version as you see<br>
when you do<br>
<br>
$ clang-format -version<br>
<br>
However, if for some reason you want to use a different binary, you<br>
can pass it explicitly with<br>
<br>
$ git clang format --binary /path/to/clang-format<br>
<br>
For all the available options, use<br>
<br>
$ git clang-format -h<br>
<br>
or have a look at the underlying script [1].<br>
<br>
Regards,<br>
<br>
Jonas<br>
<br>
[1] <a href="https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/git-clang-format" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/clang/blob/master/<wbr>tools/clang-format/git-clang-<wbr>format</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Sun, Dec 25, 2016 at 7:59 AM, Andrey Prokopenko via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
> Hi list,<br>
><br>
> Is there a way to determine a version of clang-format from running<br>
> git-clang-format?<br>
><br>
> Some background: I have a .clang_format that works for a specific<br>
> clang-format version. I'd also like to be able to use git-clang-format but I<br>
> would need a test to determine whether I should run it. Ideally, there would<br>
> be something like<br>
><br>
>   $ git-clang-format --version<br>
><br>
> which would be equivalent to<br>
><br>
>   $ clang-format --version<br>
><br>
> but I didn't see anything like that. My only workaround at this point is<br>
> start querying all different variant of clang-format executables in $PATH.<br>
><br>
> Thank you.<br>
><br>
> -Andrey<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
><br>
</div></div></blockquote></div><br></div>