pdf files should be treated as binary even though they look like text

Bug #382716 reported by Casufi
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Does it possible to learn bzr to process pdf files as binary?

D:\...1C7.7\Bases\Работа\Бухгалтерия_рабочая>bzr diff -r0..1 ClientBank |more
=== added directory 'ClientBank'
=== added file 'ClientBank/!Руководство пользователя.pdf'
--- ClientBank/!Руководство пользователя.pdf
 1970-01-01 00:00:00 +0000
+++ ClientBank/!Руководство пользователя.pdf
 2009-06-02 10:57:28 +0000
@@ -0,0 +1,3020 @@
%вгПУ-1.2
0000000016 00000 n xref
+0000000811 00000 n
+0000001466 00000 n
+0000001624 00000 n
+0000001802 00000 n
+0000002214 00000 n
+0000002896 00000 n
+0000012793 00000 n
+0000013006 00000 n
+0000013505 00000 n
+0000013720 00000 n
+0000013901 00000 n
+0000033543 00000 n
+0000034338 00000 n
+0000034863 00000 n
+0000047999 00000 n
+0000048205 00000 n
+0000064608 00000 n
+0000065184 00000 n
+0000065538 00000 n
+0000065746 00000 n
+0000000933 00000 n
+0000001444 00000 n
stream446 /Filter /FlateDecode /Length 150 0 R >> 9edcd0ef631130a4fc6e7>]
+H‰b``` ўҐ l ,N ИА
+ eaаpђf ahb pb ЁћФ |шЯC• Љ3 ˜_m TИ3сэ! dбWШ!Бї§еЅЭтЂfЕЉ $S xЉњ ;ЪX…k_q \й“ б )r PVlh ®№фўRС­т#§ЊВ
·-уЄWыд Ћx ‰@ЋinR© Џ–¦ n
ѕуAґ-‹Ѓ§б#Л v €Xџ
 ?Г Ж Ь к)з h8ЬoXМИl$!n!;-№Amюы& ¦ ¦ † ў њ ш j Љ!¶17°3LЉfфLм`Ї#®ЦIЃGЙ]$QЁ дBЕ‰• ЛT›9Љ\%\ @®76

D:\Develop\test>bzr --version
Bazaar (bzr) 1.15
  Python interpreter: C:\Develop\Python25\python.exe 2.5.4
  Python standard library: C:\Develop\Python25\lib
  bzrlib: C:\Develop\Python25\lib\site-packages\bzrlib
  Bazaar configuration: C:\Documents and Settings\Vladimir\Application Data\bazaar\2.0
  Bazaar log file: D:\Docs\.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Changed in bzr:
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Hi,

There's no option at the moment to change this. The file looks like text, it is printable, so bzr diffs it that way.

I can think of a couple of things we could do to improve this; maybe you can suggest more

1- a configurable list of file patterns (maybe as rules) to be treated as text or treated as binary, regardless of the contents of the files

2- a better heuristic that determines that this file is not really human-readable

Changed in bzr:
importance: Undecided → Medium
summary: - bzr process pdf files as text
+ pdf files should be treated as binary even though they look like text
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 382716] Re: bzr process pdf files as text

On Wed, 2009-06-10 at 00:13 +0000, Martin Pool wrote:
> Hi,
>
> There's no option at the moment to change this. The file looks like
> text, it is printable, so bzr diffs it that way.

I think diff is hookable at the core; a plugin could do better.

-Rob

Revision history for this message
Casufi (vladimirkotulskiy) wrote :

I think it is a good way to solve this problem to allow users to configure their preferences via some file

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.