Merge branch 'master' of ssh://git-annex.branchable.com

This commit is contained in:
Joey Hess 2018-08-30 15:53:09 -04:00
commit 2cdcb1ea25
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 128 additions and 0 deletions

View file

@ -0,0 +1,40 @@
### Please describe the problem.
In a V6 repo, if I unlock a file, modify it, and `git annex add` it,
it ends up in a locked state:
echo foo >foo && git annex add foo && git commit -mfoo
git annex unlock foo && echo more >>foo && git annex add foo
git cat-file -p :foo
# .git/annex/objects/60/QW/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d
However, if I do the same, minus the modification, the file stays
unlocked:
git reset --hard
git annex unlock foo && git annex add foo
git cat-file -p :foo
# /annex/objects/SHA256E-s4--b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
I'd expect the second action to end up with a locked file because (1)
it does with a modified file and (2) it does in V5.
From a user's perspective, I suppose this is a minor inconsistency,
and it's easy enough to call `git annex lock` here instead `git annex
add`. But in the case of DataLad, it makes the handling of our
internal `git annex add` calls trickier because we assume the V5
"annex add unconditionally locks" behavior and we'd have to add
special handling for the V6 behavior.
### What version of git-annex are you using? On what operating system?
git-annex version: 6.20180808-gdad627fa9
build flags: Assistant Webapp Pairing S3(multipartupload)(storageclasses) WebDAV Inotify ConcurrentOutput TorrentParser Feeds Testsuite
dependency versions: aws-0.17.1 bloomfilter-2.0.1.0 cryptonite-0.23 DAV-1.3.1 feed-0.3.12.0 ghc-8.0.2 http-client-0.5.7.0 persistent-sqlite-2.6.2 torrent-10000.1.1 uuid-1.3.13 yesod-1.4.5
key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL
remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar hook external
operating system: linux x86_64
supported repository versions: 3 5 6
upgrade supported from repository versions: 0 1 2 3 4 5
on Debian Stretch, built from source with `stack build`

View file

@ -0,0 +1,41 @@
[[!comment format=mdwn
username="yarikoptic"
avatar="http://cdn.libravatar.org/avatar/f11e9c84cb18d26a1748c33b48c924b4"
subject="confirming"
date="2018-08-30T15:57:39Z"
content="""
just wanted to say that I see the same (thanks Kyle for copy/pasteable example):
[[!format sh \"\"\"
$> git init tmp-v6 && cd tmp-v6
git annex init --version=6
echo foo >foo && git annex add foo && git commit -m'add foo'
git annex unlock foo
echo more >>foo && git annex add foo && git commit -m'modify foo'
ls -l $(readlink foo)
Initialized empty Git repository in /tmp/tmp-v6/.git/
init ok
(recording state in git...)
add foo ok
(recording state in git...)
[master (root-commit) 19d9427] add foo
1 file changed, 1 insertion(+)
create mode 120000 foo
unlock foo ok
(recording state in git...)
add foo ok
(recording state in git...)
[master 9a2a079] modify foo
1 file changed, 1 insertion(+), 1 deletion(-)
-rw------- 1 yoh yoh 9 Aug 30 11:52 .git/annex/objects/60/QW/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d
$> umask
077
$> git annex version
git-annex version: 6.20180807+git142-g1a08a8613-1~ndall+1
\"\"\"]]
tried with umask 022 - the same
"""]]

View file

@ -0,0 +1,9 @@
[[!comment format=mdwn
username="yarikoptic"
avatar="http://cdn.libravatar.org/avatar/f11e9c84cb18d26a1748c33b48c924b4"
subject="reproduced more"
date="2018-08-30T16:02:39Z"
content="""
tried across a number of boxes, and other users, and older git-annex -- the same effect everywhere.
The common denominator - I was using neurodebian build (will check next)
"""]]

View file

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="kyle"
avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3"
subject="v5"
date="2018-08-30T16:05:01Z"
content="""
> Also AFAIK there is no difference in the code path used here to move a file into the annex between v5 and v6. Does it happen with v5?
No, it doesn't:
-r--r--r-- 1 kyle kyle 9 Aug 29 17:02 .git/annex/objects/60/QW/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d
"""]]

View file

@ -0,0 +1,26 @@
[[!comment format=mdwn
username="yarikoptic"
avatar="http://cdn.libravatar.org/avatar/f11e9c84cb18d26a1748c33b48c924b4"
subject="clear docker for ubuntu 18:04 - the same"
date="2018-08-30T16:07:51Z"
content="""
[[!format sh \"\"\"
root@6f7d56840b4b:/tmp/tmp-v6# ls -l $(readlink foo)
-rw-r--r-- 1 root root 9 Aug 30 16:06 .git/annex/objects/60/QW/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d/SHA256E-s9--323409d9a706bc08d0b2c7f71309e21a757367c81cffb405a88e61749d79952d
root@6f7d56840b4b:/tmp/tmp-v6# history
1 apt-get update -qqq
2 apt-get install -t eatmydata
3 apt-get install -y eatmydata
4 eatmydata apt-get install -y git-annex
5 cd /tmp
6 git init tmp-v6 && cd tmp-v6
7 git annex init --version=6
8 echo foo >foo && git annex add foo && git commit -m'add foo'
9 git annex unlock foo
10 echo more >>foo && git annex add foo && git commit -m'modify foo'
11 ls -l $(readlink foo)
12 history
root@6f7d56840b4b:/tmp/tmp-v6# git annex version
git-annex version: 6.20180227
\"\"\"]]
"""]]