unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Bastien <bzg@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: patch vs. overwrite in bzr [was: Next pretest, and regressions policy]
Date: Thu, 05 Apr 2012 18:53:27 +0300	[thread overview]
Message-ID: <83zkaqb2fc.fsf@gnu.org> (raw)
In-Reply-To: <87k41u4poa.fsf@gnu.org>

> From: Bastien <bzg@gnu.org>
> Cc: ofv@wanadoo.es,  emacs-devel@gnu.org
> Date: Thu, 05 Apr 2012 09:13:09 +0200
> 
> I have a local "emacs-merge" branch, stemming from hotfix.  This local
> branch has a directory "emacs" that reproduce part of the hierarchy of
> Emacs files, that part which contains Org files.
> 
> doc
>  misc
>   ChangeLog
>   org.texi
> etc
>  org
>   OrgOdtContentTemplate.xml
>   OrgOdtStyles.xml
>   README
>  refcards
>   orgcard.pdf
>   orgcard.tex
> lisp
>  org
>   ChangeLog
>   [org/ob..el]x109
> 
> Then the sync process is this:
> 
> 1. Check for org-related changes in Emacs trunk
> 
> 2. Backport them to the hotfix branch
> 
> 3. Copy the files from the hotfix branch to the emacs dir in my local
>    emacs-merge branch, and get a diff from there.
> 
> 4. Clean up the patch so that it applies correctly in Emacs trunk.
> 
> 5. Fix merge conflicts in the hotfix branch and go back to 3 if needed.
> 
> 6. Commit the diff on the "org" bzr branch (bound to the remote Emacs
>    trunk) when things look fine.
> 
> Suggestions against this workflow are welcome.

Well, I'm not sure I get all the details of your setup, so it's
possible that I will say something silly; apologies in advance.  But
IIUC, you could get away with less branches and less manual work.  So
here we go:

Setup:

  . A bound bzr branch, let's call it emacs-trunk, where you don't
    make any changes, just merge before committing upstream, to the
    Emacs master repository.

  . A local bzr branch, let's call it emacs-org, which will be the
    branch that you sync with one of your git branches.  From this
    branch you will merge to emacs-trunk before committing upstream.

  . A git branch that corresponds to emacs-org, I think this could be
    your hotfix branch, as I don't understand why you need the
    emacs-merge branch.

Below I assume that you have the bzr-tiplog plugin installed.  It
provides the functionality similar to git-reflog, and lets you skip
the error-prone step of remembering or keeping notes about the last
bzr revision you sync'ed with (see below); the only revision id's you
will ever need to remember is tip:0 and tip:1.

The sync process proceeds in cycles.  Each cycle begins when you sync
from Emacs repo to Org as follows:

  cd emacs-trunk
  bzr update
  cd ../emacs-org
  bzr merge --pull ../emacs-trunk

Now emacs-org is synchronized with the Emacs trunk.  Next, produce the
org-related changes since your last synchronization:

  bzr diff -r tip:1..tip:0 lisp/org > patches

