Hacking on Firebug
by Honza- Published:March 10th, 2012
- Comments:50 Comments
- Category:Documentation, Firebug, Planet Mozilla
Entire Firebug source base has been moved on github.com last week and we are also adopting a new GIT development workflow. So far, everyone has been truly excited by this change and I believe that it's also much better way how to collaborate with other coders. Firebug is an open source project after all.
So, for those who are interested at forking Firebug repository, issuing a pull request, developing Firebug extension, etc. here are some basic things to know before you start.
Firebug Repository
There are already several repositories in Firebug's account, but the one you are probably interested the most is firebug
https://github.com/firebug/firebug
The structure of the repo is following:
- extension Firebug extension directory
- tests Firebug automated test files and test harness - FBTest
- trace Firebug tracing console - FBTrace
Here is how to clone the repository (read only):
$ cd firebug/extension
Run Firebug From Source
The extension directory contains Firebug extension files and so, you can run Firebug off of it. It's also the best way how to quickly check your code changes.
- Locate your Firefox profile folder
- Open
extensions/
folder, create if it doesn't exist. - Create a new text file and put the full path to your development folder inside. (e.g.
C:\firebug\extension\
or~/firebug/extension/
). Windows users should retain the OS' slash direction, and everyone should remember to include a closing slash and remove any trailing spaces. - Save the file with Firebug ID as it's name
firebug@software.joehewitt.com
Now you can modify the code base, restart Firefox (with Firebug extension installed) and see your changes live.
Build Firebug XPI
You probably don't need this that often, but you can also easily build Firebug XPI package. All you need is Apache Ant installed on your machine.
$ ant
The result XPI file should be located in ./release
directory.
Push!
And now the most interesting part. You fixed a bug or implemented new API you need in your extension and you want us to pull your changes, commit into Firebug master branch and release! Let's see what you need to do.
Update: it's useful to create a separate branch for every contribution you make. (related to #4 and #5)
- First, you need a GitHub account. It's simple and all the cool kids are already there 😉
- Fork Firebug repository (see how to fork a repo).
- Clone your fork onto your local machine (your URL will be different):
$ git clone git@github.com:janodvarko/firebug.git
- Create a new branch, make your changes, stage/add modified files (e.g. firebug.js) and commit:
$ cd firebug/extension
$ git checkout -b myNewAPI
# Make your changes in firebug.js file now
$ git add content/firebug/firebug.js
$ git commit -m "New API for my extension" - Push to origin (your public fork), the local branch myNewAPI to the remote branch myNewAPI:
$ git push -u origin myNewAPI
- Send a pull request. We'll review your changes and accept if all is OK!
Our release cycle is quick (a release at least every other week) so, your changes can be publicly available pretty soon!
Or Create a Patch
If you don't like github.com from some reason you can always create read-only clone (see at the beginning of this post), make your changes and generate a patch:
... or using svn:
Finally, create a new issue report (Firebug official issue list is still at the same location) and attach your patch. Again, we'll review your changes and accept if all is OK!
Further Resources
- Home: http://getfirebug.com/
- Blog: http://blog.getfirebug.com/
- Twitter: http://twitter.com/#!/firebugnews
- Discussion Group: https://groups.google.com/forum/?fromgroups#!forum/firebug
- Wiki: http://getfirebug.com/wiki
- Report an Issue: http://code.google.com/p/fbug/issues/list
- Firebug Extensions: http://getfirebug.com/wiki/index.php/Firebug_Extensions
50 Comments
Step 4 should be to create a branch for the specific contribution they are submitting. This makes things easier for users contributing.
git checkout -b improvingxthing
Github collects in the same pull request all the commits you made to a branch(ex master). If you need to contribute to two separated things, there is no way to separate the pull request if you made all the changes in master.
( correct me if I'm wrong. )
Also, when pushing you need to select the branch name
git push -u origin improvingxthing
Nice catch! So, if I understand correctly, the contributor should (a) create a branch (b) push it to the forked repo and (c) send the pull request from the branch, correct?
And new branch should be created for every new contributed feature so, they can be separated from each other (which is also important for the review process).
"Firebug is an open source project after all."
That's why it goes to be hosted by a closed-source for-profit development platform, right?
[...] Hacking on Firebug, Jan outlines the most common things you can do, [...]
@Robert: Let me rephrase: That's why it goes to be hosted by a successful social coding oriented platform - to make the collaboration among contributors easier.
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better [...]
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
@Honza, correct!
Github will recognize the different branches and will create a dedicated "send pull request" button for each different branch, directly from your repo.
Update the instructions! This is important. Also the correct command to push a branch is:
git push origin improvingxthing:improvingxthing
This means to push to origin, the local branch improvingxthing to the remote branch improvingxthing
Regards,
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
[...] developer Jan Odvarko says a pierce to GitHub has been well-spoken so distant and will offer meddlesome developers “a most [...]
[...] Software is hard | Hacking on Firebug: Software is hard | Hacking on Firebug [...]
@tito: Instructions updated, thanks! One question: isn't "git push origin myNewAPI:myNewAPI" the same as "git push origin myNewAPI"?
Honza
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better [...]
@honza, Looks like it is the same thing. I think is a little bit more easy to understand what are you doing.
I'm not sure about the usage of "-u" arg. It seems to add a tracking branch. I need to investigate that on a git marthon 😀
Regards
git push origin some-feature
should be enough
Git ready has a lot of handy good tips for the daily use
http://gitready.com/beginner/2009/02/02/push-and-delete-branches.html
Thomas
[...] دهد. برای اطلاع رسانی از نحوه کار بر روی Firebug در GitHubبه اینجا مراجعه [...]
@tito, Thomas: thanks, I have updated the post.
Honza
[...] developer Jan Odvarko says a pierce to GitHub has been well-spoken so distant and will offer meddlesome developers “a most [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
Very complete guidance. Thank you in advance
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] a popular Firefox add-on for Web developers, has been moved to GitHub. This will make it easier for people to join the project and contribute [...]
[...] developer Jan Odvarko says the move to GitHub has been smooth so far and will offer interested developers “a much better way [...]
[...] to hack on [...]
alert("hacker");
[...] دهد. برای اطلاع رسانی از نحوه کار بر روی Firebug در GitHubبه اینجا مراجعه [...]
I would like to thank you for the efforts you have made in writing this article.
i hope each and every one adopt this superb information in our business...
thanks
I would like to thank you for the efforts you have made in writing this article.
i hope each and every one adopt this superb information in our business...thankslos angeles seo company
Nice blog.. I am really impressed and you do an appreciative work.. thanks for sharing...
i like to read this topic. please share something more...
Thanks..
what a nice post here... i am really enjoy to read this ... your fantastic information you have posted on your own site. I will definitelycome to check it out once more..thanks.
[...] This release fixes 200 issues (74 issues enhancements). We have implemented 50 more automated tests during the release cycle to ensure stability and avoid regression issues. We have also managed to move the entire source to github.com and got more contribution from the community than ever before (see more about hacking on Firebug). [...]
[...] This release fixes 210 issues (79 issues enhancements). We have implemented 50 more automated tests during the release cycle to ensure stability and avoid regression issues. We have also managed to move the entire source to github.com and got more contribution from the community than ever before (see more about hacking on Firebug). [...]
[...] If you’d like to contribute code read post about Hacking on Firebug [...]