A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Define simgrid::xbt::three_way_partition as a generic C++ function.
[simgrid.git]
/
tools
/
git-hooks
/
clang-format.pre-commit
diff --git
a/tools/git-hooks/clang-format.pre-commit
b/tools/git-hooks/clang-format.pre-commit
index
fdedc56
..
8d1bd55
100755
(executable)
--- a/
tools/git-hooks/clang-format.pre-commit
+++ b/
tools/git-hooks/clang-format.pre-commit
@@
-43,7
+43,7
@@
CLANG_FORMAT=$(which clang-format-3.8)
for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do
where=$(which $name)
if [ x != "x$where" ] ; then
for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do
where=$(which $name)
if [ x != "x$where" ] ; then
- GIT_SUBCOMMAND=
`echo $name|sed 's/git-//'`
+ GIT_SUBCOMMAND=
$(echo $name|sed 's/git-//')
break
fi
done
break
fi
done
@@
-74,10
+74,10
@@
canonicalize_filename () {
local result=""
# Need to restore the working directory after work.
local result=""
# Need to restore the working directory after work.
- pushd
`pwd`
> /dev/null
+ pushd
$(pwd)
> /dev/null
cd "$(dirname "$target_file")"
cd "$(dirname "$target_file")"
- target_file=
`basename $target_file`
+ target_file=
$(basename $target_file)
# Iterate down a (possible) chain of symlinks
while [ -L "$target_file" ]
# Iterate down a (possible) chain of symlinks
while [ -L "$target_file" ]
@@
-89,7
+89,7
@@
canonicalize_filename () {
# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
- physical_directory=
`pwd -P`
+ physical_directory=
$(pwd -P)
result="$physical_directory"/"$target_file"
# restore the working directory after work.
result="$physical_directory"/"$target_file"
# restore the working directory after work.
@@
-149,7
+149,9
@@
do
# +++ - timestamp
# to both lines working on the same file and having a a/ and b/ prefix.
# Else it can not be applied with 'git apply'.
# +++ - timestamp
# to both lines working on the same file and having a a/ and b/ prefix.
# Else it can not be applied with 'git apply'.
- git ${GIT_SUBCOMMAND} --binary ${CLANG_FORMAT} --diff -q >> "$patch"
+ git ${GIT_SUBCOMMAND} --binary ${CLANG_FORMAT} --diff -q "$file" \
+ | (grep -v "no modified files to format"||true) \
+ >> "$patch"
#"$CLANG_FORMAT" -style=file "$file" | \
#diff -u "$file" - | \
#sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch"
#"$CLANG_FORMAT" -style=file "$file" | \
#diff -u "$file" - | \
#sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch"