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

feat: custom git repository root #209

Merged
merged 6 commits into from
Mar 29, 2022
Merged

Conversation

mbseid
Copy link
Contributor

@mbseid mbseid commented Mar 20, 2022

Context

For my use case, I wanted to have a public blog live within my obsidian vault. This blog is hosted and built on github pages and is a normal git repository. To keep things separated, the git repository be in a subfolder not at the root of the vault. This is unsupported currently and referenced in a few issues:

Solution

A setting was added called bath path that allows users to set a custom git root. This is then used by simple-git when configuring the SimpleGit RepoManger.

Screen Shot 2022-03-20 at 11 14 04 AM

Limitations

A user is only allowed on repo in the entire vault. I evaluated having multiple git repo support but it turned out to be a larger refactor than I had time for. For my use case this is totally fine.

Thanks for the great plugin!

* origin/basePath:
  chore(release): 1.24.0
  feat: add show, diff, log as api
  chore(release): 1.23.0
  feat: reworked diff view handling
  fix: refresh source control view on exception
Copy link
Collaborator

@Vinzent03 Vinzent03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. I left you some comments.

src/simpleGit.ts Outdated Show resolved Hide resolved
src/settings.ts Show resolved Hide resolved
src/settings.ts Show resolved Hide resolved
src/simpleGit.ts Show resolved Hide resolved
@mbseid
Copy link
Contributor Author

mbseid commented Mar 25, 2022

Great feedback. I updated the setting to add more clarity and to use relative paths. I did use an absolute path during development. I agree that it makes more sense for it to be a relative path.

@Vinzent03
Copy link
Collaborator

When testing locally, I noticed that you forgot to add basePath to the settings interface. Did you just forget to commit those changes, or did you ignore the analyzer? Nevertheless, I fixed that.

@Vinzent03 Vinzent03 changed the title Add setting for git root feat: custom git repository root Mar 25, 2022
@mbseid
Copy link
Contributor Author

mbseid commented Mar 28, 2022

Awesome, thanks for your help. I didn't see anything in the analyzer, I may have missed it though. Also nice catch on the separator. Haven't written anything cross platform before and didn't think about the separator. Let me know if you need anything else to merge, I'm not able to because I don't have write access.

@Vinzent03 Vinzent03 merged commit 4157e42 into denolehov:master Mar 29, 2022
@Vinzent03 Vinzent03 mentioned this pull request Apr 10, 2022
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.

None yet

2 participants