What is the predicate function to determine if a given file is under version control? (I'm using git.)
The canonical way is to call
(vc-backend <file>), AFAIK.
vc-registered is correct. You just pass it the file path and it will work with any backend. Use
vc-responsible-backend to get the backend name.
(vc-registered (buffer-file-name)) ;; => t (vc-responsible-backend (buffer-file-name)) ;; => Git
These answers are wrong.
You should use (vc-git-registered (file)). Returns t or nil.
(vc-state (file)) returns state of repository. Not a state of a single file. vc-state returns 'up-to-date on file which is not under version control but it's located in directory which us under control of GIT.