Tags:
create new tag
, view all tags
This is a small patch that will show you the diffs of attachments. I wrote it with the idea that you could see the differences between various versions of an attached perl script.

There's a problem with binary files. I'm not totally familiar with the way that twiki implements diff, but on my system, diffing two binary files with GNU diff (v2.8.1) returns the message that "binary files foo and bar differ". The diff that twiki uses actually tries to diff the binaries and garbage is printed to the screen. I haven't thought of a way to work around that yet.

In any case, I find it useful. Perhaps someone smarter than me can massage it so that it will handle binary files correctly. These patches are against the latest stable version of TWiki (sorry, can't remember the code name). Please let me know if the patch is screwed up. It seemed to work for me when I tested it.

Category: TWikiPatches

-- AlexChiang - 09 Aug 2003

If there is any chance that this patch can be re-done using -u to give us context that would be great. We should consider it anyway though

-- SvenDowideit - 09 May 2004

I am attaching 3 context patches, respectively for lib/TWiki/Store.pm, bin/attach, and bin/rdiff. These are diffs against the unmodified Feb 2003 release.

-- AlexChiang - 26 Jul 2004

It should be possible to convert popular binary attachment format files (such as MS Word, Powerpoint, PDF, etc.) to HTML in order to facilitate using vanilla diff tools. Google already has the technology to display binary files like these in best effort HTML.

-- NiallMurray - 18 Aug 2005

How does this patch translate to versions 4.x.x ? Or is there already some way to do attachment diffs that I donīt know about?

-- MikkoLaakso - 11 Apr 2007

Eeeeek, another forgotten patch. I'd like to suggest it for the next release - can someone do me a favour and ask me about it in a month? (in case i forget again)

-- SvenDowideit - 11 Apr 2007

SvenDowideit, consider yourself asked.

-- JohnRouillard - 11 May 2007

Sven, did you see this?

-- JohnRouillard - 14 May 2007

I miss this feature as well, would be really useful.

-- MikkoLaakso - 20 May 2007

sven is too busy with user changes to work on this. if someone else would like to take on the task of bring the code patch up-to-date, then this could be something that ships for 4.2. otherwise, i would support its inclusion in a 4.2.1 release.

-- WillNorris - 25 May 2007

This proposal did not make the deadline for Freetown. The target is now Georgetown.

I am convinced noone will look at it for quite a while.

I am stopping the 14-day clock by raising this concern.

I would like to know how the feature will handle binary files such a jpegs, gifs, MS Word docs etc etc. A diff is not worth much unless it is a text file. I would not want to see a feature that produces garbage output for most files.

-- KennethLavrsen - 28 May 2007

This proposal has been waiting for answers to the concern I raised.

How will this feature handle non-text attachments? I cannot see that the attached patches address this.

If this can obvious issue can be handled in the spec (e.g. do not show a diff link unless the extension is one of a known list) then I have no further reservations against the proposal.

Is there still an interest in driving this proposal or do we just park it?

-- KennethLavrsen - 14 Apr 2008

I am parking this proposal based on the fact that the proposer has shown no interest to answer even a simple question for a year now. I park it to give those proposal where there is an interest more focus. To revive - simply un-park it.

-- KennethLavrsen - 29 May 2008

Pinging this topic. Useful feature. Anyone taking this?

-- PeterThoeny - 2010-08-01

Thanks PeterJones for working on this. I propose to limit the types of attachment to show the diffs. Either by the result of RCS ("binary files differ"), or by adding a {DiffAttachmentTypes} configure setting set to 'bat, c, cpp, css, h, htm, html, java, js, pl, py, rtf, sh, txt, svg'. In case a diff cannot be shown, show a message such as "__Note:__ Differences between versions of this binary file cannot be shown."

-- PeterThoeny - 2011-03-08

Peter Jones: Could you edit this page and add the spec & doc at the top of this page?

-- PeterThoeny - 2011-08-23

 
Topic attachments
I Attachment Action Size Date Who Comment
Unknown file formatpatch Store.pm.patch manage 1.3 K 2004-07-26 - 23:29 AlexChiang part 1 of 3
Unknown file formatpatch attach.patch manage 1.2 K 2004-07-26 - 23:31 AlexChiang part 2 of 3
TWiki logotwiki patch.twiki manage 6.0 K 2003-08-09 - 08:06 AlexChiang patch to diff attachments
Unknown file formatpatch rdiff.patch manage 1.6 K 2004-07-26 - 23:32 AlexChiang part 3 of 3
Topic revision: r23 - 2011-08-23 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.