strangeQuirks
strangeQuirks

Reputation: 5910

How to store large amounts of text and retain versioning?

Any tips on how to store large amounts of text, such as programming code. So I need to retain the tabs, spaces, etc?

Also how could i keep versions like say someone edits one line, i can see the changes that have been made?

Upvotes: 0

Views: 127

Answers (2)

Joshua Lowry
Joshua Lowry

Reputation: 1105

I agree with other posters that you probably want to use what has already been done. Sometimes rolling your own can be fun.

You could write a wrapper for the command line diff utils. Each user could have their own config to choose their preferred editor. The script would made a copy of the file, so you would have an orig and new. When done editing the script would kick off a diff and store that to disk and delete the original backup of the file. This way, you would only store the latest versions plus all diffs so you can revert back and also see the changes.

I would keep a log of all diffs created and tag them in a csv with the userid of the person who modified the file and the timestamp of the modification.

Upvotes: 0

Employed Russian
Employed Russian

Reputation: 213385

That's what various revision control systems are for.

Any of git, cvs, rcs, subversion and a host of others will work.

Upvotes: 3

Related Questions