Linus said git was a file system!
December 11, 2009 7:33 AM   Subscribe

Anybody have opinions on abstraction vs. commuting patchs (git, mercurial, darcs) for handling short form letters in latex?

I usually write form letters by first building a framework with various variables holding various bits that might change, and then tweaking the bits for individual letters. I found this "abstraction" approach was fairly efficient for very repetitive form letter, but I've encountered some situations requiring more flexible forum letters recently.

Does anyone have any comments about using distributed version control systems like git, mercurial, or darcs for forum letters? I'd imagine the main issue will be the enormous number of branches, so being able push a patch through to all branches simultaneously might become annoying.

I'd usually use git for version control, but maybe darcs is worth it here?

p.s. Anybody have other approaches for resolving this question?
posted by jeffburdges to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
Best answer: You could compromise and have most letters generated from your common template, and a few generated from tweaked templates on various branches. In the data file that feeds your templating, mention what (git?) branch to use for a particular row. Then when generating, loop on the branch first. I don't think it's worth it pushing changes from the main branch to the tweaked branches, once the branches have diverged and you're getting conflicts. Maybe you could make a merge driver that uses diff --ifdef to reincorporate your tweaks and get rid of branches.

Re the build question: the best answer is what I'd go with, but I added an alternative over there.
posted by Tobu at 8:42 AM on December 11, 2009


I'm not clear how a version control system would be the right take here. I always thought of version control as serving to help maintain a set of files that change over time, and branches to deal with different builds or versions of the entire whole. So I don't see how storing all of these form letters in a repository makes sense unless somehow you want to be able to check in and check out the different letters. It seems that it would be simpler to just have a hierarchical directory where you keep all the versions of form letters you are using organized by a system meaningful to you.

If there is an element of automation involved and that's why you're looking at source control systems, maybe Ant is a better choice?

Okay, looking at your title it seems like you are looking at this as a "File system" type situation anyway. Well, I suppose, but I don't see how git is an improvement over just having the files in a directory.

I'll admit I don't know enough about the mechanics of version control systems (commuting patches, for example) to know whether darsc/git really could be the best tool for the job. I'm just wondering if this is an example of the Law of the instrument happening.
posted by Deathalicious at 9:18 AM on December 11, 2009


Your details are a little fuzzy... scratch that. A lot fuzzy. But it doesn't sound like you need an SCM for whatever it is you are doing.

You probably should answer these questions before you get any real help:

Are you mail merging? Are you making letters to print, email, or post on a webpage? Via MS Word? LaTeX? HTML? Just plain old text? Are you on Windows? Mac? Unix? Who are you publishing to? What level of technical sophistication do you have? Are these letters technical in nature?

SCMs are used to track history of modifications to files and to facilitate collaboration. That's pretty much it. They aren't designed for mail merging but that doesn't mean one wouldn't be useful for you.
posted by chairface at 10:17 AM on December 11, 2009


Could you explain your issue a little better? I'm not sure I understand you, but I don't think VC systems are the right tool for what you're trying to do.

A simple template system + make could be useful, though - "I updated this template, generate everything that depends on it". That could get you extra leverage out of other tools.
posted by silentbicycle at 10:20 AM on December 11, 2009


Response by poster: I'm currently using latex macros, not exactly templates. A typical letter consists of various \[foo]paragraph commands inside a customized letter environment, and those commands then call various \[bar]line commands. I've found this approach useful for essentially identical letters that must satisfy varying requirements, like inserting a line or eliminating a paragraph, but a mild obstruction to whole scale restructuring.

I was mostly just curious if anyone had opinions about using version control to keep numerous slightly varying but ultimately substantially different english text aligned on common points. It's likely simpler to continue exactly what I've been doing already rather than inventing new tools, and hope the new letters stabilize. Just curious.

p.s. I'd vaguely envisioned various files/branches within a hierarchical relationship, in which any changed made to some files were automatically patched onto derived files/branches.
posted by jeffburdges at 11:46 AM on December 11, 2009


say more about the various requirements that must be satisfied and keeping "slightly varying but ultimately substantially different english text aligned on common points".

What volume of letters, paragraphs and lines are you talking about?

If you modify a line or paragraph, is there ever the need to revert back to a prior version? Or use multiple versions simultaneously?

I think i'd just right a program, and maybe use unit tests or quickcheck or similar to verify that requirements are met. Part of the reason i say this is that it seems it'll take as much verbiage to specify a configuration in an SCM as it will to specify a collection of paragraphs, possibly parameterized for extra specialization. And if that's the case, why not give urself the full power of a general purpose programming language rather than hope a scm will be able to express your requirements and constraints?
posted by at at 5:33 PM on December 11, 2009


« Older Very mild salad dressing for watercress salad?   |   Help Me Wash That Red Right Out of My Eye Newer »
This thread is closed to new comments.