Github: Unable to stage hunks/selections, sometimes unable to stage files

Created on 13 Feb 2018  路  3Comments  路  Source: atom/github

  • Have you tried to reproduce the problem in [Safe Mode][safe-mode]?
  • Have you followed all applicable steps in the [debugging guide][debugging-guide]?
  • Have you checked the FAQs on the [message board][message-board] for common solutions?
  • Have you checked that your issue [isn't already filed][already-filed]?
    ^^ Yes ^^

Description

When looking at the 'Unstaged Changes' or diff window, clicking 'Stage Hunk' does nothing. Selecting part of the file and either using the context menu or the button 'Stage Selection' does nothing.
To be clear about nothing the button responds, stage hunk highlights what should be staged but git throws an error to the console.

Steps to Reproduce

When attempting to reproduce, I noticed it doens't work in a fresh repo. Keep reading:

Expected behavior:

I expected the part of the file to be staged for commit.

Actual behavior:

Git throws error in console:
Uncaught (in promise) GitError: git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false apply --cached - in C:xampp\htdocs\DriveTrain exited with code 1
stdout:
stderr: error: patch failed: page.php:31
error: page.php: patch does not apply

at new GitError (C:\Users\nickj\AppData\Local\atom\app-1.24.0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:104:24)
at C:\Users\nickj\AppData\Local\atom\app-1.24.0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:362:33
at Generator.next (<anonymous>)
at step (C:\Users\nickj\AppData\Local\atom\app-1.24.0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:92:197)
at C:\Users\nickj\AppData\Local\atom\app-1.24.0\resources\app\node_modules\github\lib\git-shell-out-strategy.js:92:367

Reproduces how often:

Working 9-5 in atom and git, this happens every other day at least. I work on a laptop which gets put to sleep more often than rebooted, might have something to do with it.

Versions

Windows 10
Atom : 1.24.0
Electron: 1.6.16
Chrome : 56.0.2924.87
Node : 7.4.0
apm 1.18.12
npm 3.10.10
node 6.9.5 x64
atom 1.24.0
python 2.7.14
git 2.16.1.windows.4
visual studio 2015

Additional Information

Sometimes goes away after reboot.
I'm able to get around the issue by running
git rm -r --cached .
commit and reset in the affected repo.
This is happening across two repo's I'm working on and is also mentioned https://github.com/atom/github/issues/837 by several other users, but is closed.

Most helpful comment

Related issue: #837

:bow:

@Hreacon - now that #837 has been re-opened, are you :+1: on closing this issue?

All 3 comments

Happened again, this time git rm -r --cached didn't work to clear the issue.
Staging files by double clicking on the file in the github tab works, using 'stage file' button on the diff window does not work. Same error in the console.
I found out it is file specific, I can do these actions in some files but not others.

Related issue: #837

:bow:

@Hreacon - now that #837 has been re-opened, are you :+1: on closing this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RafaelNGP picture RafaelNGP  路  4Comments

benogle picture benogle  路  4Comments

djamrozik picture djamrozik  路  5Comments

jingr1 picture jingr1  路  4Comments

JamesChevalier picture JamesChevalier  路  4Comments