Question

Ungit looks the perfect tool to learn how git works, as it gives a graphical interface to understand what is going on. I want to share this video explanation (very useful to understand how git works even if you are not planning to use ungit).

It has synchronized my local repository perfectly. Unfortunately, when I have typed the bickbucket git url, it has produced the following error:

Ungit tried to run a git command that resulted in an unhandled error. An automatic bug report was sent.

Command (I didn't type it myself, ungit sent it automatically after typing the URL

git -c color.ui=false -c core.quotepath=false -c core.pager=cat -c credential.helper="C:/Documents and Settings/ch/Datos de programa/npm/node_modules/ungit/bin/credentials-helper 0"  ls-remote --tags prototype-towunderlist2

Error. The error is probably because there are spaces in C:/Documents and Settings:

Error: Command failed: C:/Documents and Settings/ch/Datos de programa/npm/node_modules/ungit/bin/credentials-helper 0 get: C:/Documents: No such file or directory
fatal: could not read Password for 'https://chelder86@bitbucket.org': No such file or directory

It looks a Windows issue for me, so I have published it in stackoverflow instead the ungit bug report system.


UPDATE 1. I have found out how to get by, but I got another error:

fatal: Authentication failed for 'https://chelder86@bitbucket.org/chelder86/prototype-towunderlist2.git/'

To get by, I did the following. I opened a new cmd (command line). I went into the repository directory. I typed the same command but adding single quotes into the double quotes as follows:

Instead:

"C:/Documents and Settings/ch/Datos de programa/npm/node_modules/ungit/bin/credentials-helper 0"

I typed:

"C:/'Documents and Settings'/ch/'Datos de programa'/npm/node_modules/ungit/bin/credentials-helper 0"

Then, a form appeared in the browser to wrote my username and password. I wrote them, and the new error appeared in the command line (not in the user interface of the browser).

Screenshot:

screenshot of the new error


UPDATE 2: the line where is generated the path "C:/Documents and Settings/ch/Datos de programa/npm/node_modules/ungit/bin/credentials-helper 0" is located in C:\Documents and Settings\ch\Datos de programa\npm\node_modules\ungit\source\git-api.js. It is:

  function credentialsOption(socketId) {
    var credentialsHelperPath = path.resolve(__dirname, '..', 'bin', 'credentials-helper').replace(/\\/g, '/');
    return '-c credential.helper="' + credentialsHelperPath + ' ' + socketId + '" ';
  }

I'm not a Javascript expert, so I need some time to find out how to build the correct path...


UPDATE 3: the temporal fix of the code of UPDATE 2 is the following:

[It is a fix, so I wrote it as an answer instead]

Was it helpful?

Solution

The temporal fix of the code of UPDATE 2 is the following:

  function credentialsOption(socketId) {
    var credentialsHelperPath = path.resolve(__dirname, '..', 'bin', 'credentials-helper').replace(/\\/g, '/'); 
    var botchedFix1 = '-c credential.helper="' + credentialsHelperPath + ' ' + socketId + '" ';
    var botchedFix2 = botchedFix1.replace("Documents and Settings","'Documents and Settings'");  
    botchedFix2 = botchedFix2.replace("Datos de programa","'Datos de programa'");   
    return botchedFix2; 
    }

Then, if I click on Fetch Nodes from prototype-towunderlist2 in the user interface of the internet browser (Firefox), I can enter my username and password. Unfortutately, I got a new error:

Command

git -c color.ui=false -c core.quotepath=false -c core.pager=cat -c credential.helper="C:/'Documents and Settings'/ch/'Datos de programa'/npm/node_modules/ungit/bin/credentials-helper 0"  ls-remote --tags prototype-towunderlist2

Error

Error: Command failed: fatal: Authentication failed for 'https://chelder86@bitbucket.org/chelder86/prototype-towunderlist2.git/'

However, if you copy and paste the same command in a new cmd (command line), it seems working perfectly. Push is also working.

Feel free to improve my ugly solution!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top