Closed
Bug 718115
Opened 13 years ago
Closed 12 years ago
cfx leaks "fatal: Not a git repository " for every command
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: k0scist, Assigned: warner)
Details
Attachments
(1 file)
609 bytes,
patch
|
markh
:
review+
|
Details | Diff | Splinter Review |
From a checkout of http://hg.mozilla.org/projects/addon-sdk I get: (addon-sdk)│cfx blahblahblah init fatal: Not a git repository (or any parent up to mount parent ) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). cannot find 'package.json' in the current directory or any parent. Though whatever cfx command I do does the first thing from the top of the output. From IRC, :warner advised me that there's code in cfx that tries to figure out its version number by asking "git --describe". It is supposed to fall back to version="unknown" when .git doesn't exist, but the error message is still leaked
Assignee | ||
Comment 1•13 years ago
|
||
Oops. So my "what is my version" code survives a "git --describe" failure (leaking the scary-looking "fatal:" error message from git). But I didn't actually include the check for .git being present. It needs to be updated to: * if .git doesn't exist, return version=unknown * if .git does exist, try git --describe * if that works, use it for the version. Else version=unknown. I'm ok with the error message being leaked if .git exists, as there are probably other sorts of error message that could be generated in git --describe that would be useful to see. But if .git doesn't exist, the tool should silently use version=unknown. (I forgot about handling a non-checkout non-generated-tarball tree, which is what comes out of the git-to-hg bridge. Boy am I looking forward to shutting that thing down.)
Assignee: nobody → warner-bugzilla
Reporter | ||
Comment 2•13 years ago
|
||
(In reply to Brian Warner [:warner :bwarner] from comment #1) > Oops. So my "what is my version" code survives a "git --describe" failure > (leaking the scary-looking "fatal:" error message from git). But I didn't > actually include the check for .git being present. > > It needs to be updated to: > > * if .git doesn't exist, return version=unknown > * if .git does exist, try git --describe > * if that works, use it for the version. Else version=unknown. > > I'm ok with the error message being leaked if .git exists, as there are > probably other sorts of error message that could be generated in git > --describe that would be useful to see. But if .git doesn't exist, the tool > should silently use version=unknown. Sounds good to me > (I forgot about handling a non-checkout non-generated-tarball tree, which is > what comes out of the git-to-hg bridge. Boy am I looking forward to shutting > that thing down.) What is the planned alternative? AFAIK, the hg mirror exists for Mozilla infrastructure (i.e. buildbot, build-vpn) needs.
Assignee | ||
Comment 3•12 years ago
|
||
This diff ought to fix it for Jetpack. I'll figure out a more general fix for the upstream code that this comes from (https://github.com/warner/python-versioneer)
Attachment #589662 -
Flags: review?(mhammond)
Updated•12 years ago
|
Attachment #589662 -
Flags: review?(mhammond) → review+
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to Jeff Hammel [:jhammel] from comment #2) > > (I forgot about handling a non-checkout non-generated-tarball tree, which > > is what comes out of the git-to-hg bridge. Boy am I looking forward to > > shutting that thing down.) > > What is the planned alternative? AFAIK, the hg mirror exists for Mozilla > infrastructure (i.e. buildbot, build-vpn) needs. Right. The plan is for the releng buildbot to get jetpack code from git, not hg. Bug 528360 is related.
Reporter | ||
Comment 5•12 years ago
|
||
FWIW, in general i think it would be nice to fix this issue regardless of preferred ways of downloading. If someone, say someone who didn't have/want hg or git on their machine took the github-generated tarball, this would be just as much of an issue
Comment 6•12 years ago
|
||
Commit pushed to https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/d518c9fca43048eb39cd7eb859eb1939201c1884 Bug 718115: don't run 'git describe' unless .git exists. r=mhammond Otherwise, cfx commands in an hg tree (from the git-to-hg bridge) emit spurious+frightening "fatal: Not a git repository" messages all the time.
Brian, please reopen if you want to do more in this bug. :)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•12 years ago
|
||
Nope, we're good. There's already code in place to handle a github-generated tarball correctly (it uses expanded variables, like the old $Id$ from CVS). That's how release tarballs get their version without a .git directory.
You need to log in
before you can comment on or make changes to this bug.
Description
•