(If there are files outside lisp/org that you are interested in,
perhaps etc/NEWS or doc/misc/org.texi, mention them as well; bzr will
produce diffs only for those files and directories, leaving out stuff
you don't care about.)

The file `patches' produced above includes files that are added,
removed, and renamed, but not in the form of diffs (I think).  So to
make sure you don't miss those changes, do also this:

  bzr status -r tip:1..tip:0 lisp/org

(again, add any other directories you are interested in), and examine
the output for any non-text changes.

Now sync your git branch, by (a) applying `patches' with Patch, and
(b) performing any file operations.  The latter should be done by
hand, or you could perhaps write some simple script to parse the
output of "bzr status" and do it for you.

After this, you develop Org normally.  I understand you have other
branches, so you probably will wish to use git commands to merge the
changes into them as well, and then back to the branch that you will
later sync with bzr.

I suggest to perform the steps above as frequent as you can, to avoid
diverging too much from the Emacs trunk.  That will make the second
part of the cycle easier.  I'd expect that more often than not, you
will find that no changes were done that pertain to Org, so I don't
think the burden will be too heavy.  The advantage is that your code
will be very similar to what the Emacs trunk has, so all your testing
will not need to be redone when you merge with the latest trunk below.

So time passes, and you decide you are ready to commit to the Emacs
repo.  Then, just overwrite the files in emacs-org with the
corresponding files in your git branch (using rsync or some such), and
type these bzr commands:

  cd emacs-org
  bzr commit -m "sync'ed with git revision 12345abcd"

You now have a bzr branch that is synchronized with your git branch.

Now find out how much you diverged from the trunk since the last
resync:

  cd ../emacs-trunk
  bzr update
  bzr diff -r branch:../emacs-org.. lisp/org

If the diffs this shows are insignificant enough, you can simply merge
into trunk and commit:

  bzr merge ../emacs-org
  bzr ci -m "Merge from Org repo."

If, however, enough time has passed since the last sync, and the diffs
are non-trivial, you will have to merge back to emacs-org and retest:

  cd ../emacs-org
  bzr merge ../emacs-trunk
  # build and test
  cd ../emacs-trunk
  bzr merge ../emacs-org
  bzr ci -m "Merge from Org repo."

This completes the cycle, and you are ready to begin the next one.

HTH



  reply	other threads:[~2012-04-05 15:53 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 13:28 Next pretest, and regressions policy Chong Yidong
2012-03-31 10:15 ` Bastien
2012-04-01  9:55   ` Bastien
2012-04-01 12:37     ` =?utf-8?Q?=C3=93scar_Fuentes?=
2012-04-01 13:30       ` Stefan Monnier
2012-04-01 17:09         ` Chong Yidong
2012-04-01 20:32           ` Bastien
2012-04-02  4:12             ` Chong Yidong
2012-04-01 20:32         ` Bastien
2012-04-03  8:20         ` patch vs. overwrite in bzr [was: Next pretest, and regressions policy] Roland Winkler
2012-04-03 12:36           ` Óscar Fuentes
2012-04-03 13:42             ` Bastien
2012-04-03 15:02               ` patch vs. overwrite in bzr =?utf-8?Q?=C3=93scar_Fuentes?=
2012-04-03 15:03               ` David Engster
2012-04-03 16:31                 ` Stefan Monnier
2012-04-03 17:40                   ` Michael Albinus
2012-04-03 15:32               ` patch vs. overwrite in bzr [was: Next pretest, and regressions policy] Stefan Monnier
2012-04-03 16:52                 ` patch vs. overwrite in bzr Glenn Morris
2012-04-03 20:50                   ` Bastien
2012-04-03 21:27                     ` Glenn Morris
2012-04-04  0:26                     ` Stefan Monnier
2012-04-04  5:45                       ` Bastien
2012-04-04  5:51                       ` Bastien
2012-04-04  6:46                         ` Michael Albinus
2012-04-04  8:35                           ` Thierry Volpiatto
2012-04-04 13:20                             ` Stefan Monnier
2012-04-04 16:39                               ` Jordi Gutiérrez Hermoso
2012-04-04 16:52                               ` Paul Eggert
2012-04-04 17:09                             ` Eli Zaretskii
2012-04-04 17:53                               ` Thierry Volpiatto
2012-04-04 19:07                                 ` Eli Zaretskii
2012-04-04 19:38                                   ` Thierry Volpiatto
2012-04-04 20:12                                     ` Eli Zaretskii
2012-04-04 13:16                         ` Stefan Monnier
2012-04-04 17:01                           ` Eli Zaretskii
2012-04-04 18:07                             ` Stefan Monnier
2012-04-04 19:11                               ` Eli Zaretskii
2012-04-04 20:11                                 ` David Engster
2012-04-04 22:06                                 ` Stefan Monnier
2012-04-05  3:09                                   ` Eli Zaretskii
2012-04-05 13:22                                     ` Stefan Monnier
2012-04-05 15:24                                       ` Lars Magne Ingebrigtsen
2012-04-05 15:57                                         ` Eli Zaretskii
2012-04-05 17:10                                         ` Ted Zlatanov
2012-04-06  7:13                                       ` Richard Stallman
2012-04-06  8:29                                         ` Bastien
2012-04-06  8:40                                           ` Eli Zaretskii
2012-04-06  9:20                                             ` Bastien
2012-04-06  9:57                                               ` Eli Zaretskii
2012-04-06 10:20                                                 ` Bastien
2012-04-06 17:26                                                   ` chad
2012-04-06 20:01                                                     ` joakim
2012-04-06 20:52                                                       ` Eli Zaretskii
2012-04-07  2:28                                                         ` Óscar Fuentes
2012-04-07  6:33                                                           ` Eli Zaretskii
2012-04-07 11:56                                                             ` Óscar Fuentes
2012-04-07 12:10                                                               ` Eli Zaretskii
2012-04-07 12:56                                                                 ` Óscar Fuentes
2012-04-07 13:32                                                                   ` Eli Zaretskii
2012-04-07 13:42                                                                     ` Óscar Fuentes
2012-04-07  7:07                                                           ` Andreas Schwab
2012-04-07 11:44                                                             ` Óscar Fuentes
2012-04-06 21:10                                                       ` Juanma Barranquero
2012-04-16 10:45                                                 ` Jason Rumney
2012-04-16 16:38                                                   ` Eli Zaretskii
2012-04-06 16:17                                             ` Christophe Poncy
2012-04-06 16:41                                               ` Eli Zaretskii
2012-04-06 17:14                                                 ` Christophe Poncy
2012-04-07  0:17                                               ` Richard Stallman
2012-04-07  0:17                                           ` Richard Stallman
2012-04-07  9:15                                             ` Bastien
2012-04-07 22:19                                               ` Richard Stallman
2012-04-09  9:39                                                 ` Bastien
2012-04-08  3:25                                               ` Richard Stallman
2012-04-08 15:52                                                 ` Ted Zlatanov
2012-04-16 22:02                                                   ` Richard Stallman
2012-04-06  8:43                                         ` Eli Zaretskii
2012-04-04 17:12               ` patch vs. overwrite in bzr [was: Next pretest, and regressions policy] Eli Zaretskii
2012-04-05  7:13                 ` Bastien
2012-04-05 15:53                   ` Eli Zaretskii [this message]
2012-04-11 14:36                     ` Bastien
2012-04-04 18:01               ` Thierry Volpiatto
2012-04-05  7:19                 ` Bastien
2012-04-05  9:16                   ` Thierry Volpiatto
2012-04-01 20:35       ` Next pretest, and regressions policy Bastien

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83zkaqb2fc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=bzg@gnu.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).