Lines Matching +full:multi +full:- +full:color
2 # SPDX-License-Identifier: GPL-2.0-only
6 # (c) 2014-2017 Valentin Rothberg <valentinrothberg@gmail.com>
23 SYMBOL = r"(?:\w*[A-Z0-9]\w*){2,}"
31 REGEX_FILE_KCONFIG = re.compile(r".*Kconfig[\.\w+\-]*$")
38 REGEX_FILTER_SYMBOLS = re.compile(r"[A-Za-z0-9]$")
39 REGEX_NUMERIC = re.compile(r"0[xX][0-9a-fA-F]+|[0-9]+")
48 "Please note that specifying commits will 'git reset --hard\' " \
54 parser.add_argument('-c', '--commit', dest='commit', action='store',
59 parser.add_argument('-d', '--diff', dest='diff', action='store',
62 "(e.g., -d commmit1..commit2)")
64 parser.add_argument('-f', '--find', dest='find', action='store_true',
67 "missing (required to run with --diff)")
69 parser.add_argument('-i', '--ignore', dest='ignore', action='store',
72 "(e.g., -i '.*defconfig')")
74 parser.add_argument('-s', '--sim', dest='sim', action='store', default="",
75 help="print a list of max. 10 string-similar symbols")
77 parser.add_argument('--force', dest='force', action='store_true',
81 parser.add_argument('--no-color', dest='color', action='store_false',
91 if args.diff and not re.match(r"^[\w\-\.\^]+\.\.[\w\-\.\^]+$", args.diff):
99 "calls 'git reset --hard' for some performance\nreasons. "
101 "'--force' if you\nwant to ignore this warning and "
120 global COLOR
121 COLOR = args.color and sys.stdout.isatty()
167 files = sorted(undefined_b.get(symbol) -
199 print("\t- %s (\"%s\")" % (yel(commit[0]), commit[1]))
201 print("\t- no commit found")
207 execute(["git", "reset", "--hard", commit])
212 Color %string yellow.
214 return "\033[33m%s\033[0m" % string if COLOR else string
219 Color %string red.
221 return "\033[31m%s\033[0m" % string if COLOR else string
236 commits = execute(["git", "log", "--pretty=oneline",
237 "--abbrev-commit", "-G",
245 stdout = execute(["git", "status", "--porcelain"])
254 stdout = execute(["git", "rev-parse", "HEAD"])
259 """Partition list @lst into eveni-sized lists of size @size."""
269 """Return a list of max. ten Kconfig symbols that are string-similar to
292 # use 'git ls-files' to get the worklist
293 stdout = execute(["git", "ls-files"])
294 if len(stdout) > 0 and stdout[-1] == "\n":
295 stdout = stdout[:-1]
368 if symbol[:-len("_MODULE")] in defined_symbols:
391 with open(sfile, "r", encoding='utf-8', errors='replace') as stream:
440 with open(kfile, "r", encoding='utf-8', errors='replace') as stream:
460 # multi-line statements