|
|
Created:
4 years, 4 months ago by Paweł Hajdan Jr. Modified:
4 years, 4 months ago CC:
chromium-reviews, dpranke+depot_tools_chromium.org, iannucci+depot_tools_chromium.org Target Ref:
refs/heads/master Project:
depot_tools Visibility:
Public. |
Descriptiongit: fix git cache support
It's now based on bot_update logic.
BUG=630601
Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/d755329820d5d905768cdc7503134e99f8979d05
Patch Set 1 #
Messages
Total messages: 15 (8 generated)
phajdan.jr@chromium.org changed reviewers: + emso@chromium.org, sergiyb@chromium.org, tandrii@chromium.org
The CQ bit was checked by phajdan.jr@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
what is broken that this CL is fixing?
On 2016/08/04 at 16:31:30, tandrii wrote: > what is broken that this CL is fixing? @@@STEP_NEST_LEVEL@1@@@ Initialized empty Git repository in /tmp/roll_infraiWtZNM/.git/ @@@STEP_CLOSED@@@ @@@SEED_STEP@infra.fetch cache@@@ @@@STEP_CURSOR@infra.fetch cache@@@ @@@STEP_STARTED@@@ git retry cache fetch -c /usr/local/google/home/phajdan/infra_internal2/infra/build/slave/cache_dir in dir /tmp/roll_infraiWtZNM: cmd: ['git', 'retry', 'cache', 'fetch', '-c', '/usr/local/google/home/phajdan/infra_internal2/infra/build/slave/cache_dir'] cwd: /tmp/roll_infraiWtZNM env: {'PATH': '/usr/local/google/home/phajdan/infra_internal2/infra/recipes/.recipe_deps/depot_tools/:%(PATH)s'} name: infra.fetch cache full environment: DISPLAY: :0 HOME: /usr/local/google/home/phajdan LANG: en_US.UTF-8 LOGNAME: phajdan PATH: /usr/local/google/home/phajdan/infra_internal2/infra/recipes/.recipe_deps/depot_tools/:/usr/local/google/home/phajdan/depot_tools:/usr/local/google/home/phajdan/buck/bin:/usr/lib/google-golang/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD: /usr/local/google/home/phajdan/infra_internal2/infra PYTHONPATH: /usr/local/buildtools/current/sitecustomize SHELL: /bin/bash SSH_AGENT_PID: 9088 SSH_AUTH_SOCK: /tmp/ssh-gOvKI47kdwfS/agent.8948 USER: phajdan @@@STEP_NEST_LEVEL@1@@@ fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' Traceback (most recent call last): File "/usr/local/google/home/phajdan/infra_internal2/infra/recipes/.recipe_deps/depot_tools//git_cache.py", line 735, in <module> sys.exit(main(sys.argv[1:])) File "/usr/local/google/home/phajdan/infra_internal2/infra/recipes/.recipe_deps/depot_tools//git_cache.py", line 730, in main return dispatcher.execute(OptionParser(), argv) File "/usr/local/google/home/phajdan/infra_internal2/infra/recipes/.recipe_deps/depot_tools/subcommand.py", line 252, in execute return command(parser, args[1:]) File "/usr/local/google/home/phajdan/infra_internal2/infra/recipes/.recipe_deps/depot_tools//git_cache.py", line 627, in CMDfetch [Mirror.git_exe, 'rev-parse', '--abbrev-ref', 'HEAD']).strip() File "/usr/lib/python2.7/subprocess.py", line 573, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['git', 'rev-parse', '--abbrev-ref', 'HEAD']' returned non-zero exit status 128 ERROR:git-retry:Process failure was not known to be transient; terminating with return code 1 step returned non-zero exit code: 1 That's result of running recipes/recipes.py run recipe_autoroller_public in infra repo with the following diff: diff --git a/recipes/recipe_modules/recipe_autoroller/api.py b/recipes/recipe_modules/recipe_autoroller/api.py index 4a8defd..ab3737a 100644 --- a/recipes/recipe_modules/recipe_autoroller/api.py +++ b/recipes/recipe_modules/recipe_autoroller/api.py @@ -163,7 +163,7 @@ class RecipeAutorollerApi(recipe_api.RecipeApi): def _roll_project(self, project_data, recipes_dir): with self.m.tempfile.temp_dir('roll_%s' % project_data['id']) as workdir: self.m.git.checkout( - project_data['repo_url'], dir_path=workdir, submodules=False) + project_data['repo_url'], dir_path=workdir, submodules=False, use_git_cache=True) # Introduce ourselves to git - also needed for git cl upload to work. self.m.git(
On 2016/08/04 16:48:31, Paweł Hajdan Jr. wrote: > On 2016/08/04 at 16:31:30, tandrii wrote: > > what is broken that this CL is fixing? > > @@@STEP_NEST_LEVEL@1@@@ > Initialized empty Git repository in /tmp/roll_infraiWtZNM/.git/ > ... Sorry for not being clear. I mean this: your description says "fix bug", but doesn't describe what's wrong. The issue it references is more like a feature request than a specific bug. So, imagine your CL lands and somebody later sees the newly added lines and wonders "why?". Before you've posted HUGE amount of text above, it was almost completely impossible. Now it's possible, but requires opening this CL and navigating through comments. I think the description of the CL must contain the reasoning for adding two new non-trivial commands. Furthermore, what commands isn't not obvious at all, unless someone understands how git cache works, thus I think a comment inside code like this would be a good additional (even more so, if I'm wrong below): # Running git cache fetch above actually modifies origin # to point to a local path where actual cache is. # So, reset origin URL to what it used to be, to be consistent # with the way checkout() works without using cache.
Description was changed from ========== git: fix git cache support BUG=630601 ========== to ========== git: fix git cache support It's now based on bot_update logic. BUG=630601 ==========
discussed offline with Pawel: so for some reason "git cache fetch" didn't quite do what I expected given the its docs. Thus, Pawel adopted whatever is already wokring in bot_update. So, LGTM
The CQ bit was checked by phajdan.jr@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== git: fix git cache support It's now based on bot_update logic. BUG=630601 ========== to ========== git: fix git cache support It's now based on bot_update logic. BUG=630601 Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/d755329820d5d9... ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/tools/depot_tools/+/d755329820d5d9... |