Lines Matching +full:- +full:- +full:commits

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+\-]*$")
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',
60 help="diff undefined symbols between two commits "
61 "(e.g., -d commmit1..commit2)")
63 parser.add_argument('-f', '--find', dest='find', action='store_true',
65 help="find and show commits that may cause symbols to be "
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")
169 files = sorted(undefined_b.get(symbol) -
196 print("%s:" % yel("Commits changing symbol"))
197 commits = find_commits(symbol, args.diff)
198 if commits:
199 for commit in commits:
201 print("\t- %s (\"%s\")" % (yel(commit[0]), commit[1]))
203 print("\t- no commit found")
209 execute(["git", "reset", "--hard", commit])
237 """Find commits changing %symbol in the given range of %diff."""
238 commits = execute(["git", "log", "--pretty=oneline",
239 "--abbrev-commit", "-G",
241 return [x for x in commits.split("\n") if x]
247 stdout = execute(["git", "status", "--porcelain"])
256 stdout = execute(["git", "rev-parse", "HEAD"])
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]
370 if symbol[:-len("_MODULE")] in defined_symbols:
393 with open(sfile, "r", encoding='utf-8', errors='replace') as stream:
441 with open(kfile, "r", encoding='utf-8', errors='replace') as stream:
455 # multi-line statements