patchwork
Manage and apply patches in a workflow
TLDR
Render a PNG image with a filename based on the input filename and output format (uppercase -O)
Render a SVG image with the specified output filename (lowercase -o)
Render the output in PS, PDF, SVG, Fig, PNG, GIF, JPEG, JSON, or DOT format
Render a gif image using stdin and stdout
Display help
SYNOPSIS
pwclient [GLOBAL_OPTIONS] COMMAND [COMMAND_OPTIONS] [ARGUMENTS]
Example: pwclient list --project kernel --state new
Example: pwclient download 12345 --output-dir ./patches
PARAMETERS
GLOBAL_OPTIONS
Options that apply to all pwclient commands and usually precede the command itself. Common global options include specifying the Patchwork instance URL or an API token.
--url URL
Specifies the base URL of the Patchwork instance to connect to. Overrides any configured default URL.
--token TOKEN
Provides the API authentication token for accessing the Patchwork instance. Required for most write operations or accessing private instances.
--project PROJECT_NAME
Sets the default project name to operate on for commands that support a project filter, such as list or series.
--no-verify
Disables SSL certificate verification when connecting to the Patchwork instance. Use with caution.
COMMAND
The specific operation to perform. Examples include list (to show patches), show (to display details of a specific patch), download (to fetch patch files), apply (to apply patches locally), series (to manage patch series), and config (to manage client configuration).
COMMAND_OPTIONS
Options specific to the chosen COMMAND. These vary widely depending on the command. For instance, list may have --state, --submitter, or --limit options.
ARGUMENTS
Positional arguments required by the COMMAND. For example, show and download commands typically require a patch or series ID as an argument.
DESCRIPTION
pwclient, often simply invoked as pw, is the official command-line interface for interacting with a Patchwork instance. Patchwork is a powerful, web-based system designed for tracking and managing software patches, widely used in large-scale open-source projects like the Linux kernel for collaborative development.
The pwclient utility empowers developers and maintainers to perform various patch-related operations directly from their terminal, eliminating the need to constantly navigate the web interface. It allows users to browse available patches, filter them by state or submitter, download individual patches or entire patch series, apply them locally, and check their status.
By providing a programmatic interface, pwclient streamlines common development workflows, such as fetching pending patches for review, automating patch application for testing, or quickly surveying the state of contributions to a project. It acts as a bridge between the local development environment and the remote Patchwork server, enhancing productivity in distributed development teams.
CAVEATS
pwclient is not a standard utility found in most Linux distributions by default. It typically requires manual installation, often via Python's pip package manager (e.g., `pip install patchwork-cli`).
Its functionality is entirely dependent on a running Patchwork web instance and the specific API version it exposes. Compatibility issues might arise between older pwclient versions and newer Patchwork server versions, or vice versa. Proper configuration, including the Patchwork URL and an API token (for authenticated operations), is crucial for its operation.
CONFIGURATION
pwclient typically stores its configuration in a file, often located at ~/.config/pwclient/config.ini. This file allows users to set default values for common options like the Patchwork instance URL (url) and API token (token), simplifying command invocation by not requiring these to be specified every time. The pwclient config command can be used to manage these settings directly.
AUTHENTICATION
For most interactive or modifying operations, especially when connecting to private Patchwork instances or performing actions like submitting patches, pwclient requires authentication. This is typically done using an API token, which can be generated from the user's profile settings within the Patchwork web interface. The token can be passed via the --token global option or configured in the config.ini file.
EXTENSIBILITY
As a Python-based tool, pwclient can often be extended or scripted by developers to automate complex patch management tasks beyond its built-in commands. Its integration with Python's ecosystem allows for custom scripts that leverage its capabilities alongside other development tools.
HISTORY
The pwclient command-line utility emerged as a crucial component of the broader Patchwork project, an initiative to provide a robust, web-based system for managing and tracking software patches. Its development began to address the need for a programmatic interface to interact with the Patchwork server, complementing the web user interface. This allowed developers to integrate patch management directly into their scripting and automation workflows, which is particularly vital for large open-source projects like the Linux kernel, where thousands of patches are submitted, reviewed, and applied. The pwclient's evolution closely mirrors the feature enhancements and API changes of the Patchwork platform itself, aiming to provide seamless integration and efficient patch lifecycle management from the command line.