Commit Graph

9 Commits

Author SHA1 Message Date
Félix Baylac Jacqué e6fe3864e2 Release: 0.5
Fix the short form cloning regression.
2023-01-20 12:05:12 +01:00
Félix Baylac Jacqué 47083f9a74 Bugfix 2: do not clone a repository already downloaded
Second stab at fixing this bug. Except I tool the time to do it in a
non-rushed clean way this time around.

We introduce a properly tested is-clone-url-in-code-root predicate. We
then plug this predicate at the clone call sites instead of wrapping
the interactive command.
2023-01-20 11:53:30 +01:00
Félix Baylac Jacqué fe7c50f5a1 Release: 0.4 2023-01-15 12:03:53 +01:00
Félix Baylac Jacqué 98e76c2d17
[bugfix] Reformat git command output newlines
The git stdout newline separator is customizable. Sadly for us, it
seems like it uses a carriage return (CR) separator by default. Emacs
won't treat CR as a newline, it needs a CR;LF.

We can configure git to use CR;LF, that being said, we don't want to
modify the user's git configuration here.

Adding a process filter to rewrite the newline separators on the go.
2022-11-27 13:42:37 +01:00
Félix Baylac Jacqué 4866b1d1ef Add ert-async dependency to test package 2022-11-16 18:38:31 +01:00
Félix Baylac Jacqué df1b7adc7e [bugfix] Support more clone full URLs
Supporting the git/ssh scheme for fully qualified URLs.

Quoting https://git-scm.com/docs/git-clone#_git_urls:

> The following syntaxes may be used with them:

>   ssh://[user@]host.xz[:port]/path/to/repo.git/
>   git://host.xz[:port]/path/to/repo.git/
>   http[s]://host.xz[:port]/path/to/repo.git/
>   ftp[s]://host.xz[:port]/path/to/repo.git/
>
> An alternative scp-like syntax may also be used with the ssh protocol:
>   [user@]host.xz:path/to/repo.git/
2022-11-15 18:26:15 +01:00
Félix Baylac-Jacqué a768efebba [bugfix] Do not create an empty dir when git clone fails
git clone is creating a destination empty directory before even
attempting to clone the remote URL. It means that if the user-supplied
remote URL happen to be invalid, an empty directory is getting created
at dest, preventing us to try cloning the same repository once again.

We fixed that issue by checking whether the remote git repository
exists using git ls-remote **before** calling git clone.

git ls-remote will fail on a git repository not containing any git
commit. We add a function to the test bed creating a git repo with one
commit. It's a bit hacky, but that's the best setup I could come with.
We embed a dummy git repo to the my-repo-pins codebase and copy it
during the test phase to a tmp workspace.
2022-11-11 10:55:35 +01:00
Félix Baylac-Jacqué 23419e5cc5
my-repo-pins--get-code-root-projects: add max-depth stop gap
We currently discriminate a regular directory from a project by
looking for a .git directory. This heuristics works reasonably well
but isn't perfect. It'll fail for non-git projects, git worktree, etc.

We were recursing through the code root until we reached a project. If
the project detection heuristics fails, we'll recurse way too deep.
This can create some serious performance issues.

We introduce a maximum recursion depth to prevent the tree walker from
recursing too deep. We set this maximum to 2 by default to reflect the
expected <forge>/<user>/<project> scheme.

We expose this maximum depth via a customization variable. If set to
nil, there won't be any limit.

Kudos to Marcin S. aka. m-cat for the help.

Bug report: https://github.com/NinjaTrappeur/my-repo-pins/issues/7
2022-07-17 16:11:15 +02:00
Félix Baylac-Jacqué c058603766
Rename the project
Hinted by the Melpa maintainers here:
https://github.com/melpa/melpa/pull/8093

Using a single letter name was a mistake. Renaming the project to
something a bit more sensible. Maybe not too sensible that being said:
we had to adopt a pun.

Kudos to Wiwi for the pun: it's perfect.
2022-06-27 18:19:25 +02:00