Skip to content
Permalink
Browse files

Add PWD to prepare-commit

Running using non Cygwin git (Faster on Win) will return a differnt path format
to cygwin style. So just make sure scripts is in path so everything else
works.
  • Loading branch information
NathanW2 committed Dec 11, 2017
1 parent 3d1d82e commit 7037c2936b7c0bae2ae01401a8ccc403c3a29638
Showing with 1 addition and 1 deletion.
  1. +1 −1 scripts/prepare-commit.sh
@@ -16,7 +16,7 @@

TOPLEVEL=$(git rev-parse --show-toplevel)

PATH=$TOPLEVEL/scripts:$PATH
PATH=$TOPLEVEL/scripts:$PATH:$PWD/scripts

if ! tty -s && [[ "$0" =~ /pre-commit ]]; then
exec </dev/tty

7 comments on commit 7037c29

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Dec 11, 2017

Does git rev-parse --show-toplevel not work on non cygwin git?
commits can be made directly from subdirectories, that breaks this approach.

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Dec 11, 2017

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Dec 11, 2017

Let me ask it the other way round: Is there no safe and reliable way of identifying the toplevel directory in this setup?

Maybe even one that is compatible with both

E.g. TOPLEVEL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Dec 11, 2017

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Dec 11, 2017

Did you try the above line?

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Dec 11, 2017

@m-kuhn

This comment has been minimized.

Copy link
Member

@m-kuhn m-kuhn replied Dec 12, 2017

@NathanW2 did you succeed to test?

Please sign in to comment.
You can’t perform that action at this time.