Diff lists files without --name-only though, so the flag specifies you want _only_ the filenames of those with a diff.
True, but it's inconsistent with eg grep.
Getting only the changed filenames is a fairly specialised operation. Often in normal use you can get away with a more generic operation that comes close to what you need, but is way more common, e.g.
git diff --stat
Half the time, when I know what I want, I both keep forgetting git flags and sub-commands - and struggle to find them in the man pages.
Like the fine:
git diff --name-only # i list only the files that are changed. But I'm not --list-files.