-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Proposed solution to #746 : Allow disabling the git-commit-routine via hotkey-toggle #834
base: master
Are you sure you want to change the base?
Proposed solution to #746 : Allow disabling the git-commit-routine via hotkey-toggle #834
Conversation
…-pipeline if plugin is soft-disabled
662cf27
to
bd3b968
Compare
I have since resolved the merge conflicts, but I am not entirely sure if they should be resolved this way. I'd leave this up to maintainers, and can revert these changes for manual review. |
src/constants.ts
Outdated
@@ -30,6 +30,7 @@ export const DEFAULT_SETTINGS: Omit<ObsidianGitSettings, "autoCommitMessage"> = | |||
refreshSourceControl: Platform.isDesktopApp, | |||
basePath: "", | |||
differentIntervalCommitAndPush: false, | |||
globalEnable: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this to temporaryDisableAutomatics
So the toggle gets a new meaning as well. I think it's better to add a toggle to just disable all automatics all together. So push and pull as well.
src/main.ts
Outdated
@@ -1216,11 +1218,7 @@ export default class ObsidianGit extends Plugin { | |||
I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text. | |||
|
|||
\`\`\`diff | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be deleted, it may look like a merge conflict, but is meant to be this way.
src/setting/settings.ts
Outdated
@@ -64,6 +64,22 @@ export class ObsidianGitSettingsTab extends PluginSettingTab { | |||
|
|||
let setting: Setting; | |||
if (gitReady) { | |||
new Setting(containerEl).setName("Activation").setHeading(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a setting is needed for this. (I want to keep the amount of settings rather low) I guess a command is enough.
src/main.ts
Outdated
@@ -785,6 +785,8 @@ export default class ObsidianGit extends Plugin { | |||
amend?: boolean; | |||
}): Promise<boolean> { | |||
if (!(await this.isAllInitialized())) return false; | |||
if (!(this.settings.globalEnable)) return false; // if globalEnable-checkbox is disabled, return without committing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should still be able to manually commit via Obsidian. Only the automatic commits should be disabled, don't they? So I would not add that check here, but reset the automatics and don't start them.
7c21cdd1bb81de651b783e2fdc0923b9cf84bdfe
…tomatics itself. (ID is up for debate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I am not sure if this callback must be asynchronous or not, this is not my specialty.
Hello,
this is a proposed solution to the issue outlined in #746, allowing the user to temporarily suppress the plugin committing files via a hotkey-toggleable config-setting.
I remain that I have not found any issues arising from these changes on my end. I've tried to implement the solution comparable to existing code.
I am open for suggestions/review.
Thank you.
Sincerely,
~Gw