-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitLab subgroup results in "Unable to parse git host URL" error #90
Comments
Which version of |
Version 4.0.0. The full error is:
It looks like it might be connected with the fact that I use sub-group on GitLab? |
I'm not familiar with GitLab sub-groups, but judging by that URL, I'd guess so, yes. Note that |
Support of sub-groups is blocked on npm/hosted-git-info#54 which is used internally here. |
Addressing OP's use case seems to work with hosted-git-info 6.1.1: hostedGitInfo = requires("hosted-git-info")
hostedGitInfo.fromUrl("git@gitlab.com:tozd/go/errors.git") I was able to use hallmark to autogenerate a draft changelog at my workplace for a repo that has a remote url like "overrides": {
"hosted-git-info": "6.1.1"
}, It's a bit scattered, but it seems that gitlab subgroups were marked as supported upstream in hosted-git-info #56 and hosted-git-info #43 (though this commit is supposedly in version 3.0.8 with which I also had this issue) The use case in the hosted-git-info #54 issue linked as a blocker of this one has the overriding problem of self-hosted gitlab, which has been claimed in hosted-git-info #23 and #11to be out of scope for "hosted git info" as URL conventions for self-hosted version control systems (VCS) are not necessarily discernible from the domain. It seems like the dreaded Conventional Commits tool tried and failed to fall back to provided domains, but I like their moxie. If the possibility of generating broken VCS links could be nonfatal or skipped, enabling the autogeneration of draft changelogs for self-hosted enterprise VCS users could greatly broaden the scope of adoption of this standard. It'd still be a draft requiring human review, and the target audience likely has enough familiarity with regexes or find-and-replace to fix any broken links. I'm pretty new to node, so for my benefit as much as anyone else's, the commands specifically used to demonstrate success are within:
export PATH_TO_LOCAL_HALLMARK='/path/to/hallmark'
export PATH_TO_MY_REPO='/path/to/myrepo'
git clone https://github.com/vweevers/hallmark.git $PATH_TO_LOCAL_HALLMARK
cd $PATH_TO_LOCAL_HALLMARK
printf '{
"override": {
"hosted-git-info": "6.1.1"
},' > tmpfile
awk 'NR > 1 {print}' package.json >> tmpfile
mv tmpfile package.json
npm install --save-dev .
npm link
cd $PATH_TO_MY_REPO
chmod +x ~/homebrew/lib/node_modules/hallmark/compat/cli.cjs
hallmark cc init Observe new, nonempty file at |
I am using GitHub and get the same error: > hallmark lint CHANGELOG.md
Error: Unable to find git host
at parse (C:\Users\koppor\AppData\Roaming\npm\node_modules\hallmark\node_modules\find-githost\index.js:129:11)
at exports.fromGit (C:\Users\koppor\AppData\Roaming\npm\node_modules\hallmark\node_modules\find-githost\index.js:110:10)
at repo (file:///C:/Users/koppor/AppData/Roaming/npm/node_modules/hallmark/index.js:224:13)
at hallmark (file:///C:/Users/koppor/AppData/Roaming/npm/node_modules/hallmark/index.js:29:22)
at Module.lint (file:///C:/Users/koppor/AppData/Roaming/npm/node_modules/hallmark/index.js:153:10)
at file:///C:/Users/koppor/AppData/Roaming/npm/node_modules/hallmark/cli.js:33:14
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) The issue is when using $ cat .git
gitdir: C:/git-repositories/jabref-all/jabref/.git/worktrees/jabref |
@koppor That's a separate issue. A PR is welcome over at https://github.com/vweevers/find-gitdir (which does support git-style symlinks, for support of submodules, but it may need something more to also support worktrees). |
When running inside a git clone which is using SSH git location.
The text was updated successfully, but these errors were encountered: