sync of uncommitted code between 2 computers

Bug #263611 reported by Fabien Tassin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned
bzr (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Binary package hint: bzr

It would be nice to improve usability of bzr between 2 computers or more to synchronize uncommitted code. This has been discussed on IRC when I first bring the topic there.

Use case:

1/ Max works from home (computer A) or from the office (computer B)
2/ Max is working on a project where the workflow is to commit to the central/shared branch (on computer C) only complete patches (the tree must always build)
3/ The patch Max is working on is taking several days so he cannot commit to C to pass code between A and B (because it's not complete). Fake commit/uncommits are also unacceptable because the branch is shared and it will force A or B to push in override mode which could easily lead to loss of data.
4/ shared filesystems between A and B are not an option, and transport has to be on ssh, preferably doable from the side only (the other side could be firewalled, NATed or simply use a dynamic IP)

It is possible to scp the whole tree from A to B, then diff the two working trees and patch B but it's laborious.
Another option would be to revert B and pass a bzr diff from A to B, but it could lead to loss of data on B if B had diverged (a merge would have prevented that).
A better proposal on IRC was to use merge --uncommitted but it doesn't currently work on bzr+ssh or sftp ("is not a local path").

a bzr sync would be nice to have, with its own remembered locations, and with the same merge/conflicts mechanism as regular commits.

Tags: merge
Changed in bzr:
importance: Undecided → Wishlist
Revision history for this message
Wesley J. Landaker (wjl) wrote :

I would also love to see this, as the single-person-multiple-computer uncommitted-code synchronization issue comes up a lot when developing code from multiple locations (.e.g home/work, or laptop/desktop).

I think having "bzr merge --uncomitted" work on remote paths would pretty much solve this.

Here is a workaround in the meantime:
cd $LOCAL_BRANCH
rsync -a $REMOTE_BRANCH ../tmp-remote-branch
bzr merge --uncomitted ../tmp-remote-branch
rm -rf ../tmp-remote-branch

Revision history for this message
Fabien Tassin (fta) wrote :

this bug is indeed lacking love.

The bzr guys are probably working with a single computer, surely a laptop. Otherwise, they would have a need for something like this.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 263611] Re: sync of uncommitted code between 2 computers

I generally just commit and push in situations like this.
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Vincent Ladeuil (vila) wrote :

> The bzr guys are probably working with a single computer, surely a laptop.

:-)

Not really, but anyway.

If you can't commit to *a* branch, why not commit to *another* *private* branch, enjoying the comfort of a real branch and, when you're ready, merge back in your integration branch and push to the public one from there ?

bzr provides many ways to work with dumb servers with *branches*. Handling working trees on such servers is not going to happen anytime soon if only because dumb *protocols* doesn't provide enough support for that.

And since *some* computer need to provide access to both sides (home/office) to allow sharing, you'd get more support from bzr by using branches on that computer.

Changed in bzr:
status: New → Triaged
Revision history for this message
Wesley J. Landaker (wjl) wrote :

For all the "just commit" type answers: consider why merge --uncommitted is useful locally. This feature was added in bzr 0.10. It's super useful.

It's really redundant, because you could just commit and then merge. Or commit to "*another* *private*" branch and then merge. But sometimes doing "merge --uncomitted" makes things a zillion times simpler. You don't have to bother with making another branch, or messing up your commit history, or *not* messing up your commit history by playing games with rebasing or uncommits or diff and patch ... or whatever.

I know the original reporter called for a "sync" operation, but really a "merge --uncomitted" that worked on remote trees would really address 99% of this use case.

Anyway, I know this is a wishlist bug, and you might want to reject this idea for any number of reasons, but please don't reject this idea just because you *could* do it a different (and much more painful) way.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

fwiw, I do think it's useful to support merge --uncommitted on remote
trees, but it is nontrivial to implement (remote working trees are not
supported atm).
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Wishlist
status: New → Triaged
tags: added: merge
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.