Skip to content
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

fix: getRelativeRepoPath for the case of vault-inside-repo #722

Merged
merged 7 commits into from
Jun 22, 2024

Conversation

tomoyanonymous
Copy link
Contributor

@tomoyanonymous tomoyanonymous commented Apr 15, 2024

This fixes #660.

Currently, getRelativeRepoPath considers only the case of git repository is located inside the vault.
If the vault is inside a subdirectory of git repository (this is a common case when you are using a self-host publishing system like Quartz), line authoring feature won't work.

This code resolves the relative path between git repo and vault using path library.

src/gitManager/gitManager.ts Outdated Show resolved Hide resolved
src/gitManager/gitManager.ts Outdated Show resolved Hide resolved
@Vinzent03
Copy link
Owner

Hey, thanks for this pr and your contribution! This was a great start, but I changed it so that the basePath setting is not needed to point to the repo root, but can be a subdirectory. Additionally, I needed to align the getRelativeVaultPath method as well. Let me know if you think something is off now. Thanks again.

@tomoyanonymous
Copy link
Contributor Author

Hi. Thanks for the fixing. It works as I supposed.
There is still edge case, for example, my repository have vault directory(/content/), and the vault have submodule directory (/content/private). On the files inside submodule, it fails to show line author info.
This is not usual usecase, so I think it is ok to merge and open another issue.

@Vinzent03
Copy link
Owner

Okay great. But the submodule issue was there before this pr and persisted after your version of this pr as well, right?

@tomoyanonymous
Copy link
Contributor Author

Yes.

@Vinzent03 Vinzent03 merged commit 171693f into Vinzent03:master Jun 22, 2024
5 checks passed
@0atman
Copy link

0atman commented Jun 22, 2024

thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Line author fails when the vault is a subdir of the git repo
3 participants