diff should warn if tree is out of date with branch

Bug #318604 reported by Ioannis Ramfos
4
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

I have two identical branches on two machines. After making changes to the local machine and pushing the changes to the remote with "bzr push", the remote branch is updated but not the working tree as expected and displayed in the warning message.

However, when entering a "bzr diff" on the remote machine (before a "bzr update"), there is no output. I would expect to see the changes between the last revision and the working tree (or in other words, the reverse of the changes just pushed from the other branch). An other option would be a message that the working tree is out of date, as "bzr status" shows in this case.

After a "bzr update" the working tree is updated as expected and "bzr diff" shows no output as expected.
bzr version is 1.10.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 318604] [NEW] "bzr diff" after "bzr push" does not display changes

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

Ioannis Ramfos wrote:
> However, when entering a "bzr diff" on the remote machine (before a "bzr
> update"), there is no output.

This is by design. The diff is always against the working tree, not the
branch.

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

iEYEARECAAYFAkl1Fd4ACgkQ0F+nu1YWqI1nmgCdHAfJTpatDvFv81UHV3e4jKII
xVgAniDgRjLRiaASEmT/1lvCdlZ7IBXb
=Z2+j
-----END PGP SIGNATURE-----

Revision history for this message
Ioannis Ramfos (isr81) wrote : Re: "bzr diff" after "bzr push" does not display changes

I understand that "bzr diff" with no options gives the differences between the tip of the branch and the working tree. As after the "bzr push" the working tree is not updated (until a "bzr update"), I would expect "bzr diff" to reflect the differences between the working tree and the tip of the branch, as the files have remained on a previous version (the one before the push).

Is there any way that the working tree refers to something else then the current state of the files in the project directory?

Revision history for this message
Andrew Bennetts (spiv) wrote :

Actually, "bzr diff" is against the checkout's revision, not the branch's tip. That is, there are multiple parts involved:

 * the branch, which has a tip
 * the checkout, which has a branch and is "at" some revision of that branch (not necessarily the tip)
 * the files on disk, i.e. the contents of the working tree.

"bzr diff" gives you the difference between the working tree and the checkout. A different command, "bzr update", will update a checkout to the current branch tip.

It might be nice if "bzr diff" to warn if the checkout is out-of-date w.r.t. the branch tip, but that would probably be too expensive in many situations. At the moment, "bzr diff" in a heavyweight checkout is a purely local operation, but if it has to check the remote branch (which may be several seconds of SSH connection setup away) it will become much slower just in case it should emit a warning. On the other hand, "bzr status" already does this check.

I think you can also force diff to compare against the branch with "bzr diff -r branch:".

So probably this bug should be marked Invalid or Won't Fix. But maybe there's a way we can make this situation clearer.

Martin Pool (mbp)
summary: - "bzr diff" after "bzr push" does not display changes
+ diff should warn if tree is out of date with branch
Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Wishlist
Martin Pool (mbp)
Changed in bzr:
status: New → Confirmed
Martin Pool (mbp)
tags: added: easy
tags: added: diff
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.