prati0100 / git-gui

Tcl/Tk based UI for Git. I am currently acting as the project's maintainer.
161 stars 87 forks source link

Index error and application error when staging new file #36

Closed johnjohndoe closed 4 years ago

johnjohndoe commented 4 years ago

I am running git-gui version 0.21.GITGUI with git version 2.26.2.windows.1 on Windows 10.
When I stage a new file the following error is shown in a popup window:

Index Error
Updating the Git index failed. A rescan will be automatically started to resynchronize git-gui.

warning: CRLF will be replaced by LF in path/to/file.
The file will have its original line endings in your working directory

I can choose to "Unlock Index" or "Continue". I choose "Continue". The former window closes and a new error window pops up:

Application Error:
Error: wrong # args: should be "ui_ready"

wrong # args: should be "ui_ready"
wrong # args: should be "ui_ready"
    while executing
"ui_ready ui_ready"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 $after"
    (procedure "select_first_diff" line 8)
    invoked from within
"select_first_diff $after "
    (procedure "rescan_done" line 15)
    invoked from within
"rescan_done $fd buf_rlo $after"
    (procedure "read_ls_others" line 14)
    invoked from within
"read_ls_others file3d689f0 {reshow_diff; ui_ready ui_ready}"

When I choose "OK" then the windows closes and the file is staged.

prati0100 commented 4 years ago

A similar problem was reported some time ago. A contributor proposed a fix that you can find here. Does this fix the issue for you?

This should fix the "wrong # args" problem. The index error is a harder problem, and I'm not sure how to reproduce it.

johnjohndoe commented 4 years ago

Does this fix the issue for you?

The change reads suitable for me. Is the patched version available somewhere or would I need to build git-gui myself?

The index error is a harder problem, and I'm not sure how to reproduce it.

Is there anything I can add so you got more information?

prati0100 commented 4 years ago

The change reads suitable for me. Is the patched version available somewhere or would I need to build git-gui myself?

I don't run any kind of CI/CD system on the repo, so I think you would need to build it yourself. I don't use Windows, so I'm not sure if the development environment is easily available there.

Since the change is quite small, and all of git-gui is just plain text scripts, maybe you can just manually edit them to test. Check here to find out how. Of course, take backups just in case.

Is there anything I can add so you got more information?

If you can provide a simple contained example to reproduce the problem, it would be a pretty good start.

prati0100 commented 4 years ago

Fixed in https://github.com/prati0100/git-gui/commit/88db24d724619d6c2e602c3b56016f59326d31e3

Please feel free to re-open the issue if the problem persists.

johnjohndoe commented 4 years ago

@prati0100 Thanks for the reminder. I can confirm that error messages disappear with the manually applied patch. I just did quick test right now. I will keep it and see how it behaves in the upcoming days. Thank you. Please mention here once the patch is releases in a new version of Git.

prati0100 commented 4 years ago

Thanks for testing.

Please mention here once the patch is releases in a new version of Git.

I'll probably forget to remind you. It should land into Git v2.27.0 which is due June 1st. If you want it to land in Git for Windows sooner, you might try asking the GfW maintainer here.