initial report about failure to commit

This commit is contained in:
yarikoptic 2018-08-08 20:07:27 +00:00 committed by admin
parent 12460fcea6
commit 2a7484bdc6

View file

@ -0,0 +1,70 @@
### Please describe the problem.
Leads to a failure of 'git commit' upon attempt to commit a file which went from "largefile" to small, according to .gitattributes settings, if we `git annex add file` before committing the change.
### What version of git-annex are you using? On what operating system?
6.20180720+gitg03978571f-1~ndall+1
### Please provide any additional information below.
Here is a full script to reproduce it:
[[!format sh """
#!/bin/bash
set -ex
builtin cd /tmp;
if [ -e /tmp/repo ]; then
chmod -R +w /tmp/repo;
rm -rf /tmp/repo;
fi
mkdir /tmp/repo;
cd /tmp/repo;
git init;
git annex init;
echo '* annex.largefiles=(largerthan=5b)' >.gitattributes;
git add .gitattributes;
git commit -m 'added .gitattri';
echo 123456 > file;
git annex add file;
git commit -m add1;
ls -l;
git annex unlock file;
echo 123 >| file
git annex add file
# this would work but commit to git-annex, not git despite .gitattributes settings
# git commit -m edit -a
# This one would fail to commit at all, complaining about "partial commit"
git commit -m edit file
ls -l file;
git status
"""]]
which leads to
[[!format sh """
...
+ git annex add file
add file (non-large file; adding content to git repository) ok
add file (non-large file; adding content to git repository) ok
(recording state in git...)
+ git commit -m edit file
git-annex: Cannot make a partial commit with unlocked annexed files. You should `git annex add` the files you want to commit, and then run git commit.
"""]]
additional observations:
- works fine if remains large file (e.g. we just append to it)
- does not fail if we do `git commit -a` not `git commit file`, but it commits it to annex not to git, despite previous `git annex add` message rightfully says that "non-large file; adding content to git repository"
Expected behavior:
- have consistent behavior between `commit -a` and `commit file`
- commit without a failure, committing to git (since .gitattributes instructs so and even `git annex add` reports that)
[[!meta author=yoh]]