Skip to content

Commit

Permalink
Add PWD to prepare-commit
Browse files Browse the repository at this point in the history
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 7037c29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/prepare-commit.sh
Expand Up @@ -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
Expand Down

7 comments on commit 7037c29

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 7037c29 Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@NathanW2
Copy link
Member Author

@NathanW2 NathanW2 commented on 7037c29 Dec 11, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 7037c29 Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

@NathanW2 NathanW2 commented on 7037c29 Dec 11, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 7037c29 Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try the above line?

@NathanW2
Copy link
Member Author

@NathanW2 NathanW2 commented on 7037c29 Dec 11, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 7037c29 Dec 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NathanW2 did you succeed to test?

Please sign in to comment.