mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Reduce git cl split oversplitting.
Without this change, git cl split will create a separate CL for every file that has per-file owners rules. This is almost always the wrong thing to do. With this change, it will at least aggregate all such files to their parent directory. This may under-split, but is perhaps nearer the mark. Change-Id: Iea7997b36d053713fa00f1261ea032e09d9c2818 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2555729 Auto-Submit: Sigurður Ásgeirsson <siggi@chromium.org> Commit-Queue: Dirk Pranke <dpranke@google.com> Reviewed-by: Dirk Pranke <dpranke@google.com>
This commit is contained in:
committed by
LUCI CQ
parent
f819411f2a
commit
1af7968d68
@@ -152,6 +152,10 @@ def GetFilesSplitByOwners(owners_database, files):
|
||||
files_split_by_owners = collections.defaultdict(list)
|
||||
for action, path in files:
|
||||
enclosing_dir = owners_database.enclosing_dir_with_owners(path)
|
||||
# Anything matching a per-file rule will return its own path.
|
||||
# Aggregate up to the parent directory so as not to over-split.
|
||||
if enclosing_dir == path:
|
||||
enclosing_dir = os.path.dirname(path)
|
||||
files_split_by_owners[enclosing_dir].append((action, path))
|
||||
return files_split_by_owners
|
||||
|
||||
|
||||
Reference in New Issue
Block a user