[MERGE][bug #6700] diff on branches without working trees

Martin Pool mbp at sourcefrog.net
Tue Nov 20 03:30:01 GMT 2007


On Nov 20, 2007 2:12 PM, Ian Clatworthy <ian.clatworthy at internode.on.net> wrote:
> One possibility is to use a 'separator symbol' within the argument list
> before which are the files and after which are the branches. For
> example, if '--' were selected as the separator:
>
> * diff just files: bzr diff file1 dir1
> * diff trees: bzr diff -- tree1 tree2
> * diff files across trees: bzr diff file dir1 -- tree1 tree2
>
> Another option is to mark trees using a prefix like @, e.g.
>
> * diff just files: bzr diff file1 dir1
> * diff trees: bzr diff @tree1 @tree2
> * diff files across trees: bzr diff file dir1 @tree1 @tree2
>
> The prefix approach means things can be more freely mixed but stuffs up
> file completion for example. For that reason, I prefer the separator
> approach. I think it would work ok for several other commands (status,
> revert) that already take a file list. Not so sure about commands that
> take a branch currently and want a file mask though. Perhaps we could
> follow the same pattern for them but assume branches, not files, if --
> is not found ,say.
>
> Do you have any preference or other suggestions? I'm not fixed on -- as
> the separate BTW, '::' or '+' or '@' or whatever would work as well I think.

If you're going to do this, how about making them urls, and saying
that if it's a url, it must be a branch?  I'm reluctant to invent
special syntax like this for without some overall picture of how it
fits together there's quite a risk it'll get messy.

I'd rather use options to disambiguate them because that does not
introduce any new grammatical concepts.

 bzr diff --tree ../TRUNK FILE FILE

a separator would also be ok.

I still think we should dwim where it's reasonably possible, which to
me seems pretty much separate from wanting to diff without a tree.  I
have not read your patch yet though.

> > It would also be nice to support diffing arbitrary files within multiple
> > trees.
>
> My expectation is that diffing a renamed file across two trees ought to
> work (hmm - we ought to clearly document whether the old name or new
> name ought to be given in that case). Do you have something in mind
> separate to that that is best handled by bzr vs normal diff tools?

I agree it should work but I think Aaron's point is different -- we
want to say eg

  bzr diff --tree a --tree b file1 file2 file3

-- 
Martin



More information about the bazaar mailing list