Understanding pull

Ian Clatworthy ian.clatworthy at internode.on.net
Fri Mar 23 12:06:17 GMT 2007


Erik Bågfors wrote:
> On 3/23/07, Marius Kruger <amanic at gmail.com> wrote:
>> it will only pull the revisions you don't have
>>
>> and it can be done even after you changed some of your local files.
>> it will merge the new stuff with your stuff and let you know if there
>> were conflicts
>
> As long as you haven't committed the changes.
>
Understood.

>>  the only ways in which your branch isn't a clone of the remote 
>> branch is
>> 1) the revision order might be different
>
> No, not any more. It used to be that way in bzr, but not anymore.
> You're branches revision will be in the same order as the branch you
> pull from.
>
>
>> 2) your local changes will still only be in your local branch
>>
>
> Only uncommitted changes.
>
> The end result by running
> cd branch; bzr pull
>
> and
> rm -rf branch; bzr branch path/to/branch
>
> is the same, if you don't count uncommitted changes in the working tree.
>
> /Erik
>
So trying to summarise the various development models and matching 
Bazaar 'recipes' in my head, I initially found myself at a loss to 
understand why pull existed at all:

1. central repository model: checkout + update + commit(local or central)
2. distributed repository model: branch + merge + commit(local) + bundle 
+ email to gatekeeper

There are excellent reasons for merging from the 'master' code base and 
retesting before committing. But there are also plenty of times when the 
best time to resync your working tree is immediately *after* completing 
one fix before you start on the next. 'pull' would be ok in the former 
case but almost always fail in the latter case - given the "as long as 
local changes aren't committed" rule.

So what recipes involve pull? Do developers use it commonly in 
day-to-day development? I can see its applicability when I want a 
pristine local mirror of a master repository in order to run/test 
against when reporting bugs, say. By even in that case, what is pull 
buying me that merge isn't?
 
Ian C.

PS: Apologies if the questions above are dumb ones. I am truly impressed 
by just how flexible and powerful bazaar is. But with that power comes 
the need for multiple recipes for beginners where previously just one 
'sufficed' most of the time. The barrier to entry is low IMHO except in 
this area: CVS just has 'update' while bazaar has update/merge/pull to 
choose from.

>>
>>  On 3/23/07, Ian Clatworthy <ian.clatworthy at internode.on.net> wrote:
>> > Hi,
>> >
>> > Just trying to get my head around *exactly* what pull does. In
>> > particular, the FAQ states "often when you pull, your local branch
>> > becomes a clone of the other one.".
>> >
>> > Why does it say "often when you pull"? When will it not be a clone?
>> >
>> > To ask the question another way, how is pull different from 
>> deleting the
>> > directory and running branch again (other than speed and bandwidth)?
>> >
>> > Ian C.
>> >
>> >
>>
>>
>>
>> -- 
>>
>>
>>
>> I code therefore I am.
>
>



More information about the bazaar mailing list