Stop logging refs set
We currently emit a debug log line for each ref that we set when preparing a repo for a job. This might be an enormous number of very boring log lines for large repos. Since we now store this information in a file accessible to the job (which can be saved with the job logs), this information is now accessible for debug purposes that way. Instead, just log how many refs we intend to set (so that if there are a lot, we know what the executor/merger is doing) and log any missing objects. Change-Id: Iebc52cbc4aa4fb778b371f90343e53ece6fa3699
This commit is contained in:
parent
d72ad52ec6
commit
cdaa86d78b
@ -556,6 +556,11 @@ class Repo(object):
|
||||
with open(refs_path, 'wb') as f:
|
||||
f.write(b'# pack-refs with: peeled fully-peeled sorted \n')
|
||||
sorted_paths = sorted(refs.keys())
|
||||
msg = f"Setting {len(sorted_paths)} refs in {repo.git_dir}"
|
||||
if log:
|
||||
log.debug(msg)
|
||||
else:
|
||||
messages.append(msg)
|
||||
for path in sorted_paths:
|
||||
hexsha = refs[path]
|
||||
try:
|
||||
@ -564,7 +569,6 @@ class Repo(object):
|
||||
binsha = gitdb.util.to_bin_sha(hexsha)
|
||||
oinfo = repo.odb.info(binsha)
|
||||
f.write(f'{hexsha} {path}\n'.encode(encoding))
|
||||
msg = f"Set reference {path} at {hexsha} in {repo.git_dir}"
|
||||
if oinfo.type == b'tag':
|
||||
# We are an annotated or signed tag which
|
||||
# refers to another commit. We must handle this
|
||||
@ -572,11 +576,6 @@ class Repo(object):
|
||||
tagobj = git.Object.new_from_sha(repo, binsha)
|
||||
tagsha = tagobj.object.hexsha
|
||||
f.write(f'^{tagsha}\n'.encode(encoding))
|
||||
msg += f" with tag target {tagsha}"
|
||||
if log:
|
||||
log.debug(msg)
|
||||
else:
|
||||
messages.append(msg)
|
||||
except ValueError:
|
||||
# If the object does not exist, skip setting it.
|
||||
msg = (
|
||||
|
Loading…
Reference in New Issue
Block a user