3 avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3"
5 date="2019-12-28T21:06:46Z"
7 Thanks for the explanation and the fix.
9 > For whatever reason, git becomes confused about whether this file is
10 > modified. I seem to recall that git distrusts information it recorded in
11 > its own index if the mtime of the index file is too close to the
12 > mtime recorded inside it, or something like that.
14 I see. I think the problem and associated workaround you're referring
15 to is described in git's Documentation/technical/racy-git.txt.
17 > Note that, you can accomplish the same thing without setting
18 > annex.largefiles, assuming a current version of git-annex:
21 > git annex add file-annex
23 > I think the only reason for setting annex.largefiles in either of the two
24 > places you did is if there's a default value that you want to
25 > temporarily override?
27 Right. DataLad's methods that are responsible for calling out to `git
28 annex add` have a `git={None,False,True}` parameter. By default
29 (`None`), DataLad just calls `git annex add ...` and let's any
30 configuration in the repo control whether the file goes to git or is
31 annexed. But with `git=True` or `git=False`, the `annex add` call
32 includes a `-c annex.largefiles=` argument with a value of `nothing`
33 or `anything`, respectively.
35 > But just to say that setting annex.largefiles=anything/nothing
36 > temporarily is a blunt instrument, and you risk accidental
37 > conversion when using it, and so it would be a good idea to not do
40 Noted. As mentioned above, DataLad's default behavior is to honor the
41 repo's `annex.largefiles` configuration. And the documentation for
42 `datalad save`, DataLad's main user-facing entry point for `annex
43 add`, recommends that the user configure .gitattributes rather than
44 using the option that leads calling `annex add` with `-c
45 annex.largefiles=nothing`.
47 > One idea: Make `git-annex add --annex` and `git-annex add --git`
48 > add a specific file to annex or git, bypassing annex.largefiles and all
49 > other configuration and state. This could also be used to easily switch
50 > a file from one storage to the other. I'd hope the existence of that
51 > would prevent one-off setting of annex.largefiles=anything/nothing.
53 As far as I can see, those flags would completely cover DataLad's
54 one-off setting of `annex.largefiles=anything/nothing`. They map
55 directly to DataLad's `git=False/True` option described above. So,
56 from DataLad's perspective, they'd be very useful and welcome.