all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: emacs-devel@gnu.org
Subject: Using Git to manage your Emacs changes
Date: Wed, 7 Apr 2010 15:23:13 -0400	[thread overview]
Message-ID: <EED641D7-1934-4149-BB4C-C4071C7FB193@gmail.com> (raw)

If anyone here is like me and can't stand Bzr's interface/lack-of-speed due to comfort with Git, there is a *somewhat* more palatable solution:

 1. Install git-bzr (http://github.com/pieter/git-bzr).  Make sure it works by
    testing on some very small project from someplace.

 2. Do a bzr checkout of Emacs.  DO NOT use git-bzr to directly checkout the
    Emacs tree.  It will take days and days and download over 20G of data.

 3. Using git-bzr, point it at your local bzr checkout so it can do a fully local
    translation of the Bzr commits to Git commits.  This will take several hours,
    but not hog network bandwidth.

 4. When done, you can fetch Bzr changes into your tree with:

      git bzr fetch upstream

 5. Now here's the tricky part.  Move your .git directory from your git-bzr checkout
    over into your Bzr working tree.  Yes, we want Bzr and Git to manage the same
    tree.  You should be wearing your Depends; this is not for the faint of heart.

 6. Create a 'master' branch to queue your Git commits.  You can make topics branches
    off the branch, just never modify the upstream branch directly.

       git checkout -b master upstream

 7. Sadly, git-bzr is sufficiently broken that you will not be able to push your
    changes with "git bzr push upstream", as the docs indicate.  Instead, we have
    to use "git format-patch" and then turn each patch into a Bzr commit manually,
    which get pushed with "bzr push".  Once pushed, "git bzr pull upstream" reflects
    that new commit back in Git:

      ./apply.sh upstream     # apply commits using script below; stash if needed
      bzr push
      git bzr fetch upstream
      git rebase upstream     # git stash pop afterwards if needed

 8. I expect a blank line after my initial commit description.  If you don't do this,
    remove the "| tail +2" from the apply script.  It would seems that using a blank
    line is standard in the Git community, but not using it in standard for the Emacs
    tree.

I know, it's quite ugly, but using Bazaar has proven even less desirable.

John

#!/bin/bash

git checkout ${1:-upstream}
git format-patch ..master

for i in [0-9]*.patch; do
        echo Applying $i

        patch -p1 < $i

        grep ^Subject: $i | sed 's/^Subject: \[PATCH\] //' > /tmp/msg.$$

        perl -ne 'print if /^$/ .. /^---/;' $i | \
          perl -ne 'print unless /^---/ .. eof()' | \
          tail +2 >> /tmp/msg.$$

        bzr commit -F /tmp/msg.$$

        rm -f /tmp/msg.$$
done

git reset --hard HEAD
git checkout master
rm -f [0-9]*.patch




             reply	other threads:[~2010-04-07 19:23 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 19:23 John Wiegley [this message]
2010-04-07 19:32 ` Using Git to manage your Emacs changes David Reitter
2010-04-07 20:25   ` John Wiegley
2010-04-07 21:22     ` David Reitter
2010-04-21 17:30   ` Ted Zlatanov
2010-04-21 18:12     ` David Reitter
2010-04-21 19:29       ` John Wiegley
2010-04-21 20:42         ` Eli Zaretskii
2010-04-22  7:17           ` John Wiegley
2010-04-22  9:41             ` Lennart Borgman
2010-04-22 10:28               ` Andreas Schwab
2010-04-22 11:09                 ` Lennart Borgman
2010-04-22 11:29                   ` Andreas Schwab
2010-04-22 16:20                     ` endless version control debates [was Re: Using Git to manage your Emacs changes] Glenn Morris
2010-04-22 17:02                       ` endless version control debates Óscar Fuentes
2010-04-22 17:07                       ` endless version control debates [was Re: Using Git to manage your Emacs changes] Leo
2010-04-22 17:52                         ` Chad Brown
2010-04-22 19:16                           ` Andreas Schwab
2010-04-22 20:09                             ` Chad Brown
2010-04-23  2:50                               ` endless version control debates Miles Bader
2010-04-22 20:16                           ` endless version control debates [was Re: Using Git to manage your Emacs changes] Leo
2010-04-22 20:46                             ` Eli Zaretskii
2010-04-22 21:10                             ` Jeff Clough
2010-04-22 10:40               ` Using Git to manage your Emacs changes Miles Bader
2010-04-23  8:38                 ` Juri Linkov
2010-04-23  9:29                   ` Ævar Arnfjörð Bjarmason
2010-04-24 13:20                   ` Richard Stallman
2010-04-24 15:27                     ` Jason Earl
2010-04-24 15:45                       ` Ævar Arnfjörð Bjarmason
2010-04-24 17:10                       ` Alfred M. Szmidt
2010-04-24 19:33                         ` Jason Earl
2010-04-24 20:33                           ` Alfred M. Szmidt
2010-04-24 20:36                           ` Eli Zaretskii
2010-04-24 21:54                             ` Jason Earl
2010-04-25  8:26                             ` Stephen J. Turnbull
2010-04-27 20:59                             ` Karl Fogel
2010-04-25 16:47                           ` Georg Brandl
2010-04-26 14:33                       ` Richard Stallman
2010-04-26 17:35                         ` Eli Zaretskii
2010-04-21 22:16         ` Andreas Schwab
2010-04-07 20:53 ` Giuseppe Scrivano
2010-04-07 20:37   ` Thierry Volpiatto
2010-04-08 22:27     ` John Wiegley
2010-04-08 22:43       ` Jonas Bernoulli
2010-04-09  6:04       ` Thierry Volpiatto
2010-04-08 16:57 ` Ken Raeburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EED641D7-1934-4149-BB4C-C4071C7FB193@gmail.com \
    --to=jwiegley@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.