aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pre-commit
AgeCommit message (Collapse)AuthorFilesLines
2018-06-11More shellcheck fixes.Gerald Combs1-12/+15
Change-Id: Iee9e464b3935d4c8a09fa9954f73496eae33f30f Reviewed-on: https://code.wireshark.org/review/28092 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-04Pre-commit: Don't force whitespace checks everywhere.Gerald Combs1-3/+3
Move the whitespace check (git diff-index --check --cached) inside the CHECK_FILES loop, otherwise editing SVGs with Inkscape will be much less convenient. Change-Id: I2b9e3575d54091572caa89e3e317e5e121984010 Reviewed-on: https://code.wireshark.org/review/25144 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-11-28Update message on outdated precommit hookMatthieu Coudron1-1/+1
Change-Id: I3afb93cced09df7844c0810438ee6d760f8237a5 Reviewed-on: https://code.wireshark.org/review/18960 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-11-02pre-commit: fix indentAlexis La Goutte1-1/+1
Change-Id: I50291be3fd275cde8af42c45c17e52345d1c6215 Reviewed-on: https://code.wireshark.org/review/18619 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-02Validate the Diameter XML files in the pre-commit script.Jeff Morriss1-0/+6
Validation requires xmllint but will pass (with a complaint) if the committer does not have xmllint installed. Change-Id: I336a1c8ad8e1f98805a284d8c4736810b1a9c54e Reviewed-on: https://code.wireshark.org/review/18609 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-17Add a comment how to run git review after using --no-verfiy.Joerg Mayer1-0/+3
Change-Id: I07cde41ef6f8074efbb77eacde91b46b62c2f59e Reviewed-on: https://code.wireshark.org/review/18230 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-08-18pre-commit: Ignore missing pre-commit-ignore.pyJoão Valverde1-8/+4
Print error message to stderr and return non-zero exit status from child process. Change-Id: Icd433d79c5a7bf8b6ddd8e94e26695b353e34d1f Reviewed-on: https://code.wireshark.org/review/17116 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: João Valverde <j@v6e.pt>
2016-08-17pre-commit: Make version check work with git-worktreeJoão Valverde1-3/+5
By disabling it outside the main working tree this time. Change-Id: I2075b07370e3cc1395c6de9695e40b0a952e3eab Reviewed-on: https://code.wireshark.org/review/17122 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: João Valverde <j@v6e.pt>
2016-08-15pre-commit: Fix version check to work with git-worktreeJoão Valverde1-1/+1
Change-Id: Ie895ca194738a022cc211ae50afbff0a561156a3 Reviewed-on: https://code.wireshark.org/review/17047 Reviewed-by: João Valverde <j@v6e.pt>
2016-03-24Portably remove CRs from Python output.Guy Harris1-7/+10
The GNU sed manual says the only C-style backslash escapes that can be used in regular expressions in portable sed scripts are \n and \\. The Single UNIX Specification says that \r is one of the C-style backslash escapes that can be used in tr, so use tr -d instead. Change-Id: I40d97ee9b89dfce3d67f062ec8839d3aba998ff3 Reviewed-on: https://code.wireshark.org/review/14606 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-23That's not specific to OS X.Guy Harris1-2/+5
OS X's sed appears to be a *BSD sed, so the same problem might exist on *BSD, or at least some *BSDs, and it might, in fact, be a problem with everything except for GNU sed. Change-Id: I267d9d7eb077c8ec39135bac7eff2c765af3efcf Reviewed-on: https://code.wireshark.org/review/14601 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-23Fix a problem that prevented checkins of all filenames containing theJoerg Mayer1-1/+3
character 'r' on MacOS with an active pre-commit hook. Change-Id: If26fb22d5057794ec0de0def4055310b78a05f89 Reviewed-on: https://code.wireshark.org/review/14600 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-02-25pre-commit: Use uname -a instead.João Valverde1-2/+2
Not all shells support uname -o. Change-Id: Ia6f46f3580f6d7b421da672418dcbee38ad9e60b Reviewed-on: https://code.wireshark.org/review/14143 Reviewed-by: João Valverde <j@v6e.pt>
2016-02-25pre-commit: Avoid launching python subprocesses.João Valverde1-8/+45
This makes Python required only for (portable) fnmatch(). Change the ignore script to work as a filter. Multi-platform improvements. Change-Id: I6ac757d48ba2ff965da5da3dc9c25047a0e37f92 Reviewed-on: https://code.wireshark.org/review/13693 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-28Add fnmatch support to git pre-commit hookJoão Valverde1-25/+11
Allows for wildcard pathname matching in ignore list. Change-Id: I52e47c72c69e16ff9aefadfde22d1bd682df9654 Reviewed-on: https://code.wireshark.org/review/13166 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-05Add basic exclude facility to pre-commit hook checksJoão Valverde1-0/+8
Change-Id: If08fd1481e58f785fed90a7d8c24aa2a1e0f3df7 Reviewed-on: https://code.wireshark.org/review/12958 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-08tools/pre-commit: compare files instead of mtimePeter Wu1-12/+21
Instead of unconditionally checking for the file mtime, compare file contents instead. Perform this check only for invocations via a hook. While at it, simplify setting defaults for the git directory and the commit identifier. Support executions via relative paths and update the help messages on top of the file. Change-Id: I89c015fe6553ad52e07795683dd88cb219a26ed2 Reviewed-on: https://code.wireshark.org/review/8923 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-04-08extcap: Add support for Android - androiddumpMichal Labedzki1-1/+1
androiddump is extcap program that can be used with Android devices (need Android SDK in system PATH). Supported is Logcat/Logger logs and Bluetooth interfaces for all Android to this day (Lollipop). Please note that it will work also for FirefoxOS. Interfaces: 1. Logcat Main (binary or text) 2. Logcat System (binary or text) 3. Logcat Events (binary or text) 4. Logcat Radio (binary or text) 5. Logcat Crash (text; Lollipop) 6. Bluetooth Hcidump (<Kitkat) 7. Bluetooth Bluedroid External Parser (Kitkat) 8. Bluetooth BtsnoopNet (Lollipop) Change-Id: I26e4cd1a37a6af805f8b932399b4aa44ee7b5a80 Reviewed-on: https://code.wireshark.org/review/7475 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-25pre-commit tools: Add arg option to specify the commit id to be checkedAlexis La Goutte1-2/+9
If no commit id specify, it is HEAD Thanks to Michal for the help :-) Change-Id: Ibf579aed47c7574f9a01d868ae0d55bbe789a8a2 Reviewed-on: https://code.wireshark.org/review/5474 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-08Add checkfiltername.pl to pre-commit scriptMichael Mann1-0/+3
Change-Id: I34d8aa7034a4aacc2a95b35a30f25356b33a51b9 Reviewed-on: https://code.wireshark.org/review/5187 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-08-04Don't try and run checkAPIs.pl on deleted filesEvan Huus1-1/+1
It fails, for obvious reasons, and makes it impossible to commit the removal of c/h files. Change-Id: Ifcd067f8959684e2e0191983fd60fb94ae86bca3 Reviewed-on: https://code.wireshark.org/review/3401 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-08pre-commit: Add 'unset GREP_OPTIONS' (similar to Gerrit commit-msg)Bill Meier1-0/+2
msysgit grep is fairly old and doesn't recognize certain grep options, e.g., '--color=auto'. I imagine there may possibly be other grep option issues on various platforms. (I also note that the various git scripts in libexec/git-core clear out GREP_OPTIONS before calling grep). Change-Id: I67bc148a77cfc0167064e61e8c47a5f091704eac Reviewed-on: https://code.wireshark.org/review/2945 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-08tools/pre-commit: Complete all checks on all files before exiting with ↵Bill Meier1-10/+11
Ok/Fail status. Change-Id: Iea6df6fbe5a977b282e823f87cd9f760e92a3e22 Reviewed-on: https://code.wireshark.org/review/2918 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-10Current test for GIT_DIR introduced in changeset ↵Anish Bhatt1-1/+1
Ie1560c372e23e58fb0e310f681388b5e1a65ba5b doesn't seem to be working correctly on bash 4.3.18 : .git/hooks/pre-commit: line 11: .git: command not found This test works correctly in bash/dash/zsh Change-Id: Ic89fc2764d1a70e9e5d112c7928cee6ed783f50f Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2092 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-11It is possible to check out a source tree that is not co-located withJoerg Mayer1-1/+2
the .git repository. First attempts to support that setup. Change-Id: Ie1560c372e23e58fb0e310f681388b5e1a65ba5b Reviewed-on: https://code.wireshark.org/review/1596 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-04-14Fix Bug 9951: 'git commit hook isn't calling checkAPIs.pl with arguments for ↵Hadriel Kaplan1-1/+1
the dissectors' I recently made a change to packet-rtp.c and inappropriately included g_error() in it, which the builbots caught during their run of checkAPIs.pl. But checkAPIs.pl is supposed to catch such things for us before we submit, by being invoked in the git pre-commit hook. Apparently though, buildbots call checkAPIs.pl with extra arguments for different cases... and for packet dissectors it calls it with a '-g abort' argument, which is how it caught the g_error. So the "bug" is that the pre-commit hook should invoke checAPIs.pl with that argument too, for epan/dissectors/packet-*.c files. Change-Id: Ie8f9dcc55f2248918208dea85a04f67e6bf9829a Reviewed-on: https://code.wireshark.org/review/953 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-19Remove duplicate call to fix-encoding-argsEvan Huus1-3/+0
Change-Id: I7067a8856ff1c431d5e5ec7ec2a51228a8613631 Reviewed-on: https://code.wireshark.org/review/743 Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19Add check of whitespace error after Wireshark check (checkhf, checAPIs...)Alexis La Goutte1-3/+4
(Because check whitespace quit after check... and no longer launch other check...) Change-Id: I97ee0191c3d985934e74d23576f88984ec0e9b46 Reviewed-on: https://code.wireshark.org/review/739 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-17Enhance pre-commit tools to avoid false positiveAlexis La Goutte1-1/+1
Limit check to file with extension *.c or *.h Patch revert by mistake in 49394d3101ec286b335213a9845b6d4202955021 Change-Id: Ifed4c833c740218e5e24b3176dc20802fa5849bb Reviewed-on: https://code.wireshark.org/review/719 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-13Pre-Commit Hook check to check for newer versionRoland Knall1-0/+5
Insert a short check to always check for newer versions in the tool directory of the pre-commit script So far, only a warning is being generated, allowing the developer to decide for him/herself Change-Id: I6fce60e3de1d051757d0ed38eae8fdc94cec7662 Reviewed-on: https://code.wireshark.org/review/633 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-06Update Wireshark pre-commit tools (Add check for trailing whitespace based ↵Alexis La Goutte1-3/+5
from git pre-commit.sample) Change-Id: If8f5f48dfd96c3657036f7b59b6ca905c9d24043 Reviewed-on: https://code.wireshark.org/review/531 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-20Enhance pre-commit tools to avoid false positiveAlexis La Goutte1-1/+1
Limit check to file with extension *.c or *.h Change-Id: I6e237e6fd053083d271924120973a6b07e2d4e53 Reviewed-on: https://code.wireshark.org/review/247 Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-14Remove $Id$ and other Subversion leftovers from the tools.Jeff Morriss1-2/+0
There are a few things in here which could still use attention. Don't regenerate anything now. Change-Id: I283c224d3523212144707fca3d6265916cb11792 Reviewed-on: https://code.wireshark.org/review/205 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2013-09-09Add my pre-commit git script (with checkAPI/hf/encoding args...) Need to ↵Alexis La Goutte1-0/+44
copy in .git/hooks folder and will be launch all check when make local commit (if there is some false-positive add --no-verify to disable check) Should be enhance to be better (check trailing/whitespace...) svn path=/trunk/; revision=51884