summaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/gitutil.py
AgeCommit message (Collapse)Author
2025-05-27u_boot_pylib: Add more functions to gitutilSimon Glass
Add functions for checking a branch, showing a commit, etc. to support the new functionality. Git version 2.34.1 ignores --stat if --quiet is given, so adjust the args so that this performs as expected. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Deal with git safe-directory warningSimon Glass
When running tests where the .git directory is not owned by the current user, various warnings are produced and the tests fail. This happens in CI. For patman itself, modify the gitutil.get_top_level() function to return None in this case. Ensure that the warning is not shown, since it creates about 1000 lines of output. For checkpatch, the same warning is produced even though --no-tree is given. Suppress that as well. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27u_boot_pylib: Correct pylint warnings in gitutilSimon Glass
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>
2025-05-27patman: Clean up creation of the git treeSimon Glass
The test starts with the HEAD pointing to the wrong place, so that the created files appear to be deleted. Fix this by resetting the tree before tests start. Add a check that the tree is clean. Update pygit2 so that the enums are available.
2025-05-27u_boot_pylib: Speed up determining the upstream branchSimon Glass
Use --decorate to quickly detect the upstream branch, since this is much faster than using 'git name-rev' on every possible commit. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27u_boot_pylib: Provide directories to gitutil functionsSimon Glass
For testing it is useful to be able to set the current directory used for git operations, as well as the git-repo directory. Update some of the functions to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27u_boot_pylib: Tidy up quoting of cc and toSimon Glass
The current approach to calling 'git send-email' puts double quotes around each email address to ensure that it will pass the shell correctly. This is a bit cumbersome and requires using a shell to sort it all out. Drop the quotes and use command.run() instead, to simplify things. This will also make it possible to (later) set the current directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Pass the alias dict into gitutil.email_patches()Simon Glass
Rather than accessing the settings module in this function, require the alias dict to be passed in. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Pass the alias dict into gitutil.build_email_list()Simon Glass
Rather than accessing the settings module in this function, require the alias dict to be passed in. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Untangle settings from gitutilSimon Glass
The gitutil module is supposed to be independent from patman but one piece was missed in the series which separated them. Move the settings setup out of gitutil Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-10patman: Show the base commit and branchSimon Glass
It is helpful to know which commit patches are based on, even if that commit might not be available to readers. Add a tag for this in the cover letter. Also add the local-branch name since that may be useful to the writer. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-01u_boot_pylib: Clean up pylint warnings in gitutil.pySimon Glass
This file has about 40 pylint warnings, but no errors. Quite a few of these warnings have been there for a while, but most are coming from newer versions of pylint, where people come up with new warnings. The f-string warning is the most common one: C0209: Formatting a regular string which could be an f-string That feature was not available when the code was written, but it is often more convenient than using % with a list of arguments. This patches reduces the number of warnings in this file, with 7 left remaining. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-04Merge patch series "tools: Minor clean-ups for the command library"Tom Rini
Simon Glass <sjg@chromium.org> says: This series adds comments and fixes pylint warnings in the command library. It also introduces a new, simpler way of running a single command. Link: https://lore.kernel.org/r/20250203162704.627469-1-sjg@chromium.org
2025-02-17u_boot_pylib: Move gitutil into the librarySimon Glass
Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass <sjg@chromium.org>