summaryrefslogtreecommitdiff
path: root/util/gitconfig/gitconfig.sh
AgeCommit message (Collapse)Author
2018-11-17treewide: use /usr/bin/env where appropriateYegor Timoshenko
Some Unix systems (GuixSD, NixOS) do not install programs like Bash and Python to /usr/bin, and /usr/bin/env has to be used to locate these instead. Change-Id: I7546bcb881c532adc984577ecb0ee2ec4f2efe00 Signed-off-by: Yegor Timoshenko <yegortimoshenko@riseup.net> Reviewed-on: https://review.coreboot.org/28953 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-01-23util/gitconfig: Replace printf with heredocAlex Thiessen
The `gitconfig.sh` script contains a call to `printf` with a lengthy argument where no format string is used at all. Replace it with a heredoc for better readability. Change-Id: I42dbaa570ab9661991fa5d9b4577c9aed05c2981 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23251 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-23util/gitconfig: Use `make` in git hooksAlex Thiessen
As the code was moved from the Makefile.inc to a separate file in commit 9ab8ae6a (util/gitconfig: Make gitconfig a bash script),`$(MAKE)` was replaced by `remake`, introducing dependency on this tool which is basically a `make` with debugging capabilities. Many developers don't have `remake` installed, leading to pre-commit hooks being not executed properly. Apparently this was an unintentional change. Furthermore, special treatment of `make` tool via the `%MAKE%` substitution performed during hooks' deployment is still desired. Use case is calling `remake gitconfig` to set `remake` as the `make` tool in the hooks. To accomplish this, add a parameter that is passed from the Makefile.inc to gitconfig.sh. Change-Id: Ia78e06567b904b342dc9b7778569201fe02e6897 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23096 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
2018-01-22util/gitconfig: Replace subshells with bracesAlex Thiessen
The check for `user.name` and `user.email` being set is done in `gitconfig.sh` and it uses two subshells where none is actually needed. Stream redirection can be consolidated. Change-Id: Ia1d19eb3c11f9d11f030dcc179bc175956cd7116 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23250 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-22util/gitconfig: Update `sup-destroy` git aliasAlex Thiessen
The `git sup-destroy` alias uses a subshell in order to make `git submodule deinit` deinitialize all submodules. This isn't necessary as the `--all` switch does the same. Furthermore, `git submodule init && git submodule update` equals to `git submodule --init`. Change-Id: Ib690d66795da4049bb0bb350a0609cf2e6b5c4c4 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23249 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-18util/gitconfig: Fix too long lines in gitconfig.shAlex Thiessen
Change-Id: Iaff0852259f0a91fb4c906e1a01d77b92f8a49f1 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23248 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-18util/gitconfig: Make gitconfig.sh support gitfileAlex Thiessen
The `gitconfig.sh` script installs hooks to the according directories (for coreboot and its submodules). It has the `hooks` directory hard-coded to be `.git/hooks`, which makes the installation fail when coreboot itself is a submodule because then `.git` becomes a gitfile. Replace hard-coded path handling using the according `git rev-parse` calls. Change-Id: I778e20be24bb27d0081c9e1c12883117d6d50347 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23253 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-10util/gitconfig: Add missing license headersAlex Thiessen
License header for the `gitconfig.sh` was copied from the Makefile it was extracted from in commit 9ab8ae6a (util/gitconfig: Make gitconfig a bash script). License header for the pre-commit hook names Patrick Georgi as the copyright holder as he is the original author. Change-Id: Ie051e5e6ae7571050ece383e6be8236ed7d1ddd9 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23097 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-01-04util/gitconfig: Do not wait for user inputAlex Thiessen
When running `make gitconfig` on a freshly cloned repository, the script will wait for user input without a prompt in a call to `sed`, caused by a spurious newline introduced in commit 9ab8ae6a (util/gitconfig: Make gitconfig a bash script). Change-Id: I2aa722c052d24dcffa9688df09bcf8dc767bd0b6 Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/23059 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-12-15util/gitconfig: Make gitconfig a bash scriptMarc Jones
The gitconfig target has a few bashisms and would fail silently on systems that use a POSIX standard sh (like Ubuntu dash). Remove the code from the makefile and put it in a bash script that is called by the gitconfig target. Change-Id: I3bc8cf688a3ad211b57c8ca0e6b1e86c82dc6a37 Signed-off-by: Marc Jones <marcj303@gmail.com> Reviewed-on: https://review.coreboot.org/22857 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>