B2G/Hacking: Difference between revisions

Jump to navigation Jump to search
1,747 bytes added ,  8 November 2012
(→‎Communication: Add note about B2G bugs in Bugzilla. Also a couple links.)
Line 105: Line 105:
  inbound = ssh://hg.mozilla.org/integration/mozilla-inbound/
  inbound = ssh://hg.mozilla.org/integration/mozilla-inbound/
  mc = ssh://hg.mozilla.org/mozilla-central/
  mc = ssh://hg.mozilla.org/mozilla-central/
=== Git ===
If you choose to hack on Gecko using git, you'll need to take care to attach patches to bugzilla in format others are expecting.
''tl;dr:  Use <code>git bz attach</code> from [https://github.com/jlebar/moz-git-tools moz-git-tools] to attach correctly-formatted patches to bugzilla.''
==== Generating patches using git-diff ====
git diff defaults to 4 lines of context, but reviewers usually expect 8 lines of context in bugzilla.  git diff also does not show file renames and copies by default.  Reviewers will usually reject patches generated with these settings.
Instead of attaching the result of <code>git diff</code> to bugs, attach the output of the following command:
<code>$ git diff -U8 -M -C</code>
You can alias this to <code>git dif</code> by modifying your ~/.gitconfig as follows:
<code>[alias]
dif = diff -U8 --patience -M -C</code>
==== Generating checkin-needed patches ====
Patches generated using git diff are not suitable for checkin-needed, since they're missing the appropriate hg author and commit-message headers.  The output of <code>git format-patch</code> (the equivalent of <code>hg export</code>) is also not suitable for checkin-needed, because hg can't read git's author and commit-message headers.
One way to generate a checkin-needed patche using git is to generate a file using <code>git format-patch -U8 -M -C</code> and then run it through <code>git patch-to-hg-patch</code> from [https://github.com/jlebar/moz-git-tools moz-git-tools].  (I'd accept pull-requests to streamline this process.)
Alternatively, if you attach your patches using <code>git bz attach</code> from [https://github.com/jlebar/moz-git-tools moz-git-tools], the patches will automagically have the correct format.


== Landing patches ==
== Landing patches ==
187

edits

Navigation menu