Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request 'log' failed from scm amend #5435

Closed
akosyakov opened this issue Jun 12, 2019 · 10 comments · Fixed by #5484
Closed

Request 'log' failed from scm amend #5435

akosyakov opened this issue Jun 12, 2019 · 10 comments · Fixed by #5484
Labels
bug bugs found in the application git issues related to git scm issues related to the source control manager

Comments

@akosyakov
Copy link
Member

see #5416 (comment)

from @kitakkos also

I did the following: empty WS, clone two repositories, play with them, delete them, clone them again.

cc @westbury

@akosyakov akosyakov added bug bugs found in the application git issues related to git scm issues related to the source control manager labels Jun 12, 2019
@westbury
Copy link
Contributor

@kittaakos I tried the above steps in ak/scm_rework and I have not been able to get the error you saw in the log. I will try more tomorrow.

I did however see the following. I'll let you know what I find when I investigate tomorrow.

root ERROR Error occurred while synchronizing the status of the repository. file:///c%3A/Users/Nigel/workspace-theia/txr-java GitError: fatal: .git/index: index file open failed: Permission denied

at new GitError (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:81:28)
at Object.<anonymous> (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:256:27)
at step (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:50:23)
at Object.next (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:31:53)
at fulfilled (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:22:58)
at process._tickCallback (internal/process/next_tick.js:68:7)

root INFO Started watching the git repository: file:///c%3A/Users/Nigel/workspace-theia/txr-java
root ERROR The command git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128. The caller should either handle this error, or expect that exit code.
root ERROR fatal: your current branch appears to be broken

root ERROR Error occurred while synchronizing the status of the repository. file:///c%3A/Users/Nigel/workspace-theia/txr-java GitError: fatal: your current branch appears to be broken

at new GitError (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:81:28)
at Object.<anonymous> (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:256:27)
at step (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:50:23)
at Object.next (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:31:53)
at fulfilled (C:\Users\Nigel\git\theia\node_modules\dugite-extra\lib\core\git.js:22:58)
at process._tickCallback (internal/process/next_tick.js:68:7)

@kittaakos
Copy link
Contributor

ERROR The command git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128. Th

Please check your Git version, it should be >=2.11.

@kittaakos
Copy link
Contributor

Steps to reproduce the issue:

  • Open an empty workspace.
  • Activate the Git view. The No source control warning is correct and expected.
  • Open a terminal and run git init.
scm-amend-component.tsx:15 Uncaught (in promise) Error: Request 'log' failed
    at Proxy.<anonymous> (proxy-factory.ts:232)
    at GitAmendSupport.<anonymous> (git-scm-provider.ts:417)
    at step (git-scm-provider.ts:15)
    at Object.next (git-scm-provider.ts:15)
    at git-scm-provider.ts:15
    at new Promise (<anonymous>)
    at push.../../packages/git/lib/browser/git-scm-provider.js.__awaiter (git-scm-provider.ts:15)
    at GitAmendSupport.push.../../packages/git/lib/browser/git-scm-provider.js.GitAmendSupport.getLastCommit (git-scm-provider.ts:416)
    at ScmAmendComponent.<anonymous> (scm-amend-component.tsx:285)
    at step (scm-amend-component.tsx:15)

@kittaakos
Copy link
Contributor

Related #5451?

@westbury
Copy link
Contributor

Related #5451?

Almost certainly that is not the same problem. The log output is different and the steps to reproduce are different, though they do both fail in the git log command.

@westbury
Copy link
Contributor

Please check your Git version, it should be >=2.11

It was 2.14.0.windows.2 on the machine I used. I have now upgraded to 2.22.0.windows.1 and I have not seen the problem since.

Steps to reproduce the issue:

Those steps give me a different error. We are not coping well with an empty Git repository. The log function in dugite-git.ts will always fail because there is no HEAD. I suspect modifying that log function, to always return an empty array for empty repositories, will fix the issue. We just need to check that callers cope well when getting back an empty array. I'll try it out and maybe put in a PR.

@kittaakos
Copy link
Contributor

Those steps give me a different error.

What kind of errors did you get?

I suspect modifying that log function, to always return an empty array for empty repositories, will fix the issue

Yes.

@westbury
Copy link
Contributor

What kind of errors did you get?

root ERROR The command git log HEAD -C -M -m -n 100 --name-status --date=unix --format=%x02%h%x01%aE%x01%aN%x01%aI%x01%ar%x01%s%x01%b%x01 -z -- . exited with an unexpected code: 128. The caller should either handle this error, or expect that exit code.
root ERROR fatal: bad revision 'HEAD'

and also with -n 1 or -n 2 when it is called from ScmAmendComponent.

@kittaakos
Copy link
Contributor

root ERROR The command

Ahh, I added the frontend error to this issue while you were referring to the backend one. Makes sense. :)

Do you have time to add the guard against the git log or I should do it?

@westbury
Copy link
Contributor

I'm making the change. Should have it ready today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application git issues related to git scm issues related to the source control manager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants