Lines Matching +full:stdout +full:- +full:path
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 "
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])
225 """Execute %cmd and return stdout. Exit in case of error."""
227 stdout = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
228 stdout = stdout.decode(errors='replace')
231 return stdout
236 commits = execute(["git", "log", "--pretty=oneline",
237 "--abbrev-commit", "-G",
245 stdout = execute(["git", "status", "--porcelain"])
246 for line in stdout:
254 stdout = execute(["git", "rev-parse", "HEAD"])
255 return stdout.strip('\n')
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]
298 for gitfile in stdout.rsplit("\n"):
300 ".log" in gitfile or os.path.isdir(gitfile) or \
368 if symbol[:-len("_MODULE")] in defined_symbols:
388 if not os.path.exists(sfile):
391 with open(sfile, "r", encoding='utf-8', errors='replace') as stream:
437 if not os.path.exists(kfile):
440 with open(kfile, "r", encoding='utf-8', errors='replace') as stream:
460 # multi-line statements