File: Checking_that_everything_is_committed.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 (32 lines) | stat: -rw-r--r-- 2,274 bytes parent folder | download | duplicates (5)
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
I use this to check that git repos have nothing untracked:

        # 1st command: check index against HEAD
        # 2nd command: check working tree against index
        # 3rd command: check for untracked files
        # 4th command: check for stashes
        git diff-index --quiet --cached HEAD \
            && git diff-files --quiet \
            && test -z "$(git status --porcelain)" \
            && test -z "$(git stash list)"

The call to git-diff-files(1) fails in a v7 repo with output like this (if I drop the `--quiet`):

    spwhitton@iris:~/lib/athena-apt>git diff-files
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/buster-backports/main/binary-amd64/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/buster-backports/main/binary-i386/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/buster/main/binary-amd64/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/buster/main/binary-i386/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/rc-buggy/main/binary-amd64/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/rc-buggy/main/binary-i386/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/sid/main/binary-amd64/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/sid/main/binary-i386/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/stretch/main/binary-amd64/Packages
    :100644 100644 f8e47b9532ea17ac825c39bddc35dbd68f120a46 0000000000000000000000000000000000000000 M	dists/stretch/main/binary-i386/Packages

I note that the listed files are empty.

Is there a git-annex command that I can run to normalise my repo so that git-diff-files(1) produces no output?  Or does it not make sense to run git-diff-files(1) in a v7 repo?

Thanks.

--spwhitton