Bug 689947

Summary: RFE: don't add a line in .gitignore if the file is already ignored by git
Product: [Fedora] Fedora Reporter: Christopher Aillon <caillon>
Component: fedora-packagerAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: dcantrell, dennis, rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: fedora-packager-0.5.9.0-1.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-11 20:44:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christopher Aillon 2011-03-22 20:38:53 UTC
I'd really like to just use globs in my .gitignore files to simply ignore *.bz2 etc, but every time I add new sources, fedpkg adds a new line to .gitignore regardless of whether it's already ignored simply because it's not explicitly ignored.

It would be nice to parse the output of git.Git.status(porcelain=True) here to see if the file is actually untracked before adding it to .gitignore.  The line would start with '?? ' if git truly doesn't know about the file.

Comment 1 Jesse Keating 2011-03-22 23:46:04 UTC
Something reasonable could be done here.

Comment 2 Jesse Keating 2011-04-11 20:44:24 UTC
Upon further looking, there is already logic in the code that will take the new line to be added and fnmatch it against any existing line in the ignore file (fnmatch is what git uses).  If any of the existing lines match the proposed line then we don't add the proposed line.  I just tested the logic with a *.bz2 entry in the file and the logic seems to do the right thing.  I'm going to close this as WORKSFORME for now, but if you run across the issue again I'll happily re-open and look at the data.

Comment 3 Fedora Update System 2011-04-11 21:13:17 UTC
fedora-packager-0.5.8.1-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.8.1-1.fc15

Comment 4 Fedora Update System 2011-04-11 21:14:20 UTC
fedora-packager-0.5.8.1-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.8.1-1.fc14

Comment 5 Fedora Update System 2011-04-11 21:15:14 UTC
fedora-packager-0.5.8.1-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.8.1-1.fc13

Comment 6 Fedora Update System 2011-04-11 21:16:17 UTC
fedora-packager-0.5.8.1-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.8.1-1.el6

Comment 7 Fedora Update System 2011-04-11 21:17:08 UTC
fedora-packager-0.5.8.1-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.8.1-1.el5

Comment 8 Jesse Keating 2011-04-11 21:23:40 UTC
Ignore all that bugspam, I had the wrong bug ID in the bodhi updates :/

Comment 9 Fedora Update System 2011-04-18 04:05:22 UTC
fedora-packager-0.5.8.1-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2011-04-18 22:43:20 UTC
fedora-packager-0.5.9.0-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.9.0-1.fc13

Comment 11 Fedora Update System 2011-04-18 22:47:05 UTC
fedora-packager-0.5.9.0-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.9.0-1.el6

Comment 12 Fedora Update System 2011-04-18 22:48:12 UTC
fedora-packager-0.5.9.0-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/fedora-packager-0.5.9.0-1.el5

Comment 13 Fedora Update System 2011-04-19 19:27:59 UTC
fedora-packager-0.5.8.1-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2011-04-28 02:00:45 UTC
fedora-packager-0.5.9.0-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2011-05-05 15:53:23 UTC
fedora-packager-0.5.9.0-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2011-05-05 15:54:11 UTC
fedora-packager-0.5.9.0-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.