Coder Social home page Coder Social logo

Comments (4)

veewee avatar veewee commented on June 16, 2024

I haven't used Git Bash on windows yet. Will try to install it in the weekend.
Is it possible that the C folder symlinks to C: ?
Do you get the same results when you run following commands:

$ cd /C:
$ mkdir test
$ cd test
$ git init
$ grumphp git:init

from grumphp.

lasselehtinen avatar lasselehtinen commented on June 16, 2024

Unfortunately that does not work, because Git Bash maps each Windows drive Letter /letter. So for example C:\test becomes /c/Test.

lasleh@CPB2265 /c/test (master)
$ php -r "var_dump(getcwd());"
string(7) "c:\test"

And both of these work:

cd /c/test
cd c:\test

So I assume there is something funny going on when you try to determine the absolute path when a relative one is given.

from grumphp.

veewee avatar veewee commented on June 16, 2024

Hi @lasselehtinen ,

I tested git bash and it seems to work here:

# I started gi bash with: sh.exe --login
$ cd /C
$ mkdir test
$ cd test
$ git init
$ grumphp configure
$ grumphp git:init

The result I retrieve is:

$ cat .git/hooks/pre-commit
#!/bin/sh
# ...
(cd "./" && exec "c:\Users\Verweto-Win\AppData\Roaming\Composer\vendor\bin/grump
hp" "git:pre-commit" "--config=grumphp.yml" '--skip-success-output')

# ....

Does it work when you manuallt create the .git/hooks folder?
But even when I remove this folder and try it again it is working:

$ rm -rf .git/hooks
$ grumphp git:init
Created git hooks folder at: ./.git/hooks/
Watch out! GrumPHP is sniffing your commits!

Maybe you can try upgrading git bash?

from grumphp.

lasselehtinen avatar lasselehtinen commented on June 16, 2024

That seemed to be the case. I was using old 1.9.3 version of Git Bash whereas updating to 2.6.3 made the problem go away.

from grumphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.