gitx icon indicating copy to clipboard operation
gitx copied to clipboard

Staging selected lines "index operation failed" error

Open lukemorton opened this issue 13 years ago • 6 comments

Image of error

Getting the above error when trying to stage certain lines. It happens most of the time.

Using this fork of gitx.

Am I doing something wrong or is this undesired? It's certainly undesirable for me.

Let me know if I can provide any more information to help resolve this issue.

Thanks :)

lukemorton avatar Sep 03 '12 16:09 lukemorton

I've had this periodically, I tend to work around by setting the context slider to a minimum amount and staging chunks instead of individual lines. It typically clears itself up after a commit or restart; for me. I'd love to have any additional context you can add about how to reproduce this.

rowanj avatar Sep 04 '12 01:09 rowanj

I have more details on how to reproduce in #85.

jasonnoble avatar Sep 12 '12 16:09 jasonnoble

I've managed to reproduce with the details in #85 - but note that I could only do it if there was also no trailing newline (which I subconsciously added the first time I tried to reproduce).

I suspect then that this is an error in newline handling at some stage of the patch formatting.

rowanj avatar Sep 13 '12 11:09 rowanj

A breakpoint in PBEasyPipe's + (NSString*) outputForCommand: withArgs: inDir: shows that the diff it is processing in this case is:

diff --git a/test b/test
index d163345..e1e286f 100644
--- a/test
+++ b/test
@@ -1 +1,4 @@
 <%= render :partial => "login_form" %>
+
+
+Text
\ No newline at end of file

rowanj avatar Sep 13 '12 11:09 rowanj

I've had some success with trying to strip that exact suffix from the diff; although I worry about it appearing naturally, I think it's far more likely that the newline is actually missing than that the diff ends with it as a context line.

rowanj avatar Nov 13 '12 23:11 rowanj

I can still experience this bug in Version 0.15.1964 dev (0.15.1964)

ghost avatar Jul 23 '18 02:07 ghost