Lines Matching +full:stdout +full:- +full:path

2 # SPDX-License-Identifier: GPL-2.0-only
6 # (c) 2014-2017 Valentin Rothberg <[email protected]>
23 SYMBOL = r"(?:\w*[A-Z0-9]\w*){2,}"
31 REGEX_FILE_KCONFIG = re.compile(r".*Kconfig[\.\w+\-]*$")
37 REGEX_FILTER_SYMBOLS = re.compile(r"[A-Za-z0-9]$")
38 REGEX_NUMERIC = re.compile(r"0[xX][0-9a-fA-F]+|[0-9]+")
47 "Please note that specifying commits will 'git reset --hard\' " \
53 parser.add_argument('-c', '--commit', dest='commit', action='store',
58 parser.add_argument('-d', '--diff', dest='diff', action='store',
61 "(e.g., -d commmit1..commit2)")
63 parser.add_argument('-f', '--find', dest='find', action='store_true',
66 "missing (required to run with --diff)")
68 parser.add_argument('-i', '--ignore', dest='ignore', action='store',
71 "(e.g., -i '.*defconfig')")
73 parser.add_argument('-s', '--sim', dest='sim', action='store', default="",
74 help="print a list of max. 10 string-similar symbols")
76 parser.add_argument('--force', dest='force', action='store_true',
80 parser.add_argument('--no-color', dest='color', action='store_false',
90 if args.diff and not re.match(r"^[\w\-\.\^]+\.\.[\w\-\.\^]+$", args.diff):
98 "calls 'git reset --hard' for some performance\nreasons. "
100 "'--force' if you\nwant to ignore this warning and "
105 sys.exit("The --commit option can't use the HEAD ref")
123 COLOR = args.color and sys.stdout.isatty()
169 files = sorted(undefined_b.get(symbol) -
201 print("\t- %s (\"%s\")" % (yel(commit[0]), commit[1]))
203 print("\t- no commit found")
209 execute(["git", "reset", "--hard", commit])
227 """Execute %cmd and return stdout. Exit in case of error."""
229 stdout = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)
230 stdout = stdout.decode(errors='replace')
233 return stdout
238 commits = execute(["git", "log", "--pretty=oneline",
239 "--abbrev-commit", "-G",
247 stdout = execute(["git", "status", "--porcelain"])
248 for line in stdout:
256 stdout = execute(["git", "rev-parse", "HEAD"])
257 return stdout.strip('\n')
261 """Partition list @lst into eveni-sized lists of size @size."""
271 """Return a list of max. ten Kconfig symbols that are string-similar to
294 # use 'git ls-files' to get the worklist
295 stdout = execute(["git", "ls-files"])
296 if len(stdout) > 0 and stdout[-1] == "\n":
297 stdout = stdout[:-1]
300 for gitfile in stdout.rsplit("\n"):
302 ".log" in gitfile or os.path.isdir(gitfile) or \
370 if symbol[:-len("_MODULE")] in defined_symbols:
390 if not os.path.exists(sfile):
393 with open(sfile, "r", encoding='utf-8', errors='replace') as stream:
438 if not os.path.exists(kfile):
441 with open(kfile, "r", encoding='utf-8', errors='replace') as stream:
455 # multi-line statements
477 os.dup2(devnull, sys.stdout.fileno())