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
Doing diff between two large files, which is larger than 10MB, can be time consuming. We'd better setup a size limitation and when a file exceeds that ceiling size, display some warning message to user before going on with diff.
--
YaojunFei - 2012-10-12
In most case, a readable text file won't be so large. I happened to see some large logs files uploaded by our TWiki users.
--
YaojunFei - 2012-10-12
Yes, good idea to add configure option for max size of attachments to handle diff.
Discussed at
JerusalemReleaseMeeting2012x10x12: This proposal is inactive. Anyone can claim it as a committed developer to implement the feature.
--
PeterThoeny - 2012-10-13
I changed the status to
ParkedProposal due to long inactivity. Anybody feel free to claim and implement this useful feature.
--
Peter Thoeny - 2015-06-18