Bug 822055 - fedpkg import corrupts git repository
Summary: fedpkg import corrupts git repository
Alias: None
Product: Fedora
Classification: Fedora
Component: GitPython
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
: 915501 (view as bug list)
Depends On: 1172512
Blocks: 1054176 1317485 1317486 1317489
TreeView+ depends on / blocked
Reported: 2012-05-16 08:33 UTC by Vít Ondruch
Modified: 2016-03-14 11:56 UTC (History)
14 users (show)

Fixed In Version: GitPython-1.0.1-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1054176 1317485 1317486 1317489 (view as bug list)
Last Closed: 2015-06-09 15:15:50 UTC
Type: Bug

Attachments (Terms of Use)
Example of broken repository (4.94 MB, application/x-gzip)
2012-05-16 11:22 UTC, Vít Ondruch
no flags Details

Description Vít Ondruch 2012-05-16 08:33:56 UTC
Description of problem:
It seems that doing "fedpkg import" corrupts somehow underlying git repository. After such import, although there are files in staging area, they are never committed and commit itself is empty.

Version-Release number of selected component (if applicable):
$ rpm -q git
$ rpm -q fedpkg

How reproducible:
Not sure exactly. Doing "fedpkg clone" and importing once more works.

Actual results:
Broken repository, keeps files in staging after commit.

Expected results:
Files from staging should be committed.

Additional info:

Comment 1 Vít Ondruch 2012-05-16 11:22:49 UTC
Created attachment 584933 [details]
Example of broken repository

Comment 2 Jesse Keating 2012-05-16 17:53:22 UTC
The contents are staged, but not committed.  From your tarball, if I do a 'git diff --staged' I see the diff of the modified files.  If I do a "git commit" the commit window shows the 3 modified files to be committed.

I don't see this repository as corrupt at all.

Comment 3 Vít Ondruch 2012-05-17 07:41:24 UTC
(In reply to comment #2)


I did not complained about any of the steps you described and I confirm that they works as you said. However, if you would proceed with the commit, then you would see something like this:

$ git commit
[master 7a0ec90] foo

So no notion of committing something. "git diff --staged" still shows diff, "git status" still shows 3 files to commit, etc.

Comment 4 Jesse Keating 2012-05-17 16:45:32 UTC
Whoops, you're correct.  I didn't realize that the problem occurs after the commit.  I'm able to reproduce with the repository you've attached, but this really feels like a git bug.

I'm going to re-assign it there, as that's really weird.

Comment 5 Vít Ondruch 2012-10-19 10:06:26 UTC
This still occurs. Since fedpkg is using GitPython, I am afraid that there is bug somewhere. It seems that the .git/index is somehow messed up. Maybe git changed the format of the file and GitPython did not followed. I dunno. But it would be nice to fallback back to plain git or fix the GitPython. This is really annoying issue for me. Thank you.

Comment 6 Bohuslav "Slavek" Kabrda 2012-11-02 09:30:58 UTC
I just hit this bug on F18 using fedpkg-1.10-1.fc18. This is really annoying, since I'm getting empty commits in the dist-git repo. Can someone have a look at this, please?

Comment 8 Fedora Admin XMLRPC Client 2013-02-22 10:05:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Fedora End Of Life 2013-04-03 19:18:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:

Comment 10 Toshio Ernie Kuratomi 2013-05-21 15:28:42 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=915501 may be a dupe of this.  Does the workaround listed in the initial comment of #915501 fix the broken repository you have as well?

Comment 11 Vít Ondruch 2013-05-22 07:54:47 UTC
(In reply to Toshio Ernie Kuratomi from comment #10)
> https://bugzilla.redhat.com/show_bug.cgi?id=915501 may be a dupe of this. 
> Does the workaround listed in the initial comment of #915501 fix the broken
> repository you have as well?

The bug 915501 is definitely the same issue IMO. And yes, the workaround works. But I learned simpler one. It is enough to "git {reset,add}" just one file to fix the repo and commit (the import typically add/removes patches and modifies sources and git ignore, so I typically {reset,add} the .spec file).

Comment 12 Vít Ondruch 2013-05-22 07:57:30 UTC
*** Bug 915501 has been marked as a duplicate of this bug. ***

Comment 13 marcindulak 2014-04-22 12:15:21 UTC
Have just experienced that bug - the workaround bug #915501 comment #0 worked for me. Using GitPython-0.3.2-0.6.RC1.fc19.

Comment 14 Vít Ondruch 2015-03-02 14:15:17 UTC
Is there any chance to get this fixed? There seems to be updated versions of GitPythong available upstream, which might resolve this issue.

[1] https://pypi.python.org/pypi/GitPython/

Comment 15 Vít Ondruch 2015-03-02 15:13:29 UTC
Tried with recent versions without success. I reported this error upstream:


Comment 16 Vít Ondruch 2015-04-29 13:12:01 UTC
GitPython 0.3.7, which should fix this issue was released:


Comment 17 Kamil Dudka 2015-05-26 10:49:27 UTC
I can confirm this bug with GitPython-0.3.2-0.7.RC1.fc21.noarch on Fedora 22.  This bug causes unnecessary commits to be pushed by mistake to Fedora git.

.git/index gets corrupted after invocation of 'fedpkg new-sources ...' in such a way that it can be parsed by git-status without any warning, but git-commit (with no additional options!) produces empty commits.

Comment 18 Fedora End Of Life 2015-05-29 08:44:33 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 19 Fedora Update System 2015-05-31 22:50:31 UTC
GitPython-1.0.1-1.fc22,python-smmap-0.9.0-1.fc22,python-gitdb-0.6.4-1.fc22 has been submitted as an update for Fedora 22.

Comment 20 Fedora Update System 2015-06-02 15:17:12 UTC
Package GitPython-1.0.1-1.fc22, python-gitdb-0.6.4-1.fc22, python-smmap-0.9.0-1.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 GitPython-1.0.1-1.fc22 python-gitdb-0.6.4-1.fc22 python-smmap-0.9.0-1.fc22'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 21 Fedora Update System 2015-06-09 15:15:50 UTC
GitPython-1.0.1-1.fc22, python-gitdb-0.6.4-1.fc22, python-smmap-0.9.0-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Vít Ondruch 2015-06-10 07:47:51 UTC
Thanks to all involved for finally fixing this issue \ó/

Comment 23 Tomas Tomecek 2015-10-19 12:20:03 UTC
Still happening even with 1.0 GitPython.

Comment 24 Pavol Babinčák 2015-10-20 08:21:46 UTC
(In reply to Tomas Tomecek from comment #23)
> Still happening even with 1.0 GitPython.
Can you provide steps to reproduce the issue? Also versions of GitPython, python-smmap and python-gitdb?

Comment 25 Tomas Tomecek 2015-11-02 09:15:58 UTC
(In reply to Pavol Babinčák from comment #24)
> (In reply to Tomas Tomecek from comment #23)
> > Still happening even with 1.0 GitPython.
> Can you provide steps to reproduce the issue? Also versions of GitPython,
> python-smmap and python-gitdb?

Will do once it happens again.

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