Skip to content
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

'error: unknown option `cached' #4

Open
TowerBR opened this issue Apr 2, 2024 · 0 comments
Open

'error: unknown option `cached' #4

TowerBR opened this issue Apr 2, 2024 · 0 comments

Comments

@TowerBR
Copy link

TowerBR commented Apr 2, 2024

Hi

I'm running synctogit in a Ubuntu 22.04.4 machine, with git version 2.34.1.

Whem I call synctogit manually from terminal prompt it runs smoothly, but whem I call it from a bash script triggered by cron, I get:

Traceback (most recent call last):
  File "/usr/local/bin/synctogit", line 11, in <module>
    load_entry_point('synctogit==2.0.1', 'console_scripts', 'synctogit')()
  File "/usr/local/lib/python2.7/dist-packages/synctogit/main.py", line 35, in main
    run(pargs)
  File "/usr/local/lib/python2.7/dist-packages/synctogit/main.py", line 49, in run
    while _sync(git, evernote, config, pargs):
  File "/usr/local/lib/python2.7/dist-packages/synctogit/main.py", line 78, in _sync
    with git.transaction() as t:
  File "/usr/local/lib/python2.7/dist-packages/synctogit/GitTransaction.py", line 186, in __enter__
    self._check_repo_state()
  File "/usr/local/lib/python2.7/dist-packages/synctogit/GitTransaction.py", line 157, in _check_repo_state
    self._stash()
  File "/usr/local/lib/python2.7/dist-packages/synctogit/GitTransaction.py", line 151, in _stash
    if self.git.is_dirty(untracked_files=True):
  File "/usr/local/lib/python2.7/dist-packages/git/repo/base.py", line 608, in is_dirty
    len(self.git.diff('--cached', *default_args)):
  File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 466, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 934, in _call_process
    return self.execute(make_call(), **_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 718, in execute
    raise GitCommandError(command, status, stderr_value)
git.exc.GitCommandError: 'git diff --cached --abbrev=40 --full-index --raw' returned with exit code 129
stderr: 'error: unknown option `cached'
usage: git diff --no-index [<options>] <path> <path>

Which seens related to

def _stash(self):
    if self.git.is_dirty(untracked_files=True):
        self.git.stash('push', '-m', self._get_commit_message())

in GitTransaction.py

Is my perception correct? Do I need to adjust any settings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant