summaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/gitutil.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-05-10 13:04:54 +0200
committerSimon Glass <sjg@chromium.org>2025-05-27 10:07:42 +0100
commit45f239afa1f85fdc6700d8e088e179024c6c21b0 (patch)
tree8f42674e8afa80e1724172df8b72e4dfa5dcdeb1 /tools/u_boot_pylib/gitutil.py
parent2e680f67657cef65d8f195a122734bf01280a86c (diff)
u_boot_pylib: Correct pylint warnings in gitutil
Correct various pylint warnings in this file. The remaining ones are three functions with too many arguments (R0913 and R0918) and use of global (W0603). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/u_boot_pylib/gitutil.py')
-rw-r--r--tools/u_boot_pylib/gitutil.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/u_boot_pylib/gitutil.py b/tools/u_boot_pylib/gitutil.py
index 3c52cce232c..cfcfeffe2f4 100644
--- a/tools/u_boot_pylib/gitutil.py
+++ b/tools/u_boot_pylib/gitutil.py
@@ -2,6 +2,8 @@
# Copyright (c) 2011 The Chromium OS Authors.
#
+"""Basic utilities for running the git command-line tool from Python"""
+
import os
import sys
@@ -22,6 +24,8 @@ def log_cmd(commit_range, git_dir=None, oneline=False, reverse=False,
oneline (bool): True to use --oneline, else False
reverse (bool): True to reverse the log (--reverse)
count (int or None): Number of commits to list, or None for no limit
+ decorate (bool): True to use --decorate
+
Return:
List containing command and arguments to run
"""
@@ -518,9 +522,8 @@ send --cc-cmd cc-fname" cover p1 p2'
"""
to = build_email_list(series.get('to'), alias, '--to', warn_on_error)
if not to:
- git_config_to = command.output('git', 'config', 'sendemail.to',
- raise_on_error=False)
- if not git_config_to:
+ if not command.output('git', 'config', 'sendemail.to',
+ raise_on_error=False):
print("No recipient.\n"
"Please add something like this to a commit\n"
"Series-to: Fred Bloggs <f.blogs@napier.co.nz>\n"
@@ -549,9 +552,8 @@ send --cc-cmd cc-fname" cover p1 p2'
cmd += args
if not dry_run:
command.run(*cmd, capture=False, capture_stderr=False, cwd=cwd)
- cmdstr = ' '.join([f'"{x}"' if ' ' in x and not '"' in x else x
- for x in cmd])
- return cmdstr
+ return' '.join([f'"{x}"' if ' ' in x and '"' not in x else x
+ for x in cmd])
def lookup_email(lookup_name, alias, warn_on_error=True, level=0):
@@ -720,6 +722,7 @@ def get_hash(spec, git_dir=None):
Args:
spec (str): Git commit to show, e.g. 'my-branch~12'
+ git_dir (str): Path to git repository (None to use default)
Returns:
str: Hash of commit
@@ -762,6 +765,7 @@ def check_dirty(git_dir=None, work_tree=None):
Args:
git_dir (str): Path to git repository (None to use default)
+ work_tree (str): Git worktree to use, or None if none
Return:
str: List of dirty filenames and state