History log of /llvm-project/clang/tools/clang-format/git-clang-format (Results 1 – 25 of 53)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6
# e25c556a 06-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Reformat git-clang-format with `black -l80`


# fb2cbc00 06-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Reformat Python script git-clang-format with black


# 56ab56c8 03-Dec-2024 Jim B <d3x0r@users.noreply.github.com>

[clang-format] Add support for `.cjs` as JavaScript file extension (#118188)

Node uses `.cjs` as an extension for 'common javascript' modules.


Revision tags: llvmorg-19.1.5
# 6c7b988e 27-Nov-2024 루밀LuMir <rpfos@naver.com>

[clang-format] Add mjs to default_extensions in git-clang-format (#117730)


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 625841c3 21-Aug-2024 magic-akari <akari.ccino@gmail.com>

[clang-format] Use double hyphen for multiple-letter flags (#100978)

- Closes: #100974


Revision tags: llvmorg-19.1.0-rc3
# 986bc3d0 10-Aug-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a serious bug in `git clang-format -f` (#102629)

With the --force (or -f) option, git-clang-format wipes out input files
excluded by a .clang-format-ignore file if they have unst

[clang-format] Fix a serious bug in `git clang-format -f` (#102629)

With the --force (or -f) option, git-clang-format wipes out input files
excluded by a .clang-format-ignore file if they have unstaged changes.

This patch adds a hidden clang-format option --list-ignored that lists
such excluded files for git-clang-format to filter out.

Fixes #102459.

show more ...


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# aeaae531 06-Dec-2023 Aiden Grossman <agrossman154@yahoo.com>

[clang-format] Add "three dot" diff option to git-clang-format (#74230)

This patch adds in the ability to do a "three dot" git-clang-format
between two commits. This looks at the diff between the s

[clang-format] Add "three dot" diff option to git-clang-format (#74230)

This patch adds in the ability to do a "three dot" git-clang-format
between two commits. This looks at the diff between the second commit
and the common merge base rather than comparing at the point of the
specified commits. This is needed to improve the reliability of the LLVM
code formatting CI action which currently breaks in some cases where
files have been modified in the upstream tree and when the person
created their branch, leaving phantom formatting diffs that weren't
touched by the PR author.

Part of a fix for #73873

show more ...


# 78940a4e 04-Dec-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in `git-clang-format --binary` (#74293)

This is a rework of #74176, which erroneously changed the default
clang-format filename (`clang-format`, `clang-format.exe`, etc.) t

[clang-format] Fix a bug in `git-clang-format --binary` (#74293)

This is a rework of #74176, which erroneously changed the default
clang-format filename (`clang-format`, `clang-format.exe`, etc.) to an
absolute pathname. Instead, we should do that only if the name is a
pathname, e.g. `./clang-format`,
`llvm-project/build/bin/clang-format.exe`, etc. See also
https://github.com/llvm/llvm-project/pull/74176#issuecomment-1837921351.

show more ...


# 2a3f1195 03-Dec-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in `git-clang-format --binary` (#74176)

Fixed #74165.


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0
# 743659be 08-Sep-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a serious bug in git-clang-format (#65723)

When applying format changes to staged files, git-clang-format
erroneously checks out all files in the index and thus may overwrite
un

[clang-format] Fix a serious bug in git-clang-format (#65723)

When applying format changes to staged files, git-clang-format
erroneously checks out all files in the index and thus may overwrite
unstaged changes.

Fixes #65643.

show more ...


# a8fbc16e 07-Sep-2023 Owen Pan <owenpiano@gmail.com>

Revert "[git-clang-format] Fix typo in help message"

This reverts commit d099dbb221a4c3474a15117b1658dedc5dcd6ebf as
'git clang-format' is the idiomatic way of running git-clang-format.


Revision tags: llvmorg-17.0.0-rc4
# d099dbb2 30-Aug-2023 Jim Lin <jim@andestech.com>

[git-clang-format] Fix typo in help message

`git clang-format` -> `git-clang-format`


Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 825cec2c 04-Jul-2023 sstwcw <su3e8a96kzlver@posteo.net>

[clang-format] Add Verilog suffixes to the scripts

I decided not to wait for D149088 because it was taking a long time.

The capture group in the regexp was changed to non-capturing. It
doesn't nee

[clang-format] Add Verilog suffixes to the scripts

I decided not to wait for D149088 because it was taking a long time.

The capture group in the regexp was changed to non-capturing. It
doesn't need to be captured.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D154467

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# c31bc7bd 18-Feb-2023 Michael Kirk <michaelkirk@users.noreply.github.com>

[clang-format] Handle tabs in file path for git-clang-format


Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# ae918c78 03-Dec-2022 Alexandre Ganea <alex_toresh@yahoo.fr>

[clang-format] Add .inc extension to git-clang-format

Differential Revision: https://reviews.llvm.org/D138746


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3
# 3f801e07 11-Aug-2022 Gergely Meszaros <meszaros.gergely97@gmail.com>

[clang-format] git-clang-format --staged should format the index

When --staged (or --cached) use the index for formatting as well, not just
for the line numbers to format. Without this change git-cl

[clang-format] git-clang-format --staged should format the index

When --staged (or --cached) use the index for formatting as well, not just
for the line numbers to format. Without this change git-clang-format gets
the changed line numbers based on the index, but then formats these lines on
the working tree version of the file.

This is a problem when the working tree and index differ. One common case
would be (and is the motivation behind this patch) when applying the
suggested changes git-clang-format --staged, then forgetting to add the
applied changes. When git-clang-format --staged --diff is used in a
pre-commit hook in this scenario, then the hook would allow committing the
improperly formatted changes, as the file is correctly formatted in the work
tree.

Fixes #56797.

Differential Revision: https://reviews.llvm.org/D130108

show more ...


Revision tags: llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1
# f9a2f6b6 28-Jul-2022 Sridhar Gopinath <sridhar.g@utexas.edu>

[clang-format] Fix the return code of git-clang-format

In diff and diffstat modes, the return code is != 0 even when there are no
changes between commits. This issue can be fixed by passing --exit-c

[clang-format] Fix the return code of git-clang-format

In diff and diffstat modes, the return code is != 0 even when there are no
changes between commits. This issue can be fixed by passing --exit-code to
git-diff command that returns 0 when there are no changes and using that as
the return code for git-clang-format.

Fixes #56736.

Differential Revision: https://reviews.llvm.org/D129311

show more ...


Revision tags: llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2
# c94a02e0 22-Apr-2022 Nico Weber <thakis@chromium.org>

[git-clang-format] Change run line from python to python3

Several systems no longer ship `python`.

Differential Revision: https://reviews.llvm.org/D124280


# a45764f2 22-Apr-2022 Nico Weber <thakis@chromium.org>

[git-clang-format] Add some examples to the help text

Differential Revision: https://reviews.llvm.org/D124282


Revision tags: llvmorg-14.0.1
# 357afd95 05-Apr-2022 owenca <owenpiano@gmail.com>

[clang-format] Pass return code of git-clang-format by sys.exit()

Fixes #54758


Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3
# edbb8a84 16-Jan-2022 owenca <owenpiano@gmail.com>

[clang-format] Add return code to git-clang-format

https://github.com/llvm/llvm-project/issues/53220

Differential Revision: https://reviews.llvm.org/D117414


Revision tags: llvmorg-13.0.1-rc2
# cea81e95 14-Dec-2021 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] add support for cppm files

C++20 Modules current style is to assign a new file suffix .cppm.

https://github.com/llvm/llvm-project/issues/52658

Ensure git-clang-format can handle tha

[clang-format] add support for cppm files

C++20 Modules current style is to assign a new file suffix .cppm.

https://github.com/llvm/llvm-project/issues/52658

Ensure git-clang-format can handle that as a default extension

Reviewed By: ChuanqiXu, HazardyKnusperkeks, curdeius

Differential Revision: https://reviews.llvm.org/D115625

Fixes: #52658

show more ...


Revision tags: llvmorg-13.0.1-rc1
# bee61aa7 30-Oct-2021 Erik Larsson <karl.erik.larsson@gmail.com>

[clang-format] Add --staged/--cached option to git-clang-format

When running git-clang-format in a pre-commit hook it's very useful to be able to tell git-clang-format to only look at the --staged/-

[clang-format] Add --staged/--cached option to git-clang-format

When running git-clang-format in a pre-commit hook it's very useful to be able to tell git-clang-format to only look at the --staged/--cached files and not the working directory.

Note this patch is a rebase/fork from {D41147 } which is a fork of {D15465 }

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, lodato

Differential Revision: https://reviews.llvm.org/D90996

Co-authored-by: Mark Lodato <lodato@google.com>

show more ...


# 5e969125 20-Oct-2021 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] git-clang-format throws an assertion when removing files as part of the commit

Following a change {D111273} to allow git-clang-format to see single lines being removed,
we introduced

[clang-format] git-clang-format throws an assertion when removing files as part of the commit

Following a change {D111273} to allow git-clang-format to see single lines being removed,
we introduced a regression such that if you are removing a whole file it will
assert in clang-format as its given the -lines=0:0 (lines are 1 based)

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D112056

show more ...


# 191a3953 15-Oct-2021 Roland Fischer <roli@gugus.ca>

[git-clang-format] Add --diffstat parameter

[git-clang-format][PR46815] Add diffstat functionality

Adding a --diffstat parameter to git-clang-format that essentially uses git diff --stat, i.e. list

[git-clang-format] Add --diffstat parameter

[git-clang-format][PR46815] Add diffstat functionality

Adding a --diffstat parameter to git-clang-format that essentially uses git diff --stat, i.e. lists the files needing
formatting. This is useful for CI integration or manual usage where one wants to list the files not properly formatted.

I use it for the Suricata project's github action (CI) integration that verifies proper formatting of a pull request
according to project guidelines where it's very helpful to say which files are not properly formatted. I find the list
of files much more useful than e.g. showing the diff in this case using git-clang-format --diff.

An alternative would be to take an additional parameter to diff, e.g. git-clang-format --diff --stat

The goal is not to provide the whole git diff --stat=... parameter functionality, just plain git diff --stat.

Reviewed By: MyDeveloperDay, JakeMerdichAMD

Differential Revision: https://reviews.llvm.org/D84375

show more ...


123