summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format/git-clang-format
Commit message (Collapse)AuthorAgeFilesLines
* [clang-format] [PR36858] Add missing .hh and .cs extensions from python ↵Paul Hoad2019-09-241-1/+2
| | | | | | | | | | | | | | | | | | support utilities Summary: https://bugs.llvm.org/show_bug.cgi?id=36858 identifies .hh as a missing C++ header extension file while making this change I realized there was no support for .cs files which were added recently Reviewers: pseyfert, klimek, owenpan Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67949 llvm-svn: 372760
* [git-clang-format] recognize hxx as a C++ fileMiklos Vajna2019-06-211-1/+1
| | | | | | | | | | | clangd, clang-tidy, etc does that already, no reason why git-clang-format should skip hxx files. Reviewed By: ilya-biryukov Differential Revision: https://reviews.llvm.org/D63621 llvm-svn: 364014
* git-clang-format: Remove trailing whitespace in docstring. NFC.Sam Clegg2019-06-191-13/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D62915 llvm-svn: 363759
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Portable Python script across Python versionSerge Guelton2018-12-181-1/+1
| | | | | | | | Make scripts more future-proof by importing most __future__ stuff. Differential Revision: https://reviews.llvm.org/D55208 llvm-svn: 349504
* [git-clang-format] Process CUDA filesJonas Hahnfeld2018-01-281-0/+1
| | | | | | | | | Clang supports compiling CUDA source files for some time, format them by default as well. Differential Revision: https://reviews.llvm.org/D42589 llvm-svn: 323615
* [clang-format] Allow git-clang-format to handle empty extensions.Eric Fiselier2017-06-151-0/+2
| | | | | | | | | | | Most of libc++'s header files don't use extension. This prevents using git-clang-format on them, which is frustrating. This patch allows empty extensions to be passed using either the --extensions option, or the clangformat.extensions git-config value. llvm-svn: 305437
* Make git-clang-format python 3 compatibleEric Fiselier2017-05-251-4/+30
| | | | | | | | | | | | | | Summary: This patch attempts to make `git-clang-format` both python2 and python3 compatible. Currently it only works in python2. Reviewers: modocache, compnerd, djasper, jbcoe, srhines, ddunbar Reviewed By: jbcoe Subscribers: kimgr, mgorny, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D30773 llvm-svn: 303871
* Fix Python 2 vs 3 incompatability with dict.items() vs iteritems()Eric Fiselier2017-04-201-1/+6
| | | | llvm-svn: 300895
* Begin making git-clang-format python3 compatible.Eric Fiselier2017-04-201-21/+25
| | | | | | | | | | | | | | | | | | | | | | This patch fixes most of the python3 incompatabilities within git-clang-format while keeping the script python2 compatible. There is still one remaining incompatability that prevents using Python3 which is the `str` vs `byte` type change. I plan to put those fixes up for review separately. This patch contains fixes for the following incompatabilities: 1) Use the new style Python3 `print` function. This requires importing __future__.print_function. 2) Fix incompatability between the Python3 octal prefix and the octal prefix Git uses. 3) Replace use of dict.iteritems() with dict.viewitems() because iteritems() has been removed in Python3. viewitems() reviews python 2.7 but that is also what the script is documented as requiring. llvm-svn: 300891
* clang-format: Use git-ls-tree to get file mode in diff modeStephen Hines2016-11-081-1/+10
| | | | | | | | | | | | | | | | | | Summary: If a file has been renamed/deleted from the filesystem and --diff mode with two commits is active, attempting to get the file's mode will fail. This change uses git-ls-tree instead to get the correct permissions for the given revision. Patch by Luis Hector Chavez! Reviewers: djasper, lodato Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D26287 llvm-svn: 286212
* clang-format: Add an option to git-clang-format to diff between to commitsStephen Hines2016-09-221-50/+97
| | | | | | | | | | | | | | | | | | | | | Summary: When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits. This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory. There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead. Patch by Luis Hector Chavez! Reviewers: djasper, lodato Subscribers: lodato, cfe-commits, srhines Projects: #clang-c Differential Revision: https://reviews.llvm.org/D24319 llvm-svn: 282136
* clang-format: Add Java detection to git-clang-format.Stephen Hines2016-09-131-0/+1
| | | | | | | | | | | | | | Summary: This change adds "java" to the list of known extensions that clang-format supports. Patch by Luis Hector Chavez Reviewers: djasper Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D24401 llvm-svn: 281294
* clang-format: Add TypeScript detection to git-clang-format.Daniel Jasper2015-06-191-0/+1
| | | | llvm-svn: 240128
* Use /usr/bin/env python instead of /usr/bin/python.Ed Schouten2014-09-021-1/+1
| | | | | | | | On operating systems like the BSDs, it is typically the case that /usr/bin/python does not exist. We should therefore use /usr/bin/env instead. This is also done in various other scripts in tools/. llvm-svn: 216945
* clang-format: Add proto files and JavaScript to git-clang-format.Daniel Jasper2014-04-091-0/+3
| | | | llvm-svn: 205842
* Simplify git-clang-format by using new -lines option.Daniel Jasper2013-08-011-44/+12
| | | | | | Patch by Mark Lodato. Thank you! llvm-svn: 187592
* Fix ranges computed by git clang-format.Daniel Jasper2013-07-021-2/+2
| | | | | | | | | | | | Before, the computed byte range would include the trailing newline. clang-format on the other hand counts whitespace as belonging to the following token, so that git-clang-format inadvertendly reformats the first unmodified line as well. It is not entirely clear whether clang-format's behavior itself should be modified, but for now this seems to be a safe change. llvm-svn: 185423
* clang-format integration for git.Daniel Jasper2013-05-231-0/+513
Put this somewhere on your path and use: git clang-format Awesome work by Mark Lodato. Many thanks! llvm-svn: 182596
OpenPOWER on IntegriCloud