Diff?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Diff?

Neville Smythe via use-livecode
I just discovered three very interesting functions in the Dictionary:

DiffCompare
DiffCompareFiles
DiffPatch

Supercool - I can put these to use soon.

The Dictionary entries for these are unusually sparse - anyone here know
which version these were added in, and why?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Diff?

Neville Smythe via use-livecode
Richard,

Library com.livecode.library.diff was introduce in 9.0

From the release notes:
diff library
A new library has been implemented for computing diffs between text sources and applying those diffs to text.

https://github.com/livecode/livecode/blob/develop/extensions/script-libraries/diff/diff.livecodescript

I have used it occasionally and it worked well once you get the syntax right and find out what it does.
Especially in

DiffCompare(pFrom,pTo,pContext)

how pContext works. It takes a little experimentation.

Kind regards
Bernd

>Richard wrote:
>I just discovered three very interesting functions in the Dictionary:
>
>DiffCompare
>DiffCompareFiles
>DiffPatch

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Diff?

Neville Smythe via use-livecode
I use this in ScriptTracker to get the changes when saving a stack.  I squash them together into a consolidated diff for the stack.  I have not done anything with the patch side though.

Thanks,
Brian
On Feb 1, 2020, 6:02 AM -0500, Niggemann, Bernd via use-livecode <[hidden email]>, wrote:

> Richard,
>
> Library com.livecode.library.diff was introduce in 9.0
>
> From the release notes:
> diff library
> A new library has been implemented for computing diffs between text sources and applying those diffs to text.
>
> https://github.com/livecode/livecode/blob/develop/extensions/script-libraries/diff/diff.livecodescript
>
> I have used it occasionally and it worked well once you get the syntax right and find out what it does.
> Especially in
>
> DiffCompare(pFrom,pTo,pContext)
>
> how pContext works. It takes a little experimentation.
>
> Kind regards
> Bernd
>
> > Richard wrote:
> > I just discovered three very interesting functions in the Dictionary:
> >
> > DiffCompare
> > DiffCompareFiles
> > DiffPatch
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Diff?

Neville Smythe via use-livecode
This is marvellous. This will be so useful.

Sean Cole
Pi Digital Prod Ltd

> On 1 Feb 2020, at 15:02, Brian Milby via use-livecode <[hidden email]> wrote:
>
> I use this in ScriptTracker to get the changes when saving a stack.  I squash them together into a consolidated diff for the stack.  I have not done anything with the patch side though.
>
> Thanks,
> Brian
>> On Feb 1, 2020, 6:02 AM -0500, Niggemann, Bernd via use-livecode <[hidden email]>, wrote:
>> Richard,
>>
>> Library com.livecode.library.diff was introduce in 9.0
>>
>> From the release notes:
>> diff library
>> A new library has been implemented for computing diffs between text sources and applying those diffs to text.
>>
>> https://github.com/livecode/livecode/blob/develop/extensions/script-libraries/diff/diff.livecodescript
>>
>> I have used it occasionally and it worked well once you get the syntax right and find out what it does.
>> Especially in
>>
>> DiffCompare(pFrom,pTo,pContext)
>>
>> how pContext works. It takes a little experimentation.
>>
>> Kind regards
>> Bernd
>>
>>> Richard wrote:
>>> I just discovered three very interesting functions in the Dictionary:
>>>
>>> DiffCompare
>>> DiffCompareFiles
>>> DiffPatch
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

DiffPatch question

Neville Smythe via use-livecode
In reply to this post by Neville Smythe via use-livecode
Consider this scenario:

I'm writing text A, and another team member has revised it in text B.

I can get a list of changes from A to B with DiffCompare.  Cool.

Then with DiffPatch I can apply that diff listing to A to make it like
the revised B.

What is the advantage of using DiffPatch over simply using the full text
of B?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: DiffPatch question

Neville Smythe via use-livecode
If you want to efficiently store all changes to a file.  This is what Git does.

The other advantage is that user C could also perform an edit to A.  You could apply the AC diff on top of B to get a combined update.  (Also what Git does)

Thanks,
Brian
On Feb 17, 2020, 2:58 PM -0500, Richard Gaskin via use-livecode <[hidden email]>, wrote:

> Consider this scenario:
>
> I'm writing text A, and another team member has revised it in text B.
>
> I can get a list of changes from A to B with DiffCompare. Cool.
>
> Then with DiffPatch I can apply that diff listing to A to make it like
> the revised B.
>
> What is the advantage of using DiffPatch over simply using the full text
> of B?
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email] http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode