Store commands as arrays.
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index d717485..c039714 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1968,7 +1968,7 @@
             vcs = mesonlib.detect_vcs(source_dir)
             if vcs:
                 mlog.log('Found {} repository at {}'.format(vcs['name'], vcs['wc_dir']))
-                vcs_cmd = vcs['get_rev'].split()
+                vcs_cmd = vcs['get_rev']
                 regex_selector = vcs['rev_regex']
             else:
                 vcs_cmd = [' '] # executing this cmd will fail in vcstagger.py and force to use the fallback string
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index 76a6df8..3d6037f 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -751,13 +751,13 @@
             raise EnvironmentException('Unable to detect native OS architecture')
     return arch
 
-def detect_vcs(source_dir: T.Union[str, Path]) -> T.Optional[T.Dict[str, str]]:
+def detect_vcs(source_dir: T.Union[str, Path]) -> T.Optional[T.Dict[str, T.Union[str, T.List[T.str]]]]:
     vcs_systems = [
         {
             'name': 'git',
             'cmd': 'git',
             'repo_dir': '.git',
-            'get_rev': 'git describe --dirty=+ --always',
+            'get_rev': ['git describe', '--dirty=+', '--always'],
             'rev_regex': '(.*)',
             'dep': '.git/logs/HEAD'
         },
@@ -765,7 +765,7 @@
             'name': 'mercurial',
             'cmd': 'hg',
             'repo_dir': '.hg',
-            'get_rev': 'hg id -i',
+            'get_rev': ['hg', 'id', '-i'],
             'rev_regex': '(.*)',
             'dep': '.hg/dirstate'
         },
@@ -773,7 +773,7 @@
             'name': 'subversion',
             'cmd': 'svn',
             'repo_dir': '.svn',
-            'get_rev': 'svn info',
+            'get_rev': ['svn', 'info'],
             'rev_regex': 'Revision: (.*)',
             'dep': '.svn/wc.db'
         },
@@ -781,7 +781,7 @@
             'name': 'bazaar',
             'cmd': 'bzr',
             'repo_dir': '.bzr',
-            'get_rev': 'bzr revno',
+            'get_rev': ['bzr', 'revno'],
             'rev_regex': '(.*)',
             'dep': '.bzr'
         },
@@ -795,7 +795,9 @@
     parent_paths_and_self.appendleft(source_dir)
     for curdir in parent_paths_and_self:
         for vcs in vcs_systems:
-            if Path.is_dir(curdir.joinpath(vcs['repo_dir'])) and shutil.which(vcs['cmd']):
+            repodir = T.cast(str, vcs['repo_dir'])
+            cmd = T.cast(str, vcs['cmd'])
+            if Path.is_dir(curdir.joinpath(repodir)) and shutil.which(cmd):
                 vcs['wc_dir'] = str(curdir)
                 return vcs
     return None