<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>platypope.org / blog / syndicate</title>
  <link href="http://platypope.org/blog/syndicate" rel="self"/>
  <link href="http://platypope.org/blog/" rel="alternate"/>
  <id>http://platypope.org/blog/</id>
  <updated>2008-08-19T12:37:40-04:00</updated>
  <author>
    <name>Marshall T. Vandegrift</name>
  </author>
  <entry>
    <title>Is this thing on?</title>
    <link href="http://platypope.org/blog/2008/8/19/is-this-thing-on" rel="alternate"/>
    <id>urn:uuid:fc4f14fa-6e0c-11dd-99de-aa008bfedbfd</id>
    <updated>2008-08-19T12:37:40-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;I've been busy and blog-neglecting lately, but I'm still here and hope to start blogging again soon.   And I want to test that my bits haven't completely rotted while I wasn't paying attention.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;: Still fresh!&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Look out Martians</title>
    <link href="http://platypope.org/blog/2008/3/26/look-out-martians" rel="alternate"/>
    <id>urn:uuid:6616d5d0-fbad-11dc-9e2f-aa008bfedbfd</id>
    <updated>2008-03-26T23:25:07-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Edison%27s_Conquest_of_Mars"&gt;Thomas Edison has your number.&lt;/a&gt;&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Nein!</title>
    <link href="http://platypope.org/blog/2008/3/25/nein" rel="alternate"/>
    <id>urn:uuid:86ca017e-fa79-11dc-9e2f-aa008bfedbfd</id>
    <updated>2008-03-25T10:41:17-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;My friend &lt;a href="http://posix4.blogspot.com/"&gt;posix4e&lt;/a&gt; has today the most awesome description evah of the nature of actual programming:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p class="quoted"&gt;Basically programming is often like playing golf in alice in wonderland with a referee who was trained by the SS.&lt;/p&gt;
&lt;/blockquote&gt;
    </content>
  </entry>
  <entry>
    <title>e-bookin&amp;rsquo;</title>
    <link href="http://platypope.org/blog/2008/3/21/e-bookin-rsquo" rel="alternate"/>
    <id>urn:uuid:629a763a-f79f-11dc-8e62-aa008bfedbfd</id>
    <updated>2008-03-21T19:40:03-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;Ooh &amp;#x2013; I have a blog.  Maybe I should use it to post things?&lt;/p&gt;

&lt;p&gt;On that theory, I present British author &lt;a href="http://www.richardherley.com/"&gt;Richard Herley&lt;/a&gt;.  Mr. Herley
&amp;#x2013; whose novel &lt;em&gt;&lt;a href="http://www.richardherley.com/PC.html"&gt;The Penal Colony&lt;/a&gt;&lt;/em&gt; was the basis for the
film &lt;em&gt;No Escape&lt;/em&gt; &amp;#x2013; is offering his books for free
download.  They are provided under a CC A-NC-ND licence, but he requests that
&amp;ldquo;honourable&amp;rdquo; readers pay him
a small fee if they enjoy the books.  I really hope this sort of business model
can work.&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Ode to building, part 2</title>
    <link href="http://platypope.org/blog/2007/8/8/ode-to-building-part-2" rel="alternate"/>
    <id>urn:uuid:6eb00258-4621-11dc-9fc7-aa008bfedbfd</id>
    <updated>2007-08-08T22:40:48-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;In &lt;a href="http://platypope.org/blog/2007/8/8/ode-to-building-part-1"&gt;the first part of this series&lt;/a&gt; I introduced the idea of what I termed
&lt;em&gt;abstract build policies&lt;/em&gt; &amp;mdash; higher-level methods for describing how to produce
the DAG of a build from a description of the desired inputs (sources) and
results (targets).  An abstract build policy allows developers to specify their
sources and targets in abstract terms and let the build system sort out the
details.  For example, the autotools allow a developer to specify that they
want to generate a shared library from a set of C source files:&lt;/p&gt;

&lt;pre class="example"&gt;&lt;span class="variable-name"&gt;lib_LTLIBRARIES&lt;/span&gt; = libexample.la
&lt;span class="variable-name"&gt;libexample_la_SOURCES&lt;/span&gt; = example.c example.h ...
&lt;/pre&gt;

&lt;p&gt;But what's really going on under the hood?&lt;/p&gt;

&lt;p&gt;Instead of requiring developers to describe the complete DAG of all
sources-to-targets steps in a build, the autotools conspire to allow the
developer to operate in terms of a set of higher-order abstractions:&lt;/p&gt;

