/
TODO
120 lines (89 loc) · 3.21 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Inconsistencies between git and darcs.
Summary:
- git allows you to create a file named '*';
darcs doesn't (though it doesn't throw an
error when you try). Similarly with '?'.
- when you try to delete '*', git deletes
everything, treating '*' as wildcard.
darcs gives a nonexistent file message.
- when you delete a file and then try to
create a file with the same name, git gives
you an error "Resource Exists". But git doesn't
allow you to modify the resource either.
darcs behaves better.
See transcript below:
Prelude> :m + Data.FileStore
Prelude Data.FileStore> let d = darcsFileStore "d"
Prelude Data.FileStore> let a = Author "j" ""
Prelude Data.FileStore> create d "aaa" a "n" "hi"
Prelude Data.FileStore> index d
["aaa"]
Prelude Data.FileStore> create d "*" a "n" "hi"
Prelude Data.FileStore> index d
["aaa"]
Prelude Data.FileStore> delete d "*" a "n"
*** Exception: UnknownError: Could not darcs record *
darcs failed: None of the files you specified exist!
Prelude Data.FileStore> index d
["aaa"]
Prelude Data.FileStore> delete d "aaa" a "n"
Prelude Data.FileStore> index d
[]
Prelude Data.FileStore> create d "aaa" a "n" "hi"
Prelude Data.FileStore> index d
["aaa"]
Prelude Data.FileStore> let g = gitFileStore "g"
Prelude Data.FileStore> initialize g
Prelude Data.FileStore> index g
[]
Prelude Data.FileStore> create g "*" a "hi" "contents"
Prelude Data.FileStore> index g
["*"]
Prelude Data.FileStore> create g "aa" a "hi" "contents"
Prelude Data.FileStore> index g
["*","aa"]
Prelude Data.FileStore> delete g "*" a "hi"
Prelude Data.FileStore> index g
[]
Prelude Data.FileStore> create g "aa" a "hi" "contents"
*** Exception: ResourceExists
Prelude Data.FileStore> latest g "aa"
"ba42127ed54a804570fc0fd3b979d2bc1ebf1fd7"
Prelude Data.FileStore> modify g "aa" "ba412" a "hi" "contents"
*** Exception: NotFound
-------------------------------------
Note: git will detect renames in "log" and "whatchanged"
if you supply the "-M" flag:
jgm@protagoras:~/tmp/ebo/aaa [26]% git whatchanged
commit 06676810341c00b306b1afc6d1ab7daaf86daa96
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Jan 16 18:54:34 2009 -0800
added new a
:000000 100644 0000000... e69de29... A a
commit c46967e899d01edb552d37689c6b0e9861d6e458
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Jan 16 18:54:16 2009 -0800
moved a to b
:100644 000000 e69de29... 0000000... D a
:000000 100644 0000000... e69de29... A b
commit 4b86a6b28537593d362c18357f8cc0ac3a493ecf
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Jan 16 18:54:08 2009 -0800
added a
:000000 100644 0000000... e69de29... A a
jgm@protagoras:~/tmp/ebo/aaa [27]% git whatchanged -M
commit 06676810341c00b306b1afc6d1ab7daaf86daa96
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Jan 16 18:54:34 2009 -0800
added new a
:000000 100644 0000000... e69de29... A a
commit c46967e899d01edb552d37689c6b0e9861d6e458
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Jan 16 18:54:16 2009 -0800
moved a to b
:100644 100644 e69de29... e69de29... R100 a b
commit 4b86a6b28537593d362c18357f8cc0ac3a493ecf
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Jan 16 18:54:08 2009 -0800
added a
:000000 100644 0000000... e69de29... A a