Hello.
We're three developers trying to use git version control for a project that includes a handful of relatively complex pd patches and a bunch of text-based source files (c++ and html). A problem arises when git tries to merge one of the pd patches with another version of it: It fails and gives you a .pd file full of conflict markers that confuse the pd file parser.
Can anyone provide tips on how to diff two pd patches to find differences quickly so that conflicts can be fixed by hand without spending too much time trying to find differences?
Thanks!
On Wed, 2013-04-17 at 09:27 -0500, Rafael Vega wrote:
Can anyone provide tips on how to diff two pd patches to find differences quickly so that conflicts can be fixed by hand without spending too much time trying to find differences?
I think there is no way to sanely handle that. I treat .pd files as binary files in this regard. One small change can change the whole file. The objects within a patch are identified and ordered by an automatically given integer number. A small change might cause many objects to be renumbered without any relation to the previous version. Such a diff might be huge even if the change is very small.
I think you are left with avoiding conflicts whenever possible as Pd patches cannot be diff'd and merged in a meaningful way.
Roman
On 17/04/13 16:54, Roman Haefeli wrote:
Can anyone provide tips on how to diff two pd patches to find differences quickly so that conflicts can be fixed by hand without spending too much time trying to find differences?
I think there is no way to sanely handle that.
wasn't there some plan to use json
for pd patches in the (erm..) future?
cannot find that in the archives right now though..
y
Hi Rafa,
+1 on what Roman said.
We use Pure Data and Git a lot in our projects and you might find you have more luck organising a useable workflow in your team rather than trying to automatically diff/merge patches.
Here's some of the things we do:
them like classes. (use $0 passing to ensure communication - also makes your patch local so you could run multiple instances.)
time. Sometimes it's unavoidable but manual merges happen in bigger projects in other languages anyway.
Hope that helps, Joe
On 17 April 2013 15:54, Roman Haefeli reduzent@gmail.com wrote:
On Wed, 2013-04-17 at 09:27 -0500, Rafael Vega wrote:
Can anyone provide tips on how to diff two pd patches to find differences quickly so that conflicts can be fixed by hand without spending too much time trying to find differences?
I think there is no way to sanely handle that. I treat .pd files as binary files in this regard. One small change can change the whole file. The objects within a patch are identified and ordered by an automatically given integer number. A small change might cause many objects to be renumbered without any relation to the previous version. Such a diff might be huge even if the change is very small.
I think you are left with avoiding conflicts whenever possible as Pd patches cannot be diff'd and merged in a meaningful way.
Roman
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Thanks for the replies, that's what I feared :)
Joe, I like your suggestions about abstractions and $0, thanks!
On Wed, Apr 17, 2013 at 10:34 AM, Joe White white.joe4@gmail.com wrote:
Hi Rafa,
+1 on what Roman said.
We use Pure Data and Git a lot in our projects and you might find you have more luck organising a useable workflow in your team rather than trying to automatically diff/merge patches.
Here's some of the things we do:
- Split up your code into abstractions instead of sub-patches, treating
them like classes. (use $0 passing to ensure communication - also makes your patch local so you could run multiple instances.)
- Split tasks so that only one developer works on an abstraction at any
one time. Sometimes it's unavoidable but manual merges happen in bigger projects in other languages anyway.
- When committing make sure that only the desired files are added.
Hope that helps, Joe
On 17 April 2013 15:54, Roman Haefeli reduzent@gmail.com wrote:
On Wed, 2013-04-17 at 09:27 -0500, Rafael Vega wrote:
Can anyone provide tips on how to diff two pd patches to find differences quickly so that conflicts can be fixed by hand without spending too much time trying to find differences?
I think there is no way to sanely handle that. I treat .pd files as binary files in this regard. One small change can change the whole file. The objects within a patch are identified and ordered by an automatically given integer number. A small change might cause many objects to be renumbered without any relation to the previous version. Such a diff might be huge even if the change is very small.
I think you are left with avoiding conflicts whenever possible as Pd patches cannot be diff'd and merged in a meaningful way.
Roman
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Follow me on Twitter @diplojocus