unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tassilo Horn <tsdh@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Bzr help
Date: Fri, 20 Dec 2013 20:05:53 +0200	[thread overview]
Message-ID: <8338lnbdoe.fsf@gnu.org> (raw)
In-Reply-To: <87wqizbh0j.fsf@thinkpad.tsdh.org>

> From: Tassilo Horn <tsdh@gnu.org>
> Date: Fri, 20 Dec 2013 17:53:48 +0100
> 
> I've been documenting another item from etc/NEWS, and committed my
> changes (no bound branch).  When I wanted to bzr push, I got a message
> that the branches have diverged.
> 
> I've done "bzr pull" and "bzr merge" followed by a "bzr commit".

That was a mistake: "bzr pull" in a diverged branch doesn't do what
you think it does (bzr is not git).  The first line of "bzr help pull"
says:

  Purpose: Turn this branch into a mirror of another branch.

which is not what you want.

What you want is "bzr merge" from the remote branch, followed by "bzr
commit".  _Then_ you should be able to push.  IOW, omit the "bzr pull"
from the sequence of the commands, and you should be fine.

Having said that, I really don't recommend working from an unbound
branch, it will make things harder for you, due to subtle differences
in semantics of name-sake commands to which you are used to with git.
Instead, use a bound branch, and the workflow described in
http://www.emacswiki.org/emacs/BzrForEmacsDevs.  That way, you will
have recipes for commands that DTRT.  You can use local branches
(described on that page as well), if you prefer that, and merge onto
the bound branch immediately prior to committing (pushing) upstream.
This workflow has a much lower risk of causing damage both to your
branches and to the remote trunk.

Btw, is this the first time you did some local commits and tried to
push?  If not, how did your workflow look until now?

> How do I get back into a good, pushable state, preferably without losing
> my commit 115645 (or at least the changes)?  (I haven't tried pushing in
> fear of being able to screw things up.)

I think "bzr uncommit" in your branch will be able to remove all the
mistaken commits you've made, either one by one or all of them at once
(see "bzr help uncommit").  Then start over, this time correctly.  To
avoid losing your changes, save them first with "bzr diff -c REVNO",
and then you will be able to reapply them.

Another idea is to "bzr branch -r REVNO" a new branch, starting from
the revision before the screwup.  Then do everything again in the new
branch, this time correctly, and push from that.  You can then delete
the previous branch (or not, if you are afraid ;-)

Yet another idea is to save the changes with "bzr diff" as mentioned
above, then "bzr pull --overwrite" from upstream, followed by "bzr up"
which will give you a mirror of the current trunk.  Then reapply your
documentation changes and push.



  reply	other threads:[~2013-12-20 18:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20 16:53 Bzr help Tassilo Horn
2013-12-20 18:05 ` Eli Zaretskii [this message]
2013-12-20 18:47   ` Tassilo Horn
2013-12-20 20:37     ` Eli Zaretskii

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=8338lnbdoe.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tsdh@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).