summaryrefslogtreecommitdiff
path: root/doc/devblog/day_366__starting_adjusted_branches.mdwn
blob: 3f50d76bf9c8b78ccf8091659ad9abd50bdd1f32 (plain)
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
Getting started on [[design/adjusted_branches]], taking a top-down and
bottom-up approach. Yesterday I worked on improving the design. Today,
built a `git mktree` interface that supports recursive tree generation and
filtering, which is the low-level core of what's needed to implement the
adjusted branches.

To test that, wrote a fun program that generates a git tree with all
the filenames reversed.

[[!format haskell """
import Git.Tree
import Git.CurrentRepo
import Git.FilePath
import Git.Types
import System.FilePath

main = do
        r <- Git.CurrentRepo.get
        (Tree t, cleanup) <- getTree (Ref "HEAD") r
        print =<< recordTree r (Tree (map reverseTree t))
        cleanup

reverseTree :: TreeContent -> TreeContent
reverseTree (TreeBlob f m s) = TreeBlob (reverseFile f) m s
reverseTree (RecordedSubTree f s l) = NewSubTree (reverseFile f) (map reverseTree l)

reverseFile :: TopFilePath -> TopFilePath
reverseFile = asTopFilePath . joinPath . map reverse . splitPath . getTopFilePath
"""]]

Also, fixed problems with the Android, Windows, and OSX builds today.
Made a point release of the OSX dmg, because the last several releases
of it will SIGILL on some hardware.