safeGitSubcommands top-level constant
Safe git subcommands for read-only mode.
Implementation
const safeGitSubcommands = <String, Set<String>>{
'log': {
'--oneline',
'--graph',
'--all',
'--pretty',
'--format',
'--stat',
'--shortstat',
'--name-only',
'--name-status',
'--numstat',
'--author',
'--since',
'--until',
'--grep',
'-n',
'--follow',
'--diff-filter',
'--no-merges',
'--merges',
'--first-parent',
'--ancestry-path',
'--topo-order',
'--date-order',
},
'show': {
'--stat',
'--name-only',
'--name-status',
'--format',
'--pretty',
'--no-patch',
'--raw',
'--word-diff',
},
'diff': {
'--stat',
'--shortstat',
'--name-only',
'--name-status',
'--numstat',
'--no-color',
'--color',
'--word-diff',
'--unified',
'--cached',
'--staged',
'-U',
},
'status': {'--short', '-s', '--porcelain', '--branch', '-b', '--untracked'},
'branch': {
'--list',
'-l',
'-a',
'--all',
'-r',
'--remote',
'--verbose',
'-v',
'--contains',
},
'tag': {'--list', '-l', '-n', '--contains', '--sort'},
'remote': {'show', '-v', '--verbose'},
'blame': {'--date', '-e', '-w', '-M', '-C', '-L'},
'rev-parse': {'--short', '--abbrev-ref', '--show-toplevel', '--git-dir'},
'rev-list': {'--count', '--all', '--since', '--until', '--author'},
'ls-files': {'-m', '--modified', '-o', '--others', '--ignored'},
'ls-tree': {'-r', '--name-only', '-l', '--long'},
'cat-file': {'-t', '-s', '-p', '-e'},
'shortlog': {'-s', '-n', '--summary', '--numbered'},
'describe': {'--tags', '--always', '--abbrev', '--long'},
'reflog': {'show', '--format', '--date', '-n'},
'stash': {'list', 'show'},
'config': {'--get', '--get-all', '--list', '-l'},
'worktree': {'list'},
};