What is the purpose of `rmbranch` command?

View: New views
13 Messages — Rating Filter:   Alert me  

What is the purpose of `rmbranch` command?

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

I thought `rmbranch` should delete a branch from remote server.

It does delete branch (e.g. from shared repository) but leaves .bzr
control directory there intact.

According to `rmbranch` help it should keep any working tree or
repository in place. OK, that's good.

But if there is neither working tree nor repository, why don't delete an
empty control directory?



Re: What is the purpose of `rmbranch` command?

by Jelmer Vernooij-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi Alexander,

On Tue, May 15, 2012 at 06:20:12PM +0300, Alexander Belchenko wrote:
> I thought `rmbranch` should delete a branch from remote server.

> It does delete branch (e.g. from shared repository) but leaves .bzr
> control directory there intact.
Right, it just deletes the branch, not the control directory.

> According to `rmbranch` help it should keep any working tree or
> repository in place. OK, that's good.

> But if there is neither working tree nor repository, why don't
> delete an empty control directory?
A control directory can have multiple branches. rmbranch is useful
mostly for colocated branches.

I don't think having a separate command for removing a control
directory would be particularly useful - it's already possible to just
remove the directory using e.g. the shell.

Cheers,

Jelmer


Re: What is the purpose of `rmbranch` command?

by Vincent Ladeuil-2 :: Rate this Message:

| View Threaded | Show Only this Message

>>>>> Jelmer Vernooij <jelmer@...> writes:

    > Hi Alexander,
    > On Tue, May 15, 2012 at 06:20:12PM +0300, Alexander Belchenko wrote:
    >> I thought `rmbranch` should delete a branch from remote server.

    >> It does delete branch (e.g. from shared repository) but leaves .bzr
    >> control directory there intact.
    > Right, it just deletes the branch, not the control directory.

    >> According to `rmbranch` help it should keep any working tree or
    >> repository in place. OK, that's good.

    >> But if there is neither working tree nor repository, why don't
    >> delete an empty control directory?
    > A control directory can have multiple branches. rmbranch is useful
    > mostly for colocated branches.

    > I don't think having a separate command for removing a control
    > directory would be particularly useful - it's already possible to just
    > remove the directory using e.g. the shell.

I don't think Alexander asked for a separate command. Instead, AIUI, his
point is that it makes little sense to remove the branch and leave an
otherwise *empty* control directory (not to mention other possible bugs
when trying to interact with this empty directory).

@bialix: worth filing a bug so we don't forget this.

         Vincent



Re: What is the purpose of `rmbranch` command?

by Jelmer Vernooij-2 :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, May 16, 2012 at 09:01:52AM +0200, Vincent Ladeuil wrote:

> >>>>> Jelmer Vernooij <jelmer@...> writes:
>
>     > Hi Alexander,
>     > On Tue, May 15, 2012 at 06:20:12PM +0300, Alexander Belchenko wrote:
>     >> I thought `rmbranch` should delete a branch from remote server.
>
>     >> It does delete branch (e.g. from shared repository) but leaves .bzr
>     >> control directory there intact.
>     > Right, it just deletes the branch, not the control directory.
>
>     >> According to `rmbranch` help it should keep any working tree or
>     >> repository in place. OK, that's good.
>
>     >> But if there is neither working tree nor repository, why don't
>     >> delete an empty control directory?
>     > A control directory can have multiple branches. rmbranch is useful
>     > mostly for colocated branches.
>
>     > I don't think having a separate command for removing a control
>     > directory would be particularly useful - it's already possible to just
>     > remove the directory using e.g. the shell.
>
> I don't think Alexander asked for a separate command. Instead, AIUI, his
> point is that it makes little sense to remove the branch and leave an
> otherwise *empty* control directory (not to mention other possible bugs
> when trying to interact with this empty directory).
This isn't always the case though - there can be other colocated
branches, a repository or a working tree. We have no way to remove a
repository for example.

As far as I understand this would unversion the current directory, which
would seem a bit odd. Am I misunderstanding something?

Cheers,

Jelmer


Re: What is the purpose of `rmbranch` command?

by John Arbash Meinel :: Rate this Message:

| View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

...

>> I don't think Alexander asked for a separate command. Instead,
>> AIUI, his point is that it makes little sense to remove the
>> branch and leave an otherwise *empty* control directory (not to
>> mention other possible bugs when trying to interact with this
>> empty directory).
> This isn't always the case though - there can be other colocated
> branches, a repository or a working tree. We have no way to remove
> a repository for example.
>
> As far as I understand this would unversion the current directory,
> which would seem a bit odd. Am I misunderstanding something?
>
> Cheers,
>
> Jelmer
>

bzr branch --no-tree lp:bzr target
bzr rmbranch target

Arguably, there should be no 'target/' directory left. Certainly that
is what people expect.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+zmfMACgkQJdeBCYSNAAOTjwCdGiLyQM9W9RAzNM7oRiFgBn67
UgYAoJUO/ewAsxyGuGpGj/VALDF0PrwN
=b4F6
-----END PGP SIGNATURE-----


Re: What is the purpose of `rmbranch` command?

by Vincent Ladeuil-2 :: Rate this Message:

| View Threaded | Show Only this Message

>>>>> Jelmer Vernooij <jelmer@...> writes:

<snip/>

    >> I don't think Alexander asked for a separate command. Instead, AIUI, his
    >> point is that it makes little sense to remove the branch and leave an
    >> otherwise *empty* control directory (not to mention other possible bugs
    >> when trying to interact with this empty directory).

    > This isn't always the case though - there can be other colocated
    > branches, a repository or a working tree. We have no way to remove a
    > repository for example.

But in those cases, the control directory (we're all talking about
'.bzr' not '.bzr/branch' right ?) is therefore not empty.

I don't think bialix is arguing about those valid cases.

  Vincent


Re: What is the purpose of `rmbranch` command?

by Jelmer Vernooij-12 :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, May 16, 2012 at 02:13:39PM +0200, John Arbash Meinel wrote:

> >> I don't think Alexander asked for a separate command. Instead,
> >> AIUI, his point is that it makes little sense to remove the
> >> branch and leave an otherwise *empty* control directory (not to
> >> mention other possible bugs when trying to interact with this
> >> empty directory).
> > This isn't always the case though - there can be other colocated
> > branches, a repository or a working tree. We have no way to remove
> > a repository for example.
> >
> > As far as I understand this would unversion the current directory,
> > which would seem a bit odd. Am I misunderstanding something?
> bzr branch --no-tree lp:bzr target
> bzr rmbranch target
>
> Arguably, there should be no 'target/' directory left. Certainly that
> is what people expect.
What Vincent and Alexander are arguing is that in that case the
target/ directory should be kept around - it still contains a
repository.

I don't like the idea of automatically removing the control directory
in the case when only .bzr/branch exists (and no .bzr/checkout or
.bzr/repository) since it makes the behaviour of "bzr rmbranch"
unpredictable.

Cheers,

Jelmer


Re: What is the purpose of `rmbranch` command?

by Jelmer Vernooij-12 :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, May 16, 2012 at 02:17:24PM +0200, Vincent Ladeuil wrote:

> >>>>> Jelmer Vernooij <jelmer@...> writes:
>
> <snip/>
>
>     >> I don't think Alexander asked for a separate command. Instead, AIUI, his
>     >> point is that it makes little sense to remove the branch and leave an
>     >> otherwise *empty* control directory (not to mention other possible bugs
>     >> when trying to interact with this empty directory).
>
>     > This isn't always the case though - there can be other colocated
>     > branches, a repository or a working tree. We have no way to remove a
>     > repository for example.
>
> But in those cases, the control directory (we're all talking about
> '.bzr' not '.bzr/branch' right ?) is therefore not empty.
That makes the behaviour of "bzr rmbranch" fairly unpredictable
though.

I can see the argument for removing a control directory if it's
completely empty, but I think we should be more consistent about that
- "bzr remove-tree" should do the same, and we should have a way to
remove a repository from a control directory.

Cheers,

Jelmer


Re: What is the purpose of `rmbranch` command?

by Vincent Ladeuil-2 :: Rate this Message:

| View Threaded | Show Only this Message

>>>>> Jelmer Vernooij <jelmer@...> writes:

    > On Wed, May 16, 2012 at 02:17:24PM +0200, Vincent Ladeuil wrote:
    >> >>>>> Jelmer Vernooij <jelmer@...> writes:
    >>
    >> <snip/>
    >>
    >> >> I don't think Alexander asked for a separate command. Instead, AIUI, his
    >> >> point is that it makes little sense to remove the branch and leave an
    >> >> otherwise *empty* control directory (not to mention other possible bugs
    >> >> when trying to interact with this empty directory).
    >>
    >> > This isn't always the case though - there can be other colocated
    >> > branches, a repository or a working tree. We have no way to remove a
    >> > repository for example.
    >>
    >> But in those cases, the control directory (we're all talking about
    >> '.bzr' not '.bzr/branch' right ?) is therefore not empty.
    > That makes the behaviour of "bzr rmbranch" fairly unpredictable
    > though.

