We introduce the h--init-forges-state function in charge of
initializing the forge state and setting all the forges status to
loading. It prevents the forge names to gradually pop-up during a
forge request and instead display them with their appropriate status.
The synchronous git process call was freezing the whole UI for a
*pretty long* time when checking out a big git repository.
We move into using a asynchronous process. This change required quite
a lot of sync-related changes. Both in the h.el codebase as well as in
the test suite.
On top of making the git call asynchronous, we also take advantage of
not freezing the UI anymore to open a window displaying the git clone
progress.
h--pick-relevant-forges is an artifact of a former architecture.
On top of being some useless code, it was brittle and was preventing
us from cloning a repository from savannah.
We use the Gitea API to determine whether or not a given repo exists.
If it does, we use the API response to properly determine the SSH and
HTTPS clone URLs.
We introduce an instance-agnostic Gitlab fetcher.
As noted in the function docstring, there's no way to retrieve the
clone URLs from an API at the moment. We fall back to a somehow dirty
hack to get the job done.
We introduce a new autocomplete function to help us determine whether
the user-query was already in the collection of the completing read
call or whether this is a user-specified value.
We then take advantage of this function to make a single entry point
for the whole plugin: h-jump-to-project. This function now not only
allow a user to jump to a local project but also clones a missing
project from the available forge sources.
For now, we're only using the ssh checkout link. We're finally able to
check out a remote repository.
🎉 We're feature complete!!!!!! 🎉
Time to shave some Yaks now and make the thing pretty and robust.
We're concurrently querying several forges and accumulate these
queries results in a single state. We need to protect that state from
concurrent writes. Introducing a mutex in charge of protecting these
concurrent writes.
We refactor h--draw-ui-buffer by extracting the key binding generator
to its own function. Having it in its own pure function, we're now
able to write some tests for it.
This function used to only return the kind of the query string. This
is not sufficient to properly query the forges. On top of returning
the type of a query string, we want this function to actually parse
the query into a tagged union materialized as a astring.
We update the tests accordingly to this refactoring.
This function is in charge of drawing the remote forge fetching UI. It
does display the status for each forge w/ colors and binds the
necessary key bindings in the said buffer.
We set the key binding from 1-9 then from a-z.
We implement a custom replacement for `directory-files-recursively`
for x reasons:
1. `directory-files-recursively` has been introduced in Emacs 25.1.
Meaning, as it was, h.el couldn't run on a older Emacs.
2. Specializing the code allows us to simplify quite a lot
`directory-files-recursively`. Removing some unnecessary I/O
operations. That's a win performance-wise.
3. We add the git repository detection routine directly into the dir
walker. It reduces the walker complexity from O(2n) to O(n).
Open a fuzzy-autocomplete mini-buffer to retrieve a project contained
in code-root. Once selected, open the said project folder.
First project milestone reached \0/
string-remove-prefix is automatically available when evaluating the
source code, it's not the case when we compile it. Let's require its
library (subr-x) when compiling the list code.