obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: Large Number of File Changes Cause Obsidian Git to Fail to Commit

Open acook opened this issue 2 years ago • 1 comments

Describe the bug

Throws E2BIG error, which is caused by too many or too long of an argument list passed to a commandline program.

Screenshot from 2023-09-01 20-42-36

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

  1. Have "List filenames affected by commit in the commit body" enabled
  2. Move around a large number of files
  3. 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

acook avatar Sep 02 '23 01:09 acook

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

bardbess avatar Sep 23 '23 01:09 bardbess

Should be fixed with v2.24.3

Vinzent03 avatar Jul 11 '24 22:07 Vinzent03