Author Topic: Need a killer feature added to any Windows GUI diff tool (such as WinMerge, etc)  (Read 1033 times)

0 Members and 1 Guest are viewing this topic.

Offline Sandwich

  • Got Screen?
  • Administrator
  • 212
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Need a killer feature added to any Windows GUI diff tool (such as WinMerge, etc)
Basically, see here: http://sourceforge.net/tracker/index.php?func=detail&aid=3484771&group_id=13216&atid=363216

tl;dr: I want to be able to specify "equivalent strings" that the diff engine would ignore.

For the link-challenged:
Quote
I'm maintaining a plugin script (in PHP) for 2 different versions of ExpressionEngine, a popular commercial CMS. In one version, PHP cache functionality is accessed by "$SESS->cache", while in the other, by "$this->EE->session->cache". Obviously, WinMerge sees these as differences. I'd love to be able to indicate that these string pairs are to be considered equivalent to each other for purposes of comparison.

I imagine this would be useful in many situations, such as About Us pages containing email addresses of organizations that have local branches in different countries (eg. '[email protected]' would be equivalent to '[email protected]'), or perhaps even different spellings of words for different target audiences (eg. 'color' vs 'colour').

Any takers?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Tomo

  • 28
Re: Need a killer feature added to any Windows GUI diff tool (such as WinMerge, etc)
I doubt that such an approach would work, and it would be a real pain to maintain.

The problem you're hitting is not a new one, the classic examples are localisation and multi-platform applications.

The general solution is to have multiple target-specific source files or methods, and select the appropriate one to use at either compile or run time.

In the localisation example, there would be several language data files, one for "English", another "French", "Klingon" etc.
The appropriate file is then chosen at run time using some kind of user setting.

The same thing is done for multi-platform applications.
In the case of C/C++, usually using #ifdef ... #endif structures to enclose small call differences, or compiling using "win_stuff.cpp" as opposed to "linux_stuff.cpp" to select a platform-specific implementation of "stuff.h".

Take a look at the FSO source for examples!

PHP doesn't have a direct equivalent of #ifdef as it's an interpreted/JIT language, however you can get the same kind of effect using a straight if - then - else structure.

[Edit]

In your specific case, the very best way would be if there was some way for your plugin to determine the ExpressionEngine version automatically at runtime to pick the right call with no user intervention.
- Maybe APP_VER?

If that's not possible (or too difficult), then have a user-set config flag somewhere sensible so each user can manually set their ExpressionEngine version.
« Last Edit: March 14, 2012, 02:19:08 pm by Tomo »

 

Offline Sandwich

  • Got Screen?
  • Administrator
  • 212
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Re: Need a killer feature added to any Windows GUI diff tool (such as WinMerge, etc)
Interesting ideas... I still wish for an equivalent strings feature, but perhaps...
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill