File: git_keeps_refreshing_index_for_untracked_files.mdwn

package info (click to toggle)
git-annex 10.20250416-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 73,572 kB
  • sloc: haskell: 90,656; javascript: 9,103; sh: 1,469; makefile: 211; perl: 137; ansic: 44
file content (54 lines) | stat: -rw-r--r-- 2,151 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
### Please describe the problem.

I have a repository that contains thousands (30000) of unlocked files. I see the problem that 
git keeps refreshing its index despite the modified time did not change compared to the git index.
I think this should not happen. It significantly slows down (delay of ~10s in my case, but
potentially worse for Windows or NFS file systems) any git operation, and this includes
the display of a bash prompt that shows git information (via PROMPT_COMMAND env var.) and bash
completion after things like `git add`, therefore it is quite annoying. 

### What steps will reproduce the problem?

I have set up a repository to reproduce the problem. However, it works as expected. I am looking for
ideas on how to find the problem with my repository.

```
git init .
git annex init 
git annex config --set annex.addunlocked include="py_env/*"
python -m venv py_env
. py_env/bin/activate
pip install datalad   # some package with dependencies that creates many files in py_env
git annex add py_env
git status
git status
git status
...
```

The only strange thing that I have found is that git annex will forward all `__init__.py` files to the smudge/clean-filter (pipes to filter-process), but only those! It does not do this for all other files in `py_env`, as you can check with

```sh
strace git status 2>&1 | grep "^write.*pathname="
```

this shows only the `__init__.py` files, despite `find py_env` shows many more files in there and they are skipped. I think that git skips files during `git status` if the mtime and the ctime are the same. But they are always the same, as can be checked by comparing

```sh
git ls-files --debug "(any file that shows up in strace)"
stat -c $'ctime: %.9Z\nmtime: %.9Y' "(same file)"
```

I do not know how to debug further and are grateful for suggestions!

### What version of git-annex are you using? On what operating system?

git-annex version: 10.20250115-ga55e1da1aa0eb07b418e899cc200027e082eb82a
git version 2.47.1
Rocky Linux



### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)