Add the option to modify the repo root relative path#73
Closed
orgrinrt wants to merge 1 commit intohaydenull:mainfrom
Closed
Add the option to modify the repo root relative path#73orgrinrt wants to merge 1 commit intohaydenull:mainfrom
orgrinrt wants to merge 1 commit intohaydenull:mainfrom
Conversation
orgrinrt
commented
Feb 5, 2025
| _inProgress = logseq.Git.execCommand(runArgs) | ||
| res = await _inProgress | ||
| const currentGitFolder = (await logseq.App.getCurrentGraph())?.path; | ||
| const relCurrGitFolder = currentGitFolder |
Author
There was a problem hiding this comment.
This new constant (and using it instead of currentGitFolder on the git exec args) is essentially the only change other than the settings addition in src/helper/constants.ts
I apologise for the linter, didn't think to check the diffs on the fly before sending this PR.
Again, I'd be happy to clean it up if this seems worth a merge.
Author
|
I see this feature has also been requested before. See, for example this comment in #67. If there are problems with this specific way of achieving it, I'd be happy to get some feedback and implement it in a suitable way, as it seems it would help others too. |
Author
|
Closing this in favour of #74 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the option to set a relative path from the graph's path to consider the git repo root.
For use cases like mine, where I have several graphs under one central repo, that also contains the logseq configuration and some scripts to initialise a new device to use it with the same plugins, settings and such shared between the graphs.
So basically it currently just appends the input of the new setting to the
currentGitFolderconstant defined in the git helper function execGitCommand scope.Seems to work for me, but this might have problems on other platforms. I'm on latest macos, so at least that works.
Initially I though I'd use the common utility libs (in this case,
path) I thought I remembered, from some earlier web work years ago, were easily available to node context, but I couldn't quickly figure out what extra steps that requires here. I'm not so familiar with the current web frameworks, so I couldn't be bothered to mess with it, and this happens to work for my devices as-is.I thought I'd send the PR either way, just in case logseq handles the path normalisation under the hood, since I'm not aware how the
execGitorlogseq.Gitthings work internally. Shouldn't take much to just adapt this quick addition, but maybe it's not worth the hassle if it takes more. So please do ignore this in that case, and close the PR.Unfortunately I had some internal linter running through the code I now see from the diffs. If this seems worth a merge, I can clean up those changes, just ping me.