obsidian-git
obsidian-git copied to clipboard
[Bug]: Large Number of File Changes Cause Obsidian Git to Fail to Commit
Describe the bug
Throws E2BIG error, which is caused by too many or too long of an argument list passed to a commandline program.
Detecting that the commit message is too long and automatically truncating it would be a nice fix.
Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)
git obsidian error: Error: spawn E2BIG
plugin:obsidian-git:26622 Uncaught (in promise) Error: Error: spawn E2BIG
at GitExecutorChain.onFatalException (plugin:obsidian-git:26622:79)
at GitExecutorChain.eval (plugin:obsidian-git:26614:24)
at Generator.throw (<anonymous>)
at rejected (plugin:obsidian-git:25483:29)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
Steps to reproduce
- Have "List filenames affected by commit in the commit body" enabled
- Move around a large number of files
- Wait (or force commit)
Expected Behavior
Commit succeeds
Addition context
This appears to be the same bug: https://github.com/denolehov/obsidian-git/issues/450
It seems a contributing factor is refreshing the cache with text-extractor, so I should add that to the ignore list.
Operating system
Linux
Installation Method
AppImage
Plugin version
2.22.0
Probably need a setting to limit the number of files that will be added per commit so that it creates several commits when the number is exceeded. eg: git commit -m "Message goes here" file1 file2
Should be fixed with v2.24.3