&lt;dl&gt;
&lt;dd&gt;  systems::
The build is occurring on a particular kernel/OS/hardware combination (the
&lt;em&gt;build-system&lt;/em&gt;) to run on another (the &lt;em&gt;host-system&lt;/em&gt;) and may &amp;mdash; if producing a
compiler, etc. &amp;mdash; generate system-specific entities for another (the
&lt;em&gt;target-system&lt;/em&gt;).&lt;/dd&gt;
&lt;/dl&gt;

&lt;dl&gt;
&lt;dd&gt;  variants::
The user invoking the build may choose to add optional part of the build,
remove other parts, and cause yet other parts certain parts to occur in an
alternative fashion.&lt;/dd&gt;
&lt;/dl&gt;

&lt;dl&gt;
&lt;dd&gt;  sources::
The inputs to the build, some of which may themselves need to be generated
from predecessor sources.&lt;/dd&gt;
&lt;/dl&gt;

&lt;dl&gt;
&lt;dd&gt;  targets::
The kinds from a restricted set (e.g., shared library), names
(&lt;code&gt;libexample.so&lt;/code&gt;), and other properties (somewhat abstract installation
location or lack thereof) of entities to result from the build.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;The key aspect of the abstraction is that the developer describes her build
only in terms of the details relevant for the &lt;em&gt;particular&lt;/em&gt; build.  &amp;quot;This set of
source files produces a shared library.&amp;quot;  The autotools handle the nitty-gritty
of populating the DAG with all the nasty little details only real
toolchain-weenies &lt;em&gt;actually&lt;/em&gt; care about.&lt;/p&gt;

&lt;p&gt;In a perfect world (or for sufficiently simple/well-written code), the
developer doesn't care whether the code is being built with &lt;code&gt;gcc&lt;/code&gt; or the Sun
Workshop compiler, for OpenBSD or AIX.  If the code depends upon OS features
which vary from system to system, then the developer needs to account for those
variations, but &lt;em&gt;only&lt;/em&gt; those variations.  On Linux accessing &lt;code&gt;/proc&lt;/code&gt; involves
text-file parsing, on Solaris using a library interface, but the developer
still doesn't care which compiler the build invokes or which flags the linker
requires to coax it into producing a shared library.&lt;/p&gt;

&lt;p&gt;The key limitation of the autotools is that they provide no facility for
generating new abstractions.  As I said in part 1, they provide a set of
abstract build policies, but no a real &lt;em&gt;build policy abstraction&lt;/em&gt;.  The beauty
and downfall of the autotools is that they produce truly portable build
descriptions &amp;mdash; build descriptions which depend only on the POSIX shell, POSIX
utilities, POSIX &lt;code&gt;make&lt;/code&gt;, and a toolchain for the source language.  But providing
even as simple a new abstract policy as one for producing a new target type or
compiling a new source language is impossible without wholesale modification of
the autotools core.  And even then a new policy has little power to leverage
intermediate abstractions, ultimately needing to itself generate portable POSIX
&lt;code&gt;make&lt;/code&gt; rules.&lt;/p&gt;

