diff --git a/doc/forum/Using_git-annex_as_a_library/comment_7_909628f1edd0d3448498fc434c61a3a4._comment b/doc/forum/Using_git-annex_as_a_library/comment_7_909628f1edd0d3448498fc434c61a3a4._comment new file mode 100644 index 0000000000..63d06ba09f --- /dev/null +++ b/doc/forum/Using_git-annex_as_a_library/comment_7_909628f1edd0d3448498fc434c61a3a4._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 7""" + date="2023-11-21T20:23:19Z" + content=""" +Hmm, `cabal build` does not build the library 2x in the case of propellor, +which has a similar split between the propellor library and the executables +that depend on it. Perhaps cabal has improved that since I posted my +comment. +"""]] diff --git a/doc/forum/Using_git-annex_as_a_library/comment_8_cef28b8639b6c6e84804b485fb5037f1._comment b/doc/forum/Using_git-annex_as_a_library/comment_8_cef28b8639b6c6e84804b485fb5037f1._comment new file mode 100644 index 0000000000..400e1913af --- /dev/null +++ b/doc/forum/Using_git-annex_as_a_library/comment_8_cef28b8639b6c6e84804b485fb5037f1._comment @@ -0,0 +1,37 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 8""" + date="2023-11-21T20:25:55Z" + content=""" +A lot of git-annex's end user functionality is in the `Command/*` modules. +Much of the code in those is not in a form that would be useful in a +library, unless the library was structured to run a `Command`. + +If the goal is say, to add a file to git-annex, and then to be able to +get and drop the file, and `Command.Add`, `Command.Get`, and `Command.Drop` +were not in the library, you'd have to put together the eqivilant of what +those commands do out of the internal library code: + +* `Command.Add` essentially uses `Annex.Ingest` followed by calling into + `Logs.Location` to update the location log. +* `Command.Drop` uses `Annex.NumCopies` to construct a drop proof and passes + it off to `Annex.Drop`. +* `Command.Get` handles trying different remotes itself, calling into + `Annex.Transfer`. + +So the library structure works for git-annex as a thing for Command modules +to use, but not great for other things. The assistant actually imports some +Command modules, eg it uses Command.Add.addFile. Similarly it would be +possible to call Command.Get.getKey. + +Maybe it would be better to have a library interface that does mirror the +git-annex command line, so you could run eg: + + runCommand (Command.Add.cmd) (AddOptions {...}) "somefile" + runCommand (Command.Drop.cmd) (DropOptions {...}) "somefile" + +That would necessarily have output like those commands too (unless quiet +mode were enabled). + +It would take some work to get there from the current state. +"""]] diff --git a/doc/forum/Using_git_annex_as_a_library/comment_2_1323238fc63e121fbc0f408a23d1ada5._comment b/doc/forum/Using_git_annex_as_a_library/comment_2_1323238fc63e121fbc0f408a23d1ada5._comment new file mode 100644 index 0000000000..882691e075 --- /dev/null +++ b/doc/forum/Using_git_annex_as_a_library/comment_2_1323238fc63e121fbc0f408a23d1ada5._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2023-11-21T20:17:10Z" + content=""" +Hmm, I followed up on that other page to avoid fragmenting the discussion. +"""]]