Hmm, I don't fully agree but better understand your point.

    > I can see the argument for removing a control directory if it's
    > completely empty, but I think we should be more consistent about that
    > - "bzr remove-tree" should do the same, and we should have a way to
    > remove a repository from a control directory.

I agree with that too (with added controls in the repository case that
no branches uses the repository).

  Vincent



Re: What is the purpose of `rmbranch` command?

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

John Arbash Meinel пишет:

> ....
>
>>> I don't think Alexander asked for a separate command. Instead,
>>> AIUI, his point is that it makes little sense to remove the
>>> branch and leave an otherwise *empty* control directory (not to
>>> mention other possible bugs when trying to interact with this
>>> empty directory).
>> This isn't always the case though - there can be other colocated
>> branches, a repository or a working tree. We have no way to remove
>> a repository for example.
>>
>> As far as I understand this would unversion the current directory,
>> which would seem a bit odd. Am I misunderstanding something?
>>
>> Cheers,
>>
>> Jelmer
>>
>
> bzr branch --no-tree lp:bzr target
> bzr rmbranch target
>
> Arguably, there should be no 'target/' directory left. Certainly that
> is what people expect.

Yes, that was my intuitive expectation.

I'm OK with any behavior and don't claim current behavior as bug, but
I'd like to understand the intent of `rmbranch` command.

I see why Jelmer said that it was only useful for colocated branches.

My question arose because I tried to remove branch from bzr server
(bzr:// protocol + Trac) with that command, and I found that `rmbranch`
left almost everything on the server. That was confusing. (of course I
was able to inspect what's left on disk to understood what'd happened).

Now I better understand why other people confused, see
http://stackoverflow.com/questions/10474291/remove-a-parent-branch-in-bazaar/

I can only imagine a simple way to improve the current status-quo:
print something to the user when `bzr rmbranch URL:/to/branch` command
finishes, something about

`URL:/to/branch` is no more valid bzr branch, but still present on the disk.

In general, beyond colocated usage, this command is almost useless.

And I should note that for bzr-colo users it's useless at all, and
better to use special colo-prune (colo-delete) or qprune (qdelete) GUI
in all cases.

Thanks.


Re: What is the purpose of `rmbranch` command?

by Stefan Monnier :: Rate this Message:

| View Threaded | Show Only this Message

> I don't think having a separate command for removing a control
> directory would be particularly useful - it's already possible to just
> remove the directory using e.g. the shell.

There are plenty of remote Bzr servers that do not offer access via
a shell.  I really wish I could rename and delete branches (and the
corresponding directories) without needing access to a shell.


        Stefan



Re: What is the purpose of `rmbranch` command?

by Aaron Bentley-4 :: Rate this Message:

| View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-05-16 11:44 AM, Stefan Monnier wrote:
>> I don't think having a separate command for removing a control
>> directory would be particularly useful - it's already possible
>> to just remove the directory using e.g. the shell.
>
> There are plenty of remote Bzr servers that do not offer access via
> a shell.  I really wish I could rename and delete branches (and the
> corresponding directories) without needing access to a shell.

There's always hitchhiker, and for some sites, an sftp client works too.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+z38QACgkQ0F+nu1YWqI3Q9gCfXrmAYn3o8hnyIQlMRQW9zhGZ
ekIAn1m/Z2MRUBL3Wsmfp8YF72GNUVuT
=neEm
-----END PGP SIGNATURE-----


Re: What is the purpose of `rmbranch` command?

by Stefan Monnier :: Rate this Message:

| View Threaded | Show Only this Message

>>> I don't think having a separate command for removing a control
>>> directory would be particularly useful - it's already possible
>>> to just remove the directory using e.g. the shell.
>> There are plenty of remote Bzr servers that do not offer access via
>> a shell.  I really wish I could rename and delete branches (and the
>> corresponding directories) without needing access to a shell.
> There's always hitchhiker

Ha!  Just what I needed, thanks!


        Stefan