Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

error: pathspec 'gistup' did not match any file(s) known to git #22

Open
nswitanek opened this issue Jun 23, 2015 · 15 comments
Open

error: pathspec 'gistup' did not match any file(s) known to git #22

nswitanek opened this issue Jun 23, 2015 · 15 comments

Comments

@nswitanek
Copy link

Hi,

I've followed the "Let's Make a Block" tutorial and gotten stuck trying to run gistup. I've pasted the error below, which isn't addressed in your gistup troubleshooting section. At first I thought it might be a git configuration issue, but it looks like I've not set up my path variables correctly for npm-installed programs to run. Will check that first.

Thank you.

c:\Users\username\AppData\Roaming\npm\node_modules\gistup\lib\gistup\unless.js:11
    throw error;
          ^
Error: Command failed: error: pathspec 'gistup' did not match any file(s) known to git.
error: pathspec 'commit.'' did not match any file(s) known to git.

    at ChildProcess.exithandler (child_process.js:637:15)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
@mbostock
Copy link
Owner

This is almost certainly a Windows issue, and I’m afraid I won’t be much help at solving it. My guess from the cryptic error is that it’s failing inside the gitCommit function:

function gitCommit(callback) {
  child.exec("git commit --allow-empty -m 'Initial gistup commit.'", function(error, stdout, stderr) {
    if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
    if (!error && stdout) process.stdout.write(stdout);
    callback(error);
  });
}

Specifically, it looks like your shell is not correctly parsing the single-quoted commit message (Initial gistup commit.) and is instead passing gistup and commit.' as separate arguments to git. Which of course fails.

It’s possible that gistup could be modified to support Windows, but my guess is that this would require substantial changes. So you might be out of luck. Sorry. 😦

@nswitanek
Copy link
Author

Understood. Thanks very much for your swift reply.

@CrandellWS
Copy link

I can bypass the mentioned error #22 (comment) using underscores like so

function gitCommit(callback) {
  child.exec("git commit --allow-empty -m 'Initial_gistup_commit'", function(error, stdout, stderr) {
    if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
    if (!error && stdout) process.stdout.write(stdout);
    callback(error);
  });
}

@CrandellWS
Copy link

Ok it is creating the Gist on GitHub in MINGW64 using https://github.com/mbostock/gistup/tree/c6f3b193de8a99f6275496ec2dd6761b57c3e598

@CrandellWS
Copy link

So a note to myself CrandellWS@ac982d1 from where I had not realized there was a problem with ssh (had not even tried yet, thought it was setup but do to custom naming convience...)

@CrandellWS
Copy link

Got this much figured out from https://gist.github.com/leommoore/4484379#passing-environment-variables

function gitTestWin(callback) {
  var env = process.env,
    varName,
    envCopy = {};
    // Copy process.env into envCopy
    for (varName in env) {
      envCopy[varName] = env[varName];
    }
    envCopy['wtf'] = 'It is a win thing';
    child.exec("echo %wtf%", { env: envCopy}, function(error, stdout, stderr) {
    if (!error && stderr) process.stderr.write(stderr), error = new Error("It has failed.");
    if (!error && stdout) process.stdout.write(stdout);
    if(error){
      console.warn(error.message);
    }
    console.warn('EXIT');
    process.exit(1);
  });
}

@CrandellWS
Copy link

Cross platform??>

var env = process.env,
varName,
envArgv,
envCopy = {};
// Copy process.env into envCopy
for (varName in env) {
  envCopy[varName] = env[varName];
}
envCopy['wtf'] = 'It is a win thing';

if(process.platform === "win32") {
  envArgv = "%wtf%";
} else {
  envArgv = "$wtf";
}
child.exec("echo " + envArgv, { env: envCopy}, function(error, stdout, stderr) {

@CrandellWS
Copy link

Here is what I have got so far CrandellWS@6114d26

Though it looks like more can still be done.

@CrandellWS
Copy link

With Windows this works

function gitCommit(callback) {
  child.exec('git commit --allow-empty -m "Initial gistup commit"',function(error, stdout, stderr) {
      if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
      if (!error && stdout) process.stdout.write(stdout);
      callback(error);
  });
}

vs this fails

function gitCommit(callback) {
  child.exec("git commit --allow-empty -m 'Initial gistup commit.'", function(error, stdout, stderr) {
    if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
    if (!error && stdout) process.stdout.write(stdout);
    callback(error);
  });
}

do not have current access to linux but it is assumed that there is reason to not just change it like mentioned if only because the message might contain unwanted character and what not...

@CrandellWS
Copy link

bit stuck on Right single quotation mark (U+2019) vs. Apostrophe (U+0027) not sure what to do

@CrandellWS
Copy link

deferred to

 child.exec('git config --get remote.' + crossPlatform.envVal('remoteName') + '.url || '+ crossPlatform.rEcho(),{ env: crossPlatform.newEnvVal('remoteName', argv.remote)}, function(error, stdout, stderr) {

@CrandellWS
Copy link

now you can see the rEcho (returned echo) in cross-platform.js this newer update partially works in MinGW and cmd.exe CrandellWS@010814e

still got the file issue to consider #21

Can Someone test this on a linux system for me

@CrandellWS
Copy link

Windows users will hopefully find success using:

 npm install -g mkg

@CrandellWS
Copy link

The previous package was renamed to mkg so use npm install -g mkg to install.

Was able to get Ubuntu up and running to test the package and found it is now successfully working.

A side note for Ubuntu users getting npm running was not so straight forward. For my purposes the Best Solution To get npm working correctly on Ubuntu:

  1. Option 2 @ https://docs.npmjs.com/getting-started/fixing-npm-permissions
  2. Create soft link to nodejs for node in ~/bin -> ln -s which nodejs ~/bin/node

@gilsedition
Copy link

This issue is fixed with the solution CrandellWS provided. Thanks @CrandellWS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants