Well, vc
does that by default. From its documentation (emphasis mine):
When you visit a file that is under version control, Emacs indicates
this on the mode line. For example, ‘Bzr-1223’ says that Bazaar is used
for that file, and the current revision ID is 1223.
The character between the back-end name and the revision ID indicates
the "version control status" of the work file. In a merge-based version
control system, a ‘-’ character indicates that the work file is
unmodified, and ‘:’ indicates that it has been modified. ‘!’ indicates
that the file contains conflicts as result of a recent merge operation
(*note Merging::), or that the file was removed from the version
control. Finally, ‘?’ means that the file is under version control, but
is missing from the working tree.