diff options
author | Jason Merrill <jason@redhat.com> | 2023-12-11 19:38:32 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-12-20 18:08:16 -0500 |
commit | af3fc0306948f5b6abecad8453938c5bedb976fc (patch) | |
tree | d3acde3426a1e13e837ed24c9a7b2a324581aac7 | |
parent | 008b80e42eb7cb55c6a2ef55728241b8733dfd17 (diff) | |
download | gcc-af3fc0306948f5b6abecad8453938c5bedb976fc.zip gcc-af3fc0306948f5b6abecad8453938c5bedb976fc.tar.gz gcc-af3fc0306948f5b6abecad8453938c5bedb976fc.tar.bz2 |
contrib: add git gcc-style alias
I thought it could be easier to use check_GNU_style.py. With this alias,
'git gcc-style' will take a git revision as argument instead of a file, or
check HEAD if no argument is given.
contrib/ChangeLog:
* gcc-git-customization.sh: Add git gcc-style alias.
-rwxr-xr-x | contrib/gcc-git-customization.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh index 2e173e8..54bd35e 100755 --- a/contrib/gcc-git-customization.sh +++ b/contrib/gcc-git-customization.sh @@ -30,6 +30,11 @@ git config alias.gcc-backport '!f() { "`git rev-parse --show-toplevel`/contrib/g git config alias.gcc-fix-changelog '!f() { "`git rev-parse --show-toplevel`/contrib/git-fix-changelog.py" $@; } ; f' git config alias.gcc-mklog '!f() { "`git rev-parse --show-toplevel`/contrib/mklog.py" $@; } ; f' git config alias.gcc-commit-mklog '!f() { "`git rev-parse --show-toplevel`/contrib/git-commit-mklog.py" "$@"; }; f' +git config alias.gcc-style '!f() { + check=`git rev-parse --show-toplevel`/contrib/check_GNU_style.py; + arg=; if [ $# -ge 1 ] && [ "$1" != "-f" ]; then arg="$1"; shift; + elif [ $# -eq 3 ]; then arg="$3"; set -- "$1" "$2"; fi + git show $arg | $check "$@" -; }; f' # Make diff on MD files use "(define" as a function marker. # Use this in conjunction with a .gitattributes file containing |