Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1242034 - "git stash save -k" followed by "git stash apply" fails
Summary: "git stash save -k" followed by "git stash apply" fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: git
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Stodulka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-10 18:08 UTC by Jonathan Kamens
Modified: 2015-07-21 08:13 UTC (History)
4 users (show)

Fixed In Version: git-2.4.3-6.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-21 08:13:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jonathan Kamens 2015-07-10 18:08:41 UTC
I have a pre-commit hook whith does the following:

1. Stash unstaged changes ("git stash -k").
2. Run flake8 over all staged changes.
3. If flake8 complains, then error out of the commit.
4. Otherwise, apply the stash and exit.

This way I am prevented from committing staged changes that don't pass flake8. I can't imagine that this is a terribly uncommon workflow.

This worked fine until the aforementioned comment, after which my hook complains, "Cannot apply stash: Your index contains uncommitted changes." 

This bug was introduced into git in this commit: https://github.com/git/git/commit/ed178ef13a26136d86ff4e33bb7b1afb5033f908

It was reverted in a subsequent commit: https://github.com/git/git/commit/19376104a8251a7e6c56579cdcd2eb0a106d1fd6

The revert will probably be in git 2.4.6 (it's on the 2.4.x branch), but in the meantime, git is broken for me, so I am wondering if we can apply the revert as a patch to git 2.4.3 in F22.

Comment 1 Jonathan Kamens 2015-07-15 22:06:01 UTC
FYI, the revert I'm asking you to pull in is indeed included in git 2.4.6.

Comment 2 Fedora Update System 2015-07-16 18:13:30 UTC
git-2.4.3-6.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/git-2.4.3-6.fc22

Comment 3 Fedora Update System 2015-07-18 02:08:44 UTC
Package git-2.4.3-6.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing git-2.4.3-6.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-11781/git-2.4.3-6.fc22
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2015-07-21 08:13:14 UTC
git-2.4.3-6.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.