[MERGE] make 'push' default to parent branch
John Arbash Meinel
john at arbash-meinel.com
Tue Jul 29 19:27:44 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel Watkins wrote:
| On Tue, 29 Jul 2008 11:14:24 -0700
| Colin D Bennett <colin at gibibit.com> wrote:
|> I agree: accidentally pushing to an upstream branch could be bad.
|> Don't the 'push/pull' operations potentially alter the target branch
|> history? (As opposed to simply adding new revisions.)
| Unless you pass '--overwrite' to either of them, you won't _lose_
| history[0]. However, if there are revisions to be pushed or pulled,
| then they will _alter_ history, by adding new revisions. This isn't as
| bad as losing history, but it's still not something it should be easy
| to do accidentally.
|
|
| Dan
|
| [Footnote 0: By "lose history" I mean "the revisions in the branch's
| history will be changed". The revisions themselves will
| still exist in the repository.]
It can change the mainline history if you don't have
"append_revisions_only = True" set. without append_... it just checks if
the current tip is in the *ancestry* of the tip you are pushing. Which
means that you won't ever lose revisions from a branch.
It depends how much you care about mainline. If we had
append_revisions_only defaulted to True, it would probably be safer to
have push default to :parent. But that is also a bzr-ism, and neither hg
nor git care about the mainline as much as we do.
I will also say that git's reflog does help here. It basically keeps a
list of all revisions that the branch has pointed to in the last 30-days
or so, regardless of how it got there. So commit/uncommit/push/pull/etc
can more easily be undone by consulting where the tip used to point.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkiPYSAACgkQJdeBCYSNAAOjfACg1zpa0l7pGYS/08M2dQMcLO5t
pD4AnRof7So7aunbwmBUARsk0qwxdOC6
=nNBP
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list