Giter Site home page Giter Site logo

Comments (15)

stephenlacy avatar stephenlacy commented on August 20, 2024

Can you enter the node_modules/gulp-git/lib and edit commit.js with the following?

Right directly under line 12:

 var cmd = "git commit -m " + escape([message, file.path]) + " " + opt.args;

Add this:

console.log(cmd);

And post the results from the gulp log here?
It may be the UNIX vs win characters escaped in shell-escape

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

Was just doing that :-)

The result is

git commit -m 'initial commit' C:\Users\lotus\projects\gulpjscs\gulpfile.js

Copy/pasting that in the cli gives me the same message but it works if I use double quotes around the message

git commit -m "initial commit" C:\Users\lotus\projects\gulpjscs\gulpfile.js

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

Ah yes!
I now remember that the time (only time ;) ) I was using git on windows I Needed to use the double quotes.
I will need to manually add that in instead of using shell-escape, I hope to get it done shortly.
Thanks for noticing it.

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

Thanks. And thanks for your work already building this.

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

Can you check to see if my latest publish fixed it?

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

Updates?

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

So sorry I got off doing other things and didn't realize you had replied back. Yes I will definitely check it in the morning.

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

Not working for me. Something with the file.cwd now. I added a console.log( cmd, file.cwd); at line 13 in commit.js . Here is what I get.

λ gulp commit
[gulp] Using file C:\Users\lotus\projects\gulpgittest\gulpfile.js
[gulp] Working directory changed to C:\Users\lotus\projects\gulpgittest
[gulp] Running 'commit'...
[gulp] Finished 'commit' in 4.7 ms
git commit -m "initial commit" $'C:\\Users\\lotus\\projects\\repo\\anothertest.txt'  C:\Users\lotus\projects\gulpgittest
git commit -m "initial commit" $'C:\\Users\\lotus\\projects\\repo\\testfile.txt'  C:\Users\lotus\projects\gulpgittest
[gulp] { [Error: Command failed: fatal: Not a git repository (or any of the parent directories): .git
] killed: false, code: 128, signal: null }
[gulp]  fatal: Not a git repository (or any of the parent directories): .git

[gulp] { [Error: Command failed: fatal: Not a git repository (or any of the parent directories): .git
] killed: false, code: 128, signal: null }
[gulp]  fatal: Not a git repository (or any of the parent directories): .git

Here's the task

gulp.task('commit', function() {
    gulp.src('../repo/*')
        .pipe(git.commit('initial commit', {}));
});

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

Did you run git init in the other dir, or this one?

Windows may only allow in path git. Such as the git folder in local ./

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

I made a directory 'repo' next to 'gulpgittest'

Then in repo

git init
touch testfile.txt
git add .
git commit -m "manually running git commands'

git repo is initialized and testfile.txt added and commited correctly

Then

touch anothertestfile.txt
git add .
git status //shows file added and ready for commit
cd ../gulpgittest
gulp commit

Am I misunderstanding? I'm thinking file.cwd should be

C:\Users\lotus\projects\repo

But instead it is the same directory the gulpfile is running from (same as cwd)

C:\Users\lotus\projects\gulpgittest

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

If I initialize a git repo inside gulpgittest it tells me the file is outside the repo so it is trying to run git commit in the local ./

I may be misunderstanding the purpose of this plugin. Is it intended to be inside the actual repo? I was thinking I could use it to run git commands on another directory. That way I could copy files from this directory to a separate repo and then run the git commands on that repo without leaving this directory. That way it can be used as part of a deploy process where the actual repo is outside the project.

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

I will look into the issue, it is designed to allow any folder and look for git from that files cwd, not just the local.
Unless I need to monkey patch it for windows...

from gulp-git.

isimmons avatar isimmons commented on August 20, 2024

Ok, I'll keep messing around with it and let you know if I figure out anything. Thanks

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

Can you confirm that #7 works for you?

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

Can you check now?

from gulp-git.

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.