diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-10-18 17:06:42 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-10-20 15:19:04 +0200 |
commit | 9559e41f3d5fa7bbcc857ef0432ba33cd3f0fb80 (patch) | |
tree | de9f92a44f6f2098df7d2109b9010caf6cb078b3 /bin | |
parent | 0eb88fad54c2efcac134dfdecc6ea2f4d83281db (diff) | |
download | justbuild-9559e41f3d5fa7bbcc857ef0432ba33cd3f0fb80.tar.gz |
just-mr: Warn on inefficient Git operations
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/just-mr.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/just-mr.py b/bin/just-mr.py index 9f4a89a2..1599826c 100755 --- a/bin/just-mr.py +++ b/bin/just-mr.py @@ -95,6 +95,7 @@ KNOWN_JUST_SUBCOMMANDS = { "build root": True } } +CURRENT_SUBCOMMAND = None LOCATION_TYPES = ["workspace", "home", "system"] @@ -502,6 +503,11 @@ def file_as_git(fpath): # TODO: consider also doing this for pending changes # copy non-git paths to tmp-workspace and import to git fpath = os.path.realpath(fpath) + if CURRENT_SUBCOMMAND: + log(f"""\ +Warning: Inefficient Git import of file path '{fpath}'. + Please consider using 'just-mr setup' and 'just {CURRENT_SUBCOMMAND}' + separately to cache the output.""") target = archive_tmp_checkout_dir(os.path.relpath(fpath, "/"), repo_type="file") os.makedirs(os.path.dirname(target), exist_ok=True) @@ -738,7 +744,10 @@ def call_just(*, config, main, args): if subcommand in KNOWN_JUST_SUBCOMMANDS: if KNOWN_JUST_SUBCOMMANDS[subcommand]["config"]: use_config = True + global CURRENT_SUBCOMMAND + CURRENT_SUBCOMMAND = subcommand config = setup(config=config, main=main) + CURRENT_SUBCOMMAND = None use_build_root = KNOWN_JUST_SUBCOMMANDS[subcommand]["build root"] cmd = [JUST] cmd += [subcommand] if subcommand else [] |