File tree Expand file tree Collapse file tree 9 files changed +20
-6968
lines changed
Expand file tree Collapse file tree 9 files changed +20
-6968
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4444 "svelte-preprocess" : " ^6.0.3" ,
4545 "tslib" : " ^2.8.1" ,
4646 "typescript" : " 5.8.3" ,
47- "typescript-eslint" : " ^8.8.1 "
47+ "typescript-eslint" : " ^8.38.0 "
4848 },
4949 "dependencies" : {
5050 "@codemirror/commands" : " ^6.8.1" ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export const DEFAULT_SETTINGS: ObsidianGitSettings = {
2727 showStatusBar : true ,
2828 updateSubmodules : false ,
2929 syncMethod : "merge" ,
30- resolutionMethod : "none" ,
30+ mergeStrategy : "none" ,
3131 customMessageOnAutoBackup : false ,
3232 autoBackupAfterFileChange : false ,
3333 treeStructure : false ,
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import type {
55 DiffFile ,
66 FileStatusResult ,
77 LogEntry ,
8- ResolutionMethod ,
98 Status ,
109 TreeItem ,
1110 UnstagedFile ,
Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ export class IsomorphicGit extends GitManager {
478478 theirs : branchInfo . tracking ! ,
479479 abortOnConflict : false ,
480480 mergeDriver :
481- this . plugin . settings . resolutionMethod !== "none"
481+ this . plugin . settings . mergeStrategy !== "none"
482482 ? ( { contents } ) => {
483483 const baseContent = contents [ 0 ] ;
484484 const ourContent = contents [ 1 ] ;
@@ -500,7 +500,7 @@ export class IsomorphicGit extends GitManager {
500500 if ( item . conflict ) {
501501 mergedText +=
502502 this . plugin . settings
503- . resolutionMethod === "ours"
503+ . mergeStrategy === "ours"
504504 ? item . conflict . a . join ( "" )
505505 : item . conflict . b . join ( "" ) ;
506506 }
Original file line number Diff line number Diff line change @@ -602,9 +602,6 @@ export class SimpleGit extends GitManager {
602602 this . plugin . log (
603603 "No tracking branch found. Ignoring pull of main repo and updating submodules only."
604604 ) ;
605- this . plugin . displayMessage (
606- "No tracking branch found. Ignoring pull of main repo and updating submodules only."
607- ) ;
608605 return ;
609606 }
610607
@@ -621,9 +618,9 @@ export class SimpleGit extends GitManager {
621618 try {
622619 const args = [ branchInfo . tracking ! ] ;
623620
624- if ( this . plugin . settings . resolutionMethod !== "none" ) {
621+ if ( this . plugin . settings . mergeStrategy !== "none" ) {
625622 args . push (
626- `--strategy-option=${ this . plugin . settings . resolutionMethod } `
623+ `--strategy-option=${ this . plugin . settings . mergeStrategy } `
627624 ) ;
628625 }
629626
@@ -654,7 +651,6 @@ export class SimpleGit extends GitManager {
654651 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
655652 `Sync failed (${ this . plugin . settings . syncMethod } ): ${ "message" in err ? err . message : err } `
656653 ) ;
657- err = true ;
658654 }
659655 }
660656 this . app . workspace . trigger ( "obsidian-git:head-change" ) ;
Original file line number Diff line number Diff line change @@ -1074,6 +1074,11 @@ export default class ObsidianGit extends Plugin {
10741074 }
10751075 }
10761076
1077+ /** Used for internals
1078+ * Returns whether the pull added a commit or not.
1079+ *
1080+ * See {@link pullChangesFromRemote} for the command version.
1081+ */
10771082 async pull ( ) : Promise < false | number > {
10781083 if ( ! ( await this . remotesAreSet ( ) ) ) {
10791084 return false ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import type {
2525import type ObsidianGit from "src/main" ;
2626import type {
2727 ObsidianGitSettings ,
28- ResolutionMethod ,
28+ MergeStrategy ,
2929 ShowAuthorInHistoryView ,
3030 SyncMethod ,
3131} from "src/types" ;
@@ -400,21 +400,21 @@ export class ObsidianGitSettingsTab extends PluginSettingTab {
400400 } ) ;
401401
402402 new Setting ( containerEl )
403- . setName ( "Conflict resolution strategy" )
403+ . setName ( "Merge strategy on conflicts " )
404404 . setDesc (
405- "Decide how to solve conflicts when pulling remote changes"
405+ "Decide how to solve conflicts when pulling remote changes. This can be used to favor your local changes or the remote changes automatically. "
406406 )
407407 . addDropdown ( ( dropdown ) => {
408- const options : Record < ResolutionMethod , string > = {
408+ const options : Record < MergeStrategy , string > = {
409409 none : "None (git default)" ,
410410 ours : "Our changes" ,
411411 theirs : "Their changes" ,
412412 } ;
413413 dropdown . addOptions ( options ) ;
414- dropdown . setValue ( plugin . settings . resolutionMethod ) ;
414+ dropdown . setValue ( plugin . settings . mergeStrategy ) ;
415415
416- dropdown . onChange ( async ( option : ResolutionMethod ) => {
417- plugin . settings . resolutionMethod = option ;
416+ dropdown . onChange ( async ( option : MergeStrategy ) => {
417+ plugin . settings . mergeStrategy = option ;
418418 await plugin . saveSettings ( ) ;
419419 } ) ;
420420 } ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface ObsidianGitSettings {
1414 autoPullOnBoot : boolean ;
1515 autoCommitOnlyStaged : boolean ;
1616 syncMethod : SyncMethod ;
17- resolutionMethod : ResolutionMethod ;
17+ mergeStrategy : MergeStrategy ;
1818 /**
1919 * Whether to push on commit-and-sync
2020 */
@@ -81,7 +81,7 @@ export function mergeSettingsByPriority(
8181
8282export type SyncMethod = "rebase" | "merge" | "reset" ;
8383
84- export type ResolutionMethod = "none" | "ours" | "theirs" ;
84+ export type MergeStrategy = "none" | "ours" | "theirs" ;
8585
8686export type ShowAuthorInHistoryView = "full" | "initials" | "hide" ;
8787
You can’t perform that action at this time.
0 commit comments