&lt;p&gt;As originally promised for this part, part 3 will look at build tools which
allow definition of new abstractions and what that implies.&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Ode to building, part 1</title>
    <link href="http://platypope.org/blog/2007/8/8/ode-to-building-part-1" rel="alternate"/>
    <id>urn:uuid:fd00ce08-4620-11dc-9fc7-aa008bfedbfd</id>
    <updated>2007-08-08T22:35:34-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;[This is an only slightly edited repost from an earlier incarnation of my blog.
The archives from that blog didn't make the transition, but I'm planning to
continue the series, so here's this post again.]&lt;/p&gt;

&lt;p&gt;How does one build a piece of software from source?  The superficial answer is
run the tools&lt;a class="footref" href="#fn.22.1"&gt;1&lt;/a&gt; on the source and intermediate files in the proper order.  I'm
sure we've all slapped something in a single C source file and just run the
compiler on it from the shell.  The next logical step beyond this would be a
batch mechanism like a shell script running all the necessary commands.
Perhaps worthy of a post to &lt;a href="http://worsethanfailure.com/"&gt;worsethanfailure.com&lt;/a&gt; if I still had access to the
original, I've seen production binaries built with a file like:&lt;/p&gt;

&lt;pre class="example"&gt;&lt;span class="comment-delimiter"&gt;#&lt;/span&gt;&lt;span class="comment"&gt;! /bin/sh
&lt;/span&gt;
cc -c source1.c
cc -c source2.c
&lt;span class="comment-delimiter"&gt;# &lt;/span&gt;&lt;span class="comment"&gt;...
&lt;/span&gt;cc -o product source1.o source2.o &lt;span class="comment-delimiter"&gt;# &lt;/span&gt;&lt;span class="comment"&gt;...
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;In practice most of us use higher-level tools (thank god).  The &lt;code&gt;make&lt;/code&gt; tool
represents the obvious next step &amp;quot;Unix philosophy&amp;quot;-wise.  It assembles a
directed acyclic graph of files in the build and performs the steps necessary
to build the parts of the graph not yet present, leveraging the POSIX shell to
represent and execute each build step.  Some projects &amp;mdash; it seems to be
&lt;a href="http://lxr.linux.no/source/Makefile"&gt;especially&lt;/a&gt; &lt;a href="http://cvs.opensolaris.org/source/xref/on/usr/src/uts/Makefile"&gt;popular&lt;/a&gt; &lt;a href="http://fxr.watson.org/fxr/source/Makefile"&gt;for&lt;/a&gt; &lt;a href="http://cvs.savannah.gnu.org/viewcvs/hurd/hurd/Makefile?rev=HEAD"&gt;kernels&lt;/a&gt; &amp;mdash; use what I'll call Plain Old Make (POM),
applying &lt;code&gt;make&lt;/code&gt; &amp;quot;directly.&amp;quot;&lt;/p&gt;

&lt;p&gt;I put &amp;quot;directly&amp;quot; in quotation marks because most large POM projects put a fair
amount of engineering effort into constructing higher-level abstractions
applied consistently and automatically throughout the project.  In standard
Unix fashion &lt;code&gt;make&lt;/code&gt; provides &amp;quot;mechanism not policy.&amp;quot;  In this case &lt;code&gt;make&lt;/code&gt;
implements the &amp;quot;mechanism&amp;quot; of bringing all the DAG nodes up to date, but
requires &lt;code&gt;make&lt;/code&gt; users to specify the &amp;quot;policy&amp;quot; of how to create each of those
nodes from their dependencies&lt;a class="footref" href="#fn.22.2"&gt;2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This leads to two interesting observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most projects &amp;mdash; especially large ones &amp;mdash; want factored build policies
(node patterns) they can apply consistently throughout the project.&lt;/li&gt;
&lt;li&gt;Most projects share an awful lot of policy in common.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The GNU version of &lt;code&gt;make&lt;/code&gt; includes extension to help with the first&lt;a class="footref" href="#fn.22.3"&gt;3&lt;/a&gt;, but for
the second we move on to yet higher-level tools.&lt;/p&gt;

&lt;p&gt;Most open source projects these days describe their builds using the GNU
autotools: &lt;a href="http://www.gnu.org/software/autoconf/"&gt;autoconf&lt;/a&gt;, &lt;a href="http://www.gnu.org/software/automake/"&gt;automake&lt;/a&gt;, and &lt;a href="http://www.gnu.org/software/libtool/"&gt;libtool&lt;/a&gt;.  The autotools provide abstract
build policies which factor reusable build logic.  They provide these policies
in two ways.  First, the autotools &amp;quot;know about&amp;quot; certain kinds of common build
targets &amp;mdash; they include the logic necessary to build a &amp;quot;program&amp;quot; or a &amp;quot;shared
library&amp;quot; on supported platforms, requiring the developer only to specify the
kind of target desired, not all the steps necessary to achieve it.  Second, the
autotools provide a policy for producing certain kinds of variant builds &amp;mdash;
they probe for features of the target platform and implement a policy for
reacting to those features&lt;a class="footref" href="#fn.22.4"&gt;4&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Unfortunately, the autotools limit their abstract policy capabilities in an
important way: the inability to implement new abstract policies.  The autotools
make it possible to descend to the mechanism level of &lt;code&gt;make&lt;/code&gt;, &lt;code&gt;m4&lt;/code&gt;, and the POSIX
shell, but only in the same concrete way those tools do on their own.  The
autotools provide a collection of &lt;em&gt;abstract policies&lt;/em&gt;, but no real &lt;em&gt;policy
abstraction&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Build tools which implement real build policy abstractions move us out of the
realm of current popular use and on into part 2 of this series...&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.22.1"&gt;1&lt;/a&gt;  e.g., compiler, linker, Whiz-bang Source Frobnicator Enterprise Edition&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.22.2"&gt;2&lt;/a&gt;  The pedantic will note &lt;code&gt;make&lt;/code&gt; support for &amp;quot;pattern rules,&amp;quot; but I consider
the fact that POSIX &lt;code&gt;make&lt;/code&gt; pattern rules don't account for e.g. the
different ways an object file needs to be generated for inclusion in an
executable vs. a shared library enough for me to ignore them in this
discussion.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.22.3"&gt;3&lt;/a&gt;  &lt;code&gt;$(include)&lt;/code&gt; and friends, although they're pretty clunky in practice.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.22.4"&gt;4&lt;/a&gt;  This would be your &lt;code&gt;config.h&lt;/code&gt; and its &lt;code&gt;HAVE_FOO_H&lt;/code&gt; etc. macros.&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>A compendium of awesomeness</title>
    <link href="http://platypope.org/blog/2007/8/5/a-compendium-of-awesomeness" rel="alternate"/>
    <id>urn:uuid:d212507a-43b1-11dc-9fc7-aa008bfedbfd</id>
    <updated>2007-08-05T20:29:25-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;&lt;a href="http://www.getmiro.com/"&gt;Miro&lt;/a&gt; rocks.  Due to it's awesomeness I've been catching up on all those Google
Tech Talks I haven't found the time to stare at in a Web browser.  And it gives
me a reason to stop cursing how &lt;code&gt;wmii/stable&lt;/code&gt;&lt;a class="footref" href="#fn.21.1"&gt;1&lt;/a&gt; considers &amp;quot;fullscreen&amp;quot; for
&amp;quot;chumps&amp;quot; &amp;mdash; 
&lt;code&gt;miro&lt;/code&gt; in &amp;quot;fullscreen&amp;quot; mode fits quite nicely in one corner of my
laptop display.&lt;/p&gt;

&lt;p&gt;Among the Google Tech Talks, the one on &lt;a href="http://video.google.com/videoplay?docid=2538831956647446078"&gt;7 Habits For Effective Text Editing 2.0&lt;/a&gt;
included a mention of a &lt;code&gt;vim&lt;/code&gt; command which (in Emacs-speak) starts an
incremental search on the token at point.  I rather liked that, which yields:&lt;/p&gt;

&lt;pre class="example"&gt;&lt;span class="comment-delimiter"&gt;;; &lt;/span&gt;&lt;span class="comment"&gt;I-search with initial contents
&lt;/span&gt;(&lt;span class="keyword"&gt;defvar&lt;/span&gt; &lt;span class="variable-name"&gt;isearch-initial-string&lt;/span&gt; nil)

(&lt;span class="keyword"&gt;defun&lt;/span&gt; &lt;span class="function-name"&gt;isearch-set-initial-string&lt;/span&gt; ()
  (remove-hook 'isearch-mode-hook 'isearch-set-initial-string)
  (setq isearch-string isearch-initial-string)
  (isearch-search-and-update))

(&lt;span class="keyword"&gt;defun&lt;/span&gt; &lt;span class="function-name"&gt;isearch-forward-at-point&lt;/span&gt; (&lt;span class="type"&gt;&amp;amp;optional&lt;/span&gt; regexp-p no-recursive-edit)
  &lt;span class="doc"&gt;"Interactive search forward for the symbol at point."&lt;/span&gt;
  (interactive &lt;span class="string"&gt;"P\np"&lt;/span&gt;)
  (&lt;span class="keyword"&gt;if&lt;/span&gt; regexp-p (isearch-forward regexp-p no-recursive-edit)
    (&lt;span class="keyword"&gt;let*&lt;/span&gt; ((end (&lt;span class="keyword"&gt;progn&lt;/span&gt; (skip-syntax-forward &lt;span class="string"&gt;"w_"&lt;/span&gt;) (point)))
           (begin (&lt;span class="keyword"&gt;progn&lt;/span&gt; (skip-syntax-backward &lt;span class="string"&gt;"w_"&lt;/span&gt;) (point))))
      (&lt;span class="keyword"&gt;if&lt;/span&gt; (eq begin end)
          (isearch-forward regexp-p no-recursive-edit)
        (setq isearch-initial-string (buffer-substring begin end))
        (add-hook 'isearch-mode-hook 'isearch-set-initial-string)
        (isearch-forward regexp-p no-recursive-edit)))))
&lt;/pre&gt;

&lt;p&gt;But then the &lt;em&gt;real&lt;/em&gt; awesomeness I can't believe I've only just recently
discovered &amp;mdash; what language do you think this is?:&lt;/p&gt;

&lt;pre class="example"&gt;cdef extern &lt;span class="keyword"&gt;from&lt;/span&gt; &lt;span class="string"&gt;"awesomelib.h"&lt;/span&gt;:
    cdef int completely_awesome_function(char *nice)

cdef &lt;span class="keyword"&gt;class&lt;/span&gt; &lt;span class="type"&gt;CoolThing&lt;/span&gt;:
    cdef int totally
    &lt;span class="keyword"&gt;def&lt;/span&gt; &lt;span class="function-name"&gt;__init__&lt;/span&gt;(&lt;span class="keyword"&gt;self&lt;/span&gt;, nice):
        &lt;span class="keyword"&gt;self&lt;/span&gt;.totally = completely_awesome_function(nice)
&lt;/pre&gt;

&lt;p&gt;Python?  Not quite.  C?  Closer, in a sense.  It's &lt;a href="http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/"&gt;Pyrex&lt;/a&gt;, a Python-like
language which encapsulates (but distinguishes) both Python and C constructs,
then compiles to C code which uses the Python/C API to provide a Python module.
Pyrex does the standard simple type conversions SWIG or a given &amp;lt;Foo&amp;gt;Inline
will handle, but also allows the easy creation of extension types (Python
objects with C data members) and by-god-&lt;em&gt;simple&lt;/em&gt; Python callback routines passed
to C callback APIs.&lt;/p&gt;

&lt;p&gt;This might just be the straw which pushes me back into the squeezy embrace of
Python as my LoC.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.21.1"&gt;1&lt;/a&gt;  Debian's &lt;code&gt;wmii/testing&lt;/code&gt; is 3.5, which breaks my &lt;code&gt;ruby-wmii&lt;/code&gt; setup.&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Will the real hack please stand up</title>
    <link href="http://platypope.org/blog/2007/4/15/will-the-real-hack-please-stand-up" rel="alternate"/>
    <id>urn:uuid:c533634c-eba7-11db-9f94-00163e5b4df7</id>
    <updated>2007-04-15T19:23:06-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;I think I've changed my mind re: SVK and &lt;code&gt;svn:externals&lt;/code&gt;, because it turns out
this works just like you'd hope it would&lt;a class="footref" href="#fn.20.1"&gt;1&lt;/a&gt;:&lt;/p&gt;

&lt;pre class="example"&gt;svk mirror svn://project1/ //mirror/project1
svk mirror svn://project2/ //mirror/project2
svk sync --all
svk cp //mirror/project1 //local/project1
svk cp //mirror/project2 //local/project1/vendor/project2
svk push //local/project1
&lt;/pre&gt;

&lt;p&gt;Then later do:&lt;/p&gt;

&lt;pre class="example"&gt;svk pull //local/project1/vendor/project2
svk push //local/project1
&lt;/pre&gt;

&lt;p&gt;I've decided that &lt;code&gt;svn:externals&lt;/code&gt; is the real hack.  I've generally seen it used
to solve two different problems: (a) exporting common modules as part of
different projects stored in the same repository; and (b) importing "vendor
branches" from other repositories.  The problem is that it doesn't really do
either well.&lt;/p&gt;

&lt;p&gt;First, &lt;code&gt;svn:externals&lt;/code&gt; requires a fully-qualified URI.  This causes it to break
if either the repository moves or the repository is accessed by different
protocols.  Both of those problems can be "solved" with "don't do that," but
I've personally had cause for both.  Obviously either of these will break
people vendoring from your repo, but a URI-change shouldn't break internal
module sharing.  The fact of the matter is that the URI for a repo is a
non-canonical name &amp;mdash; and Subversion even accounts for this fact by generating
a UUID for each repository.&lt;/p&gt;

&lt;p&gt;Second, &lt;em&gt;directly&lt;/em&gt; incorporating some chunk of repo into your project is rarely
what you want to do.  I've been guilty of this before &amp;mdash; and am rather
embarrassed thinking about it.  I might be going out on a limb, but I think
most vendor branches need to (a) be pinned to a known-stable version; and (b)
include local modifications.  For the former, &lt;code&gt;svn:externals&lt;/code&gt; depends on either
good tagging in the source project or (shiver) pinning to a specific revision.
For the latter, &lt;code&gt;svn:externals&lt;/code&gt; provides no help whatsoever.  In fact, the
Subversion manual &lt;a href="http://svnbook.red-bean.com/nightly/en/svn.advanced.vendorbr.html"&gt;chapter on vendor branches&lt;/a&gt; barely mentions &lt;code&gt;svn:externals&lt;/code&gt;,
preferring instead careful branch-management and merge practices&lt;a class="footref" href="#fn.20.2"&gt;2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So I think SVK's way of doing things is quite a bit closer to a solution,
although still not quite.  It solves the problems discussed above, but still
requires the local mirror exist (i.e., external configuration), and breaks when
switching the actual source (tag, etc.) of the vendor branch&lt;a class="footref" href="#fn.20.3"&gt;3&lt;/a&gt;.  "Here's 2
cents &amp;mdash; go get yourself a real distributed version control system," I hear
some of you saying...&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.20.1"&gt;1&lt;/a&gt;   For the SVK-unfamiliar, this is almost exactly what &lt;a href="http://piston.rubyforge.org/"&gt;Piston&lt;/a&gt; lets you do,
only in both directions.
&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.20.2"&gt;2&lt;/a&gt;   And a Perl script, apparently.
&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.20.3"&gt;3&lt;/a&gt;   Breaks &lt;code&gt;pull&lt;/code&gt; and the UUID-tracking, that is.  A generic &lt;code&gt;smerge&lt;/code&gt; will still
work just fine.&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Home sweet version-controlled home</title>
    <link href="http://platypope.org/blog/2007/4/15/home-sweet-version-controlled-home" rel="alternate"/>
    <id>urn:uuid:c3f8e8d8-eb09-11db-bb95-00163e5b4df7</id>
    <updated>2007-04-15T00:30:38-04:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;I've been meaning to do this for quite a while, but I finally have my entire
home directory under revision control.  I've been keeping most of my important
rcfiles in a Subversion repo &amp;mdash; and of course no source code goes unversioned
 &amp;mdash; but everything else has just never made it into anything other than
my... um... "infrequent"&lt;a class="footref" href="#fn.19.1"&gt;1&lt;/a&gt; off-site back-ups.  Until now!&lt;/p&gt;

&lt;p&gt;I looked briefly over several version control systems before finally deciding
to stick with Subversion.  It's stable, the most widely used by open source
projects (after CVS), hacked on by someone I know, and only lacks one feature
I'd miss.  Work-use of SCM might have affected my decision, but my current day
job is using &lt;a href="http://www.borland.com/us/products/starteam/index.html"&gt;StarTeam&lt;/a&gt;&lt;a class="footref" href="#fn.19.2"&gt;2&lt;/a&gt; so... no.&lt;/p&gt;

&lt;p&gt;The one feature I'd miss is distributed development.  All the cool kids are
doing it &amp;mdash; not to mention the more recent change-set oriented OSS version
control systems.  So I'm layering that on with &lt;a href="http://svk.bestpractical.com/view/HomePage"&gt;SVK&lt;/a&gt;.  If you haven't heard of
it, SVK is... well... a giant hack.  And written in Perl none the less.  It
essentially uses the Subversion libraries to implement an alternate interface
for working with Subversion repositories.  The main intent is something like
distributed development&lt;a class="footref" href="#fn.19.3"&gt;3&lt;/a&gt;, but the way SVK goes about it has some interesting
effects.&lt;/p&gt;

&lt;p&gt;The big one is how working copies are maintained.  The SVN tools maintain with
each working copy a pristine copy of the revision checked out from the remote
repository.  This allows for fast revert, diff, etc., and is also probably the
easiest way to allow preparation of the change-set for commit.  SVK instead of
maintaining that pristine revision, &lt;em&gt;mirrors the remote repository&lt;/em&gt;.  This allows
diffing not only against the checked out revision, but against any revision in
the mirror &amp;mdash; or between any revisions in the mirror.  Want to checkpoint some
experimental code?  Commit it locally and only push it out after it's finished.
Need to switch from your experimental code to mainline development?  Create
local branches switch your working copy between them at will.&lt;/p&gt;

&lt;p&gt;And this is kind of petty, but not having those &lt;code&gt;.svn&lt;/code&gt; directories in each
checkout means I can stop using this monstrosity:&lt;/p&gt;

&lt;pre class="example"&gt;&lt;span class="builtin"&gt;export&lt;/span&gt; &lt;span class="variable-name"&gt;SFIND_PRUNE_PATS&lt;/span&gt;=&lt;span class="string"&gt;'*~:*/CVS:*/.svn'&lt;/span&gt;
sfind() {
    &lt;span class="builtin"&gt;local&lt;/span&gt; &lt;span class="variable-name"&gt;dirs&lt;/span&gt;=&lt;span class="string"&gt;''&lt;/span&gt;
    &lt;span class="keyword"&gt;while&lt;/span&gt; [ $# != 0 ]; &lt;span class="keyword"&gt;do&lt;/span&gt;
        &lt;span class="builtin"&gt;echo&lt;/span&gt; &lt;span class="string"&gt;"$1"&lt;/span&gt; | grep &lt;span class="string"&gt;'^-'&lt;/span&gt; &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; &lt;span class="keyword"&gt;break&lt;/span&gt;
        &lt;span class="variable-name"&gt;dirs&lt;/span&gt;=&lt;span class="string"&gt;"$dirs '$1'"&lt;/span&gt;; &lt;span class="builtin"&gt;shift&lt;/span&gt;
    &lt;span class="keyword"&gt;done&lt;/span&gt;
    &lt;span class="builtin"&gt;local&lt;/span&gt; &lt;span class="variable-name"&gt;opts&lt;/span&gt;=&lt;span class="string"&gt;"$(&lt;/span&gt;&lt;span class="sh-quoted-exec"&gt;squote&lt;/span&gt;&lt;span class="string"&gt; "$@")"&lt;/span&gt;

    &lt;span class="builtin"&gt;local&lt;/span&gt; &lt;span class="variable-name"&gt;prune_args&lt;/span&gt;=&lt;span class="string"&gt;"-path '$(\
        echo "$SFIND_PRUNE_PATS" | sed -e "s,:,' -o -path ',g")'"&lt;/span&gt;
    &lt;span class="builtin"&gt;eval&lt;/span&gt; &lt;span class="string"&gt;"find $dirs \
              '(' '(' $prune_args ')' -prune ')' \
              -o $opts -print"&lt;/span&gt;
}
&lt;/pre&gt;

&lt;p&gt;SVK used to have a reputation for being a bit unstable.  So far, the only
problem I've had there is trying to use version 2.0's "views" feature, which is
clearly tagged as "very beta."  And even if it does fall over, my "real"
repository is still just plain old Subversion.&lt;/p&gt;

&lt;p&gt;Lest I mislead you into believing SVK to be all kittens and sunshine, I have
had some problems.  SVK doesn't allow overlapping working copies, so keeping
all of &lt;code&gt;~&lt;/code&gt; in a repo involves symlinks.  SVK keeps all pending non-file
changes&lt;a class="footref" href="#fn.19.4"&gt;4&lt;/a&gt; in one big YAML file &amp;mdash; prepare a commit with a lot of deletes, and
you can feel the parse time.  SVK doesn't support &lt;code&gt;svn:externals&lt;/code&gt;, so WYSIWYG
when it comes to your repo's directory hierarchy.  SVK's "views" are supposed
to provide similar functionality, but in addition to not being there yet
implementation-wise, they seem a bit off design-wise &amp;mdash; and still aren't
&lt;code&gt;svn:externals&lt;/code&gt;.  And did I mention that it's written in Perl?&lt;/p&gt;

&lt;p&gt;But it's mostly kittens and sunshine, and I don't have to worry about letting
cups of coffee near my laptop anymore.  For next blog post: where I'm keeping
this homedir Subversion repo of mine...&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.19.1"&gt;1&lt;/a&gt;   i.e., usually made shortly after some sort of laptop + liquid incident.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.19.2"&gt;2&lt;/a&gt;   I can vaguely understand using a proprietary version control system, but
one which didn't have atomic commits until its most recent release?  Come
on, people.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.19.3"&gt;3&lt;/a&gt;   Projects are still tied to a central repository, which is either impure or
just practical, depending on how you look at it.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.19.4"&gt;4&lt;/a&gt;   Directory hierarchy changes, property modifications, etc.&lt;/p&gt;
    </content>
  </entry>
  <entry>
    <title>Fun with screen</title>
    <link href="http://platypope.org/blog/2007/3/10/fun-with-screen" rel="alternate"/>
    <id>urn:uuid:0e7e3124-cf21-11db-bb95-00163e5b4df7</id>
    <updated>2007-03-10T11:09:27-05:00</updated>
    <author>
      <name>Marshall T. Vandegrift</name>
    </author>
    <content type="html">
&lt;p&gt;Despite being such an Emacs zealot, I've never been able to love any of the
Emacs shell solutions.  Emacs' terminal emulation is just off enough to bug me,
and &lt;code&gt;eshell&lt;/code&gt; drives me nuts&lt;a class="footref" href="#fn.18.1"&gt;1&lt;/a&gt;.  So that leaves me running a shell in a dedicated
terminal (emulator).  Because I do most of my work in Emacs &amp;mdash; including using
&lt;code&gt;tramp&lt;/code&gt; to edit files on remote systems &amp;mdash; I rarely need to have more than one
terminal &lt;em&gt;visible&lt;/em&gt; at any one time, however many I have running.  Solution: the
&lt;a href="http://www.gnu.org/software/screen/"&gt;GNU screen&lt;/a&gt; "terminal multiplexer."&lt;/p&gt;

&lt;p&gt;Check it out if you haven't heard of it, but this post is mostly about a &lt;code&gt;screen&lt;/code&gt;
configuration trick I've found useful.  Screen has the ability to have a status
line showing the open virtual terminals, each designated by a title.  The title
of each window can either be static, or dynamically updated based upon a
watched-for pattern in the terminal output.  The pattern-watching mechanism is
geared toward titling each virtual terminal with the currently running
command&lt;a class="footref" href="#fn.18.2"&gt;2&lt;/a&gt;.  My configuration hack is to use that mechanism to display instead
the name of the host I've remotely logged into in that terminal.&lt;/p&gt;

&lt;p&gt;Here's the relevant bit of my &lt;code&gt;.screenrc&lt;/code&gt;:&lt;/p&gt;

&lt;pre class="example"&gt;shelltitle '@|'
hardstatus alwayslastline '%-Lw%{= BW}%50&amp;gt;%n%f* %t%{-}%+Lw%&amp;lt;'
&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;hardstatus&lt;/code&gt; directive is taken pretty much directly from the &lt;code&gt;screen&lt;/code&gt;
documentation.  The &lt;code&gt;shelltitle&lt;/code&gt; directive tells &lt;code&gt;screen&lt;/code&gt; that after it sees the
(built-in hard-coded) escape sequence "ESC k ESC \" everything between the
next '@' and the end of the line should be the terminal title.&lt;/p&gt;

&lt;p&gt;For "normal" use of this feature, one would embed the escape sequence and
pattern in one's shell prompt.  I do the same thing, only &lt;em&gt;tricky&lt;/em&gt;:&lt;/p&gt;

&lt;pre class="example"&gt;&lt;span class="comment-delimiter"&gt;# &lt;/span&gt;&lt;span class="comment"&gt;'screen' title escape
&lt;/span&gt;&lt;span class="variable-name"&gt;PS1&lt;/span&gt;=&lt;span class="string"&gt;"\033k\033\134@\h\n\033[1A"&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;I build my &lt;code&gt;$PS1&lt;/code&gt; incrementally in a &lt;code&gt;prompt_command&lt;/code&gt; shell function, so that's
only the first part, but it's where the magic happens.  Each time the shell
displays its prompt, it will print the "ESC k ESC \" escape sequence, then the
'@' &lt;code&gt;screen&lt;/code&gt; is searching for, the hostname (which &lt;code&gt;screen&lt;/code&gt; will pick up as the new
title), a newline (ending the title), then finally the terminal control escape
sequence to go back up a line.&lt;/p&gt;

&lt;p&gt;End result &amp;mdash; 
&lt;code&gt;screen&lt;/code&gt; picks up the hostname as the title, but rest of the prompt
overwrites the hostname output in the visible terminal text.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.18.1"&gt;1&lt;/a&gt;   I could probably hack the way command history and tab completion work, but
scrolling behavior is so annoying I've just assumed it must be a hard
problem to fix.&lt;/p&gt;

&lt;p class="footnote"&gt;&lt;a class="footnum" name="fn.18.2"&gt;2&lt;/a&gt;   &lt;code&gt;screen&lt;/code&gt; expects the new terminal title to end with a newline character.&lt;/p&gt;
    </content>
  </entry>
</feed>
