1 ! Copyright (C) 2015 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors fry git io io.directories io.encodings.utf8
4 io.launcher io.streams.string kernel sequences tools.test ;
7 : run-process-stdout ( process -- string )
8 >process utf8 [ read-contents ] with-process-reader ;
10 : with-empty-test-git-repo ( quot -- )
12 { "git" "init" } run-process drop
14 ] with-test-directory ; inline
16 : with-zero-byte-file-repo ( quot -- )
18 "empty-file" touch-file
19 { "git" "add" "empty-file" } run-process drop
20 { "git" "commit" "-m" "initial commit of empty file" } run-process drop
22 ] with-empty-test-git-repo ; inline
25 [ git-head-ref ] with-empty-test-git-repo
26 { "refs/heads/master" "refs/heads/main" } member?
32 ! "." t recursive-directory-files
33 git-log [ commit. ] each
34 ] with-zero-byte-file-repo
39 { "git" "log" } run-process-stdout print
40 ] with-zero-byte-file-repo
46 { tree "517e33595c3238dbffb4ce494390eb0a36de9604" }
47 { parents "1b744404f3a19be816dc36334d070488e1f2b20e" }
49 "Doug Coleman <doug.coleman@gmail.com> 1612484963 -0600"
52 "Doug Coleman <doug.coleman@gmail.com> 1612485414 -0600"
55 "git: Fix parsing of gpgsig and clean up code.\n\nThey don't tell you that gpgsigs exist, take up many lines, and that you\nneed to keep reading while lines begin with a space."
59 "tree 517e33595c3238dbffb4ce494390eb0a36de9604
60 parent 1b744404f3a19be816dc36334d070488e1f2b20e
61 author Doug Coleman <doug.coleman@gmail.com> 1612484963 -0600
62 committer Doug Coleman <doug.coleman@gmail.com> 1612485414 -0600
64 git: Fix parsing of gpgsig and clean up code.
66 They don't tell you that gpgsigs exist, take up many lines, and that you
67 need to keep reading while lines begin with a space."
68 commit parse-new-git-object
73 { tree "6622ae8805e7278666a932015e93f143cbb4caf8" }
74 { parents "71ad025aaf2b888119d4ac080cf5ac4c8c3a0b52" }
76 "Doug Coleman <doug.coleman@gmail.com> 1573952316 -0600"
78 { committer "GitHub <noreply@github.com> 1573952316 -0600" }
80 "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJd0Js8CRBK7hj4Ov3rIwAAdHIIAK+7IlWjQF9NBXEMYiciO8DO\nAWgAaGu3ZOh+mXQtvBWqU7OInrcVUQwmo/W1eN/h7ZZS2+dGgAAO4/RxflZ0PaOo\nZnvPAVshNYL03KZSaruXtTs6z1ypoimy1Z89087OGwgTTY2AFDBoUeCEwmm7sTJ6\njWPhq6VlMszisdgqQrk5IiErDHtnm3mteiERTrIKTAeeT/bZuU0BF7eYVvgVLyLu\n/NFSmuEp9619c70KSM4NBG3KjepTW5T6wV/CwaMeoE2gNlj7ehgxZ0zkQg2m4Tpp\nVFiT4niYSekChldDoMJs9A5LZGwoU1QjzCknbfia24747q6qYW5EBK7Df5OhH08=\n=f5p9\n-----END PGP SIGNATURE-----\n"
83 "Add description of '-help' switch to documentation. (#2221)"
87 "tree 6622ae8805e7278666a932015e93f143cbb4caf8
88 parent 71ad025aaf2b888119d4ac080cf5ac4c8c3a0b52
89 author Doug Coleman <doug.coleman@gmail.com> 1573952316 -0600
90 committer GitHub <noreply@github.com> 1573952316 -0600
91 gpgsig -----BEGIN PGP SIGNATURE-----
93 wsBcBAABCAAQBQJd0Js8CRBK7hj4Ov3rIwAAdHIIAK+7IlWjQF9NBXEMYiciO8DO
94 AWgAaGu3ZOh+mXQtvBWqU7OInrcVUQwmo/W1eN/h7ZZS2+dGgAAO4/RxflZ0PaOo
95 ZnvPAVshNYL03KZSaruXtTs6z1ypoimy1Z89087OGwgTTY2AFDBoUeCEwmm7sTJ6
96 jWPhq6VlMszisdgqQrk5IiErDHtnm3mteiERTrIKTAeeT/bZuU0BF7eYVvgVLyLu
97 /NFSmuEp9619c70KSM4NBG3KjepTW5T6wV/CwaMeoE2gNlj7ehgxZ0zkQg2m4Tpp
98 VFiT4niYSekChldDoMJs9A5LZGwoU1QjzCknbfia24747q6qYW5EBK7Df5OhH08=
100 -----END PGP SIGNATURE-----
103 Add description of '-help' switch to documentation. (#2221)"
104 commit parse-new-git-object