summaryrefslogtreecommitdiff
path: root/tissue/git.scm
AgeCommit message (Collapse)Author
2023-01-29git: Deprecate call-with-file-in-git.Arun Isaac
Functions called by call-with-file-in-git may expect to read files directly off the filesystem. These functions are not all within the user's control and cannot be rewritten to do otherwise. It is more robust to provide a filesystem checkout of the git repository like these functions expect. In this commit, we deprecate call-with-file-in-git and replace calls to it with call-with-input-file. These invocations have been arranged such that they all happen at the top level of a repository checkout. * tissue/git.scm (call-with-file-in-git): Delete function. * .dir-locals.el (scheme-mode): Unregister it. * bin/tissue (tissue-show, load-config), tissue/file-document.scm (file-text, read-gemtext-document), tissue/issue.scm (read-gemtext-issue): Replace call-with-file-in-git with call-with-input-file. (pull, tissue-web): Call load-config from the top level of a repository checkout.
2023-01-29web: Do not temporarily checkout repository when serving it.Arun Isaac
Now that snippet source texts are interred into the xapian index, the web server does not need a repository checkout. * bin/tissue (tissue-web): Do not temporarily checkout repositories being served. * tissue/web/server.scm (handler): Do not change into repository directory. * tissue/git.scm (call-with-temporary-checkouts): Delete function. * .dir-locals.el (scheme-mode): Unregister it.
2023-01-29git: Create temporary checkout in temporary directory.Arun Isaac
* tissue/git.scm (call-with-temporary-checkout): Create temporary checkout in temporary directory, not in current directory.
2023-01-28git: Abstract temporary checkout.Arun Isaac
* tissue/git.scm (call-with-temporary-checkout, call-with-temporary-checkouts): New public functions. * .dir-locals.el (scheme-mode): Set scheme-indent-function of call-with-temporary-checkout and call-with-temporary-checkouts to 1.
2023-01-26git: Infer changes by root commit correctly.Arun Isaac
* tissue/git.scm (commit-deltas): Rename to ... (commit-file-changes): ... this. Return list of pairs mapping old files to new files. (file-modification-table): Use commit-file-changes instead of commit-deltas. Adapt to new return value. * tests/git.scm: New file. * .dir-locals.el (scheme-mode): Set scheme-indent-function for with-variable and with-variables.
2022-12-25git: Find git top level correctly even in bare repositories.Arun Isaac
* tissue/git.scm (git-top-level): Find git top level correctly even in bare repositories.
2022-10-07tissue: Markup docstrings in texinfo syntax.Arun Isaac
* tissue/document.scm (slot-set): Markup docstring in texinfo syntax. * tissue/file-document.scm (read-gemtext-document): Markup docstring in texinfo syntax. * tissue/git.scm (git-tracked-files): Markup docstring in texinfo syntax. * tissue/issue.scm (read-gemtext-issue): Markup docstring in texinfo syntax. * tissue/tissue.scm (gemtext-files-in-directory): Markup docstring in texinfo syntax. * tissue/web/static.scm (exporter, copier, gemtext-exporter, skribe-exporter): Markup docstrings in texinfo syntax.
2022-07-23git: Prefer reading checked out files.Arun Isaac
This generalization of call-with-file-in-git permits preferential reading of uncommitted changes, and reading of files external to the git repository. * tissue/git.scm (call-with-file-in-git): Prefer reading checked out files.
2022-07-20git: Add git-tracked-file? utility.Arun Isaac
* tissue/git.scm: Import (rnrs exceptions). (git-tracked-file?): New public function.
2022-07-09git: Use commit author date, not committer date.Arun Isaac
* tissue/git.scm (commit-author-date): New public function. (commit-date): Delete function. * tissue/issue.scm (read-gemtext-issue): Use commit-author-date instead of commit-date.
2022-07-05git: Add condition-git-error utility.Arun Isaac
* tissue/git.scm: Import (rnrs conditions) and (srfi srfi-1). (condition-git-error): New public function. * bin/tissue (default-configuration): Use condition-git-error.
2022-07-04git: Bind git_reference_set_target from libgit2.Arun Isaac
* tissue/git.scm: Import dereference-pointer and string->pointer from (system foreign). (reference-set-target!): New public function.
2022-07-04git: Bind git_reference_symbolic_target from libgit2.Arun Isaac
* tissue/git.scm: Import pointer->string from (system foreign). (reference-symbolic-target): New public function.
2022-07-04git: Add %current-git-repository parameter.Arun Isaac
* tissue/git.scm (%current-git-repository): New public parameter. (current-git-repository): Use %current-git-repository.
2022-07-04git: Implement git-top-level in terms of current-git-repository.Arun Isaac
* tissue/git.scm (git-top-level): Implement git-top-level in terms of current-git-repository.
2022-07-04git: Implement current-git-repository using repository-open-ext.Arun Isaac
repository-open-ext obsoletes git-top-level. * tissue/git.scm (current-git-repository): Implement using repository-open-ext instead of git-top-level.
2022-07-04git: Add clone-options utility.Arun Isaac
* tissue/git.scm: Import (bytestructures guile). (clone-options): New function.
2022-07-03git: Fill git-top-level docstring.Arun Isaac
* tissue/git.scm (git-top-level): Fill docstring.
2022-07-03git: Add call-with-file-in-git utility.Arun Isaac
* tissue/git.scm (call-with-file-in-git): New public function.
2022-07-03git: Find git tracked files from HEAD, not from index.Arun Isaac
The index is the staging area. We really only want to look at files already committed into the git repository. In addition, a pleasant side-effect is that this gets rid of many of the additional bindings from libgit2. * tissue/git.scm: Import only %null-pointer from (system foreign). Do not import (bytestructures guile). (pointer->bytestructure, bytestructure->pointer, pointer->index-time, pointer->index-entry, repository-index, index-version, index-entry-count, index-entry, index-entries): Delete functions. (%oid, %index-time, %index-entry): Delete variables. (<index-time>, <index-entry>): Delete types. (head-tree): New function. (git-tracked-files): Find git tracked files from HEAD, not from index.
2022-06-27git: Optionally accept repository argument in git-tracked-files.Arun Isaac
While making the repository argument mandatory makes git-tracked-files more of a pure function, users would still prefer to implicitly refer to the current repository in their tissue.scm configuration files. * tissue/git.scm (git-tracked-files): Make repository argument optional.
2022-06-23issue: Lookup commits affecting file using guile-git.Arun Isaac
* tissue/git.scm: Import (rnrs hashtables) and (ice-9 match). (commit-deltas): New function. (file-modification-table): New public function. * tissue/issue.scm: Import (git). (file-details): Do not lookup git history for file using `git log'. (issues): Use file-modification-table to lookup git history.
2022-06-23git: Add commit-date utility function.Arun Isaac
* tissue/git.scm: Import (srfi srfi-19). (commit-date): New public function.
2022-06-23git: Bind git_diff_find_similar from libgit2.Arun Isaac
* tissue/git.scm: Import %null-pointer from (system foreign). (diff-find-similar!): New function.
2022-06-23git: Pass repository argument to git-tracked-files.Arun Isaac
Accepting a repository argument makes git-tracked-files a better stand-alone utility. * tissue/git.scm (git-tracked-files): Accept repository argument. * tissue/tissue.scm (gemtext-files-in-directory): Pass repository argument to git-tracked-files.
2022-06-23git: Add current-git-repository utility function.Arun Isaac
* tissue/git.scm (current-git-repository): New public function.
2022-06-22git: Implement git-tracked-files using guile-git.Arun Isaac
* tissue/git.scm: Import (rnrs arithmetic bitwise), (srfi srfi-9), (git), (git types), and selected symbols from (system foreign) and (bytestructures guile). (pointer->bytestructure, bytestructure->pointer, pointer->index-time, pointer->index-entry, repository-index, index-version, index-entry-count, index-entry, index-entries): New functions. (%oid, %index-time, %index-entry): New variables (<index-time>, <index-entry>): New types. (git-tracked-files): Implement using guile-git.
2022-04-06git: Implement git-top-level independent of the git command.Arun Isaac
* tissue/git.scm (git-top-level): Implement independent of the git command.
2022-04-05git: Abstract out git-top-level.Arun Isaac
* tissue/git.scm (git-top-level): New function. * bin/tissue: Import (tissue git). (load-config): Use git-top-level.
2022-04-05git: Abstract out `git ls-files'.Arun Isaac
* tissue/git.scm: New file. * tissue/issue.scm: Import (tissue git). (issues): Use git-tracked-files.