cluttered output on diff of binary file
Bug #71307 reported by
Matthew Paul Thomas
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Low
|
Unassigned | ||
Breezy |
Fix Released
|
Medium
|
Jelmer Vernooij |
Bug Description
bzr 0.11.0, Ubuntu 6.10
When I "bzr add" a binary file, then do "bzr diff", I get a result like:
=== added file 'lib/canonical/
Binary files lib/canonical/
The first line makes sense; the second does not, because neither I nor the file existed in 1970. The second line should be omitted.
Related branches
lp:~jelmer/brz/diff-binary-weird
- Jelmer Vernooij: Approve
-
Diff: 49 lines (+16/-2)3 files modifiedbreezy/diff.py (+2/-2)
breezy/tests/blackbox/test_diff.py (+11/-0)
doc/en/release-notes/brz-3.1.txt (+3/-0)
description: | updated |
summary: |
- "bzr diff" produces silly result for binary files + cluttered output on diff of binary file |
tags: | added: diff easy |
tags: | added: check-for-breezy |
tags: | removed: check-for-breezy |
Changed in brz: | |
status: | New → In Progress |
assignee: | nobody → Jelmer Vernooij (jelmer) |
importance: | Undecided → Medium |
milestone: | none → 3.1.0 |
Changed in brz: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
Confirmed. The specifics are that:
1) To get the timestamp as part of the output, we actually cheat, and change the filename. So to get:
--- lib/canonical/foo 2005-01-02 ...
+++ lib/canonical/foo 2006-11-09 ...
we actually change the name of the file from 'lib/canonical/foo' to 'lib/canonical/foo' to 'lib/canonical/foo 2005-01-02 ...'
We really should have a separate parameter that we pass, so we don't get weird things later.
2) 1970 is the date of the epoch, and it is the date that diff uses when it is trying to say 'no such file'.
At one point we didn't have datestamps. Somebody asked for them because they worked better. And they also asked us to not use /dev/null, and instead use the filename.
Specifically, you can do:
$ mkdir a; echo foo > a/foo; mkdir b
$ diff -urN a b
--- a/foo 2007-01-03 15:35:10.000000000 -0600
+++ b/foo 1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-foo
I was surprised to see 'diff' use 1970 adjusted for the local time zone, but regardless that seems to be the "standard" output.
I personally don't really like the datestamps, but if someone finds them useful...
So I would argue that we do need to fix the code to use the real filenames, separate from the datestamps. I'm not sure what to do exactly for the rest.