Serp remarks that GM is unsuitable for collaboration due to resources all being in one file.
I think a nice fix for this would be to store a time of creation (milliseconds-since-Jan-1970 style) as well as a time of last modification and time of last splice in with every resource.
LGM could then offer a splice function that would check each of the three things, like so:
If the resource exists in A (true, we're iterating)
{
If it doesn't in B (!B)
{
Keep A
}
else, it does exist in B (B)
{
If the time stamps of creation are the same (A.created == B.created)
{
If the time stamp of modification of A matches the time stamp of last splice of A (A.modified == A.spliced)
{
If the time stamp of modification of B does NOT match the timestamp of splice of B (B.modified != B.spliced)
Assume B is newer, and copy B to A
Else
Continue to the next resource; they should be the same.
}
else
{
If the time stamp of modification of B matches the timestamp of splice of B (B.modified == B.spliced)
Assume A is newer; keep it
Else (B.modified != B.spliced and A.modified != A.spliced)
I have no idea what to do here. Ask the user, show a Diff somehow. This is what requires work.
}
}
else, they are different resources entirely (A.created != B.created)
{
If the names are the same, both users may have been thinking the same thing (A.name == B.name)
If on prompt for action the user says to skip it
Continue to next resource
Increment the id of B to the next available resource ID.
}
}
}