Using git at Mozilla |
||
|
Posted by: stak Ehsan was asking me today about my git workflow at Mozilla; specifically how I push a git branch to try. I figured I'd post it here since other people may find it useful.
[alias] hgp = "show --binary --format=\"# HG changeset patch%n# User %an <%ae>%n%B\" -U8" Running git hgp HEAD, for example, will output to stdout a patch that can be imported by mq.
kats@kgupta-air mozilla-git$ git checkout layerview Switched to branch 'layerview' kats@kgupta-air mozilla-git$ hgp kats@kgupta-air mozilla-git$ ls -l ~/zspace/patches/ total 1440 -rw-r--r-- 1 kats staff 6115 27 Aug 20:59 1-layerview-18ea4c9 -rw-r--r-- 1 kats staff 5805 27 Aug 20:59 2-layerview-944d80a -rw-r--r-- 1 kats staff 5068 27 Aug 20:59 3-layerview-2fcfba1 -rw-r--r-- 1 kats staff 3199 27 Aug 20:59 4-layerview-6339849 drwxr-xr-x 253 kats staff 8602 27 Aug 09:41 old The hgp script also takes optional arguments - the first argument is taken as the number of commits to export. So running hgp 3 will export the top three patches on your current branch. The second argument is a branch name, so you can export commits from a branch other than the one you currently have checked out.
hg qimport ~/zspace/patches/*layerview* hg qgoto try # I have a "try" patch sitting at the bottom of my default queue hg qref -e # update any try-push options that need updating hg push -f try
|
|
(c) Kartikaya Gupta, 2004-2024. User comments owned by their respective posters. All rights reserved. You are accessing this website via IPv4. Consider upgrading to IPv6! |
I have been using the try server with my 2-way mirror of mercurial[1], and I modified the try chooser python script to write the result of the interactive command in a file such as I can reuse it in a git-try shell script which is pushing to the master branch of the try remote.
[1] https://github.com/nbp/spidermonkey-dev-tools/tree/master/git-hg-bridge