[darcs-users] The minimal set of changes

Xan xancorreu at gmail.com
Mon Nov 24 10:07:58 UTC 2014


Hi,

I make a test in darcs: make two files "a.txt" and "b.txt" with content "a" and "b". darcs record. Then exchange the contents ("a.txt" has "b" and "b.txt" has "a"):

$ darcs what
addfile ./a.txt
hunk ./a.txt 1
+a
addfile ./b.txt
hunk ./b.txt 1
+b
[xan at rulot darcs-vs]$ darcs record
Each patch is attributed to its author, usually by email address (for
example, `Fred Bloggs <fred at example.net>').  Darcs could not determine
your email address, so you will be prompted for it.

Your address will be stored in _darcs/prefs/author.
It will be used for all patches recorded in this repository.
If you move that file to ~/.darcs/author, it will be used for patches
you record in ALL repositories.
What is your email address? somenxavier at gmail.com
addfile ./a.txt
Shall I record this change? (1/4)  [ynW...], or ? for more options: y
hunk ./a.txt 1
+a
Shall I record this change? (2/4)  [ynW...], or ? for more options: y
addfile ./b.txt
Shall I record this change? (3/4)  [ynW...], or ? for more options: y
hunk ./b.txt 1
+b
Shall I record this change? (4/4)  [ynW...], or ? for more options: y
What is the patch name? creació de a i b
Do you want to add a long comment? [yn]n
Finished recording patch 'creaci� de a i b'
$ darcs what
hunk ./a.txt 1
-a
+b
hunk ./b.txt 1
-b
+a
[xan at rulot darcs-vs]$ darcs record
hunk ./a.txt 1
-a
+b
Shall I record this change? (1/2)  [ynW...], or ? for more options: y
hunk ./b.txt 1
-b
+a
Shall I record this change? (2/2)  [ynW...], or ? for more options: y
What is the patch name? change a for b
Do you want to add a long comment? [yn]n
Finished recording patch 'change a for b'
[xan at rulot darcs-vs]$ 


So what darcs record these changes as content changes and not as "renaming files" changes. If the content is greater, then it's cheaper to have rename patch than diff patch of the contents.

Is there any reason for that?
What's is the minimal set of changes calculed between two sets of files? Is there any theory of that? I read the theory documents and I can't see that.

Thanks in advance,
Xan


More information about the darcs-users mailing list