Closed gjost closed 6 years ago
Maybe there's a problem with GitPython? repo.git.checkout('git-annex')
complains that "local changes would be overwritten by checkout" but repo.git.status()
doesn't show any local changes.
Note: GitPython is currently pegged to 0.3.2.RC1
.
>>> from DDR import dvcs
>>> repo = dvcs.repository(c.path, 'gjost', 'gjost@densho.org')
>>> repo.git.fetch('origin')
''
>>> repo.git.checkout('master')
"Your branch is up-to-date with 'origin/master'."
>>> repo.git.pull('origin', 'master')
'Already up-to-date.'
>>> repo.git.checkout('git-annex')
Traceback (most recent call last):
File "<input>", line 1, in <module>
repo.git.checkout('git-annex')
File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/git/cmd.py", line 227, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/git/cmd.py", line 456, in _call_process
return self.execute(call, **_kwargs)
File "/opt/ddr-local/venv/ddrlocal/local/lib/python2.7/site-packages/git/cmd.py", line 377, in execute
raise GitCommandError(command, status, stderr_value)
GitCommandError: 'git checkout git-annex' returned exit status 1: error: Your local changes to the following files would be overwritten by checkout:
changelog
collection.json
ead.xml
files/ddr-testing-141-1/changelog
files/ddr-testing-141-1/entity.json
files/ddr-testing-141-1/files/ddr-testing-141-1-master-c774ed4657.json
files/ddr-testing-141-1/mets.xml
Please, commit your changes or stash them before you can switch branches.
Aborting
>>> repo.git.status()
"On branch master\nYour branch is up-to-date with 'origin/master'.\nnothing to commit, working directory clean"
>>> repo.git.diff()
''
This is a resurfacing of an old issue from 2015. See email thread "mits sync issues" on 2015-03-30. See also issue "DDR sync not pushing commits to mits remote correctly" (https://github.com/densho/ddr-cmdln/issues/16)
Replaced the manual pull/commit sequence with git annex sync
.
Looks like it works with git annex version 6.20170101.1 on Debian 9: HEAD
, synced/master
, master
all point to the same commit on the Gitolite server after syncing.
Looks like it's working with git annex version 5.20141125+deb8u1 on Debian 8 too.
Note that we were running git-annex 3.20120629~bpo60+2 back in 2015.
Merged in to develop
.
syncing from back end (and front end) running fine
ddr-sync
fails with GitCommandError butgit annex sync
works. This is with Git version 2.1.4 and git-annex version: 5.20141125+deb8u1.