[cfe-dev] git-clang-format version

Jonas Devlieghere via cfe-dev cfe-dev at lists.llvm.org
Tue Dec 27 23:58:59 PST 2016


Hi Andrey,

Functionality of `git clang-format` is provided by a python script,
which should just call the clang-format binary that is available in
your path. In other words it should use the same version as you see
when you do

$ clang-format -version

However, if for some reason you want to use a different binary, you
can pass it explicitly with

$ git clang format --binary /path/to/clang-format

For all the available options, use

$ git clang-format -h

or have a look at the underlying script [1].

Regards,

Jonas

[1] https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/git-clang-format


On Sun, Dec 25, 2016 at 7:59 AM, Andrey Prokopenko via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> Hi list,
>
> Is there a way to determine a version of clang-format from running
> git-clang-format?
>
> Some background: I have a .clang_format that works for a specific
> clang-format version. I'd also like to be able to use git-clang-format but I
> would need a test to determine whether I should run it. Ideally, there would
> be something like
>
>   $ git-clang-format --version
>
> which would be equivalent to
>
>   $ clang-format --version
>
> but I didn't see anything like that. My only workaround at this point is
> start querying all different variant of clang-format executables in $PATH.
>
> Thank you.
>
> -Andrey
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list