Pagr Progress

So, it seems I've once again done the thing where I disappear from things like this for a bit[1]. That's okay though; I have (at least) been productive in that time! This is mostly an update post on one of my projects, which I have just made a decent about of progress in that I wanted to share..


(define* (list-delta-files repository)
  "Check for changed files with libgit2.

REPOSITORY <string>: The name of the directory the repository lives
                     in locally.

A <list> of <strings> representing the modified files in the repo.

Side Effects
Relies on repository state."
  (let* ((repo
           (string-append repository "/.git")))
           (status-list-new repo (make-status-options))))
          (map-in-order status-entry-index-to-workdir
    (map-in-order (lambda (x)
                    (diff-file-path (diff-delta-new-file x)))

The first (and most recent) thing I've been working on is a project of mine called pagr. Basically, it is a tool that interacts with a folder full of git repositories. It can currently check for 'dirty' repositories (with uncommitted changes), and push each repository to a remote with the same name. It's written entirely in GNU Guile, and I want it to eventually not rely on any other programs than itself (it started out as a bash script to 'Push All Git Repositories (PAGR)', hence the name.

The problem it was made to solve is one I have been impacted by for the last year: I work on multiple computers, and have most of my work stored in various git repositories. Over time, these naturally fall out of sync with each other, which is expected when collaborating with others—but annoying when it's only You, and You have to merge changes later that You realize were just repeated work that You forgot to push. This is one of the limitations of such a workflow, I guess.

With this program, I can see all locally changed files that I have yet to commit, work to commit or revert them, and then push everything to my personal server without having to worry about missing something. In the near future, I want to add support for fetching from a specified remote as well (and maybe also making bundle-based backups of some sort, I haven't decided yet.

One side effect of this project, though, is that I am learning to interface with libgit2 through the Guile Git library. I'd like to say that I just had to read the info pages, but instead I'll say that, as I learn, I hope to contribute to the rather sparse documentation that project currently has. I just want to make sure I understand it myself, first!

[1]I actually made a rule for myself after a while where I wouldn't make posts that reference this unfortunate habit of mine, simply because I would get discouraged and cease updating again until the next time I felt the urge to do so. I guess I'm breaking that rule on this site, haha.