[darcs-users] hunk pattern recipe

Stephen J. Turnbull stephen at xemacs.org
Sat Dec 3 14:52:02 UTC 2011


Maris, Rob writes:

 > Well, a hunk is actually an identified unit with an index (when I'm  
 > right). According to the famous camp webcast, this can be used to extract  
 > the "history" of a single text chunk within a file, without being  
 > cluttered by information of other chunks that is particularly not of  
 > interest in a given situation.

Somewhat like the git pickaxe?

 > hunk-by-hunk record. When versioning source code, just as another example,  
 > a function or data struct could be defined as a hunk entity: regardless  
 > how many hunks are identified within the scope of a function (in "current"  
 > darcs), a recipe could join those hunks to form a hunk per function or  
 > struct.

This would make sense in git (I've actually toyed with the idea of
adding a file object to git, so that blobs would be members of files;
the main idea was to make each defun a blob).  In Darcs, though,
AFAICS it would get in the way of the main idea, that "primitive
patches" can often commute, because the bigger the hunk the more
likely it will not commute with another primitive patch.

So I think you may have something here, but it's going to be very
delicate to implement.  On the one side, it seems likely to impair
patch theoretic manipulations in source code files, and on the other
AFAIK Darcs is no smarter than any other major VCS wrt to files that
are not line-structured: it basically just stores the whole thing as a
blob and doesn't try to diff it.


More information about the darcs-users mailing list