CLI Tool for sorting and managing Version Control Changelists efficiently. Interacts with popular IDE workspace files.
Project description
Changelist Sort
Making Sorting Changelist Files Easy!
Requirements
- Python 3.10 or higher.
- pip (or similar package manager).
- cli or bash capabilities.
Changelist Packages Overview
To make proper use of the sort tool, consider the data pipeline in the Changelist workflow.
Changelist Data Pipeline
- Changelist-Init
- Changelist-Sort
- Changelist-FOCI
In the Changelist Data Pipeline, information is obtained from git by the changelist-init package.
- This information is inserted into the default changelist.
- Changelist data is saved to
.changelists/data.xml, or aworkspace.xmlfile.
The Sort process runs after Init.
- Loads the
changelist-datastorage access object. - Checks InputData for sorting configuration.
- Applies sorting algorithm.
The FOCI process has sorted changelist data to format.
Underlying the whole data pipeline is the changelist-data package:
- Simplifying access to storage options.
- Minimizing duplication with reusable data containers and validation methods.
- Maximizing efficiency (and focus while working) in other Changelist packages.
Note: Add alias/shell funcs to your environment to maximize your efficiency!
alias sort-src='changelist-sort --sourceset-sort --remove-empty'
Workspace Data Pipeline
This data pipeline integrates with the workspace file in project config. It is an alternative to the Changelist Data Pipeline, storing data in a different location.
- One should use the Changelist Data Pipeline by default.
- Consider Workspace Data Pipeline experimental. To be used carefully.
To disable Workspace Overwrite Protection, add one of the following arguments to the command:
-wor--enable_workspace_overwrite--workspace_file
Project Sorting Configuration
To configure a changelist sorting patterns for your project:
- Run:
cl-sort --generate_sort_xmlto create.changelists/sort.xml - Edit Changelist Sorting Patterns
File Pattern Attributes
For each <files /> tag, apply ONE of the following attributes:
- file_ext : Match the file extension of the file. Do not include the dot.
- first_dir : The first directory in the path. Use empty string to match root directory.
- filename_prefix : The filename startswith this prefix.
- filename_suffix : The filename endswith this prefix.
- path_start : The beginning of the parent directory path. It's usually better to exclude unnecessary slash characters.
- path_end : The end of the parent directory path. It's usually better to exclude unnecessary slash characters.
Sorting Keys
The key attribute inside changelists is integrated directly with sorting. When defining your sorting configuration, prefer the name attribute, only use key when necessary.
- Sorting Keys are short, simple strings that identify a changelist.
- More than one Sorting Key can map to one Changelist.
- Every File pattern is associated with a Sorting Key.
Sorting Modes
There are two built-in sorting modes in addition to the sorting configuration.
- When
.changelists/sort.xmlis present, it takes precedence with fallback to Module Mode. - SourceSet Mode is activated by
-s.
Sorting By Module (default)
Files are sorted by the name of the top level directory they are located in.
- In Android-Gradle projects, each directory in the project root is a module, with a few exception cases.
- Often, projects contain support tools and frameworks in top level dirs.
- These get their own changelist if not gitignored.
Sorting By Source Set (Gradle, Android)
A specialized SortMode that splits Gradle Modules by their Source Sets.
- Add the
-sflag or--sourceset-sortto use this mode. - This mode is not compatible with SortXML Config.
- It is a quick and useful default for Gradle projects (beyond the Module).
Special Changelists & Directories
There are special Changelists, and special Directories that are handled differently.
- Build Updates Changelist
- Root Directory
- Gradle Directory
Build Updates Changelist:
This is a changelist that is used to collect all of the files that affect the project build.
This includes all files in the gradle directory, and any file that ends with the .gradle file extension. There are also Gradle files that end in .properties, which are also sorted into the Build Updates Changelist.
Root Directory:
The Root directory is special because the file paths are really short and do not contain a module name. Often, Root directory contains .gradle files which are sorted into the Build Updates Changelist. Any non-Gradle files in the Root directory are sorted into a special Changelist that may be called Root or Project Root.
Gradle Directory:
The Gradle Directory is a direct descendant of the Root directory, and may contain toml, gradle, or properties files. These are all sorted into the Build Updates Changelist.
Module Names and Sorting Comparisons
Changelist Names The name of the changelist must match the module, ignoring letter case and removing spaces.
Otherwise, a new Changelist will be created that matches the module name.
- Underscores are replaced with spaces.
- Each Word in the Name will start with an uppercase letter.
Remove Empty Changelists
You can remove all empty changelists after a sort has completed by adding the -r flag, or --remove-empty argument.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file changelist_sort-0.5.tar.gz.
File metadata
- Download URL: changelist_sort-0.5.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911387bd7dab90f2bbed9bb08ca7dd00dd874bf554bb62bb5c7214c003c8d436
|
|
| MD5 |
2bc32edfdd929abb0e968486a4f44ebe
|
|
| BLAKE2b-256 |
0558bf10e8e6cc8df6d33eea2bbc0718855c25e97e3903d745a656769b139cf2
|
Provenance
The following attestation bundles were made for changelist_sort-0.5.tar.gz:
Publisher:
publish.yml on DK96-OS/changelist-sort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
changelist_sort-0.5.tar.gz -
Subject digest:
911387bd7dab90f2bbed9bb08ca7dd00dd874bf554bb62bb5c7214c003c8d436 - Sigstore transparency entry: 785453491
- Sigstore integration time:
-
Permalink:
DK96-OS/changelist-sort@9733c9b5906e08f3b7e8d8bf36e98b9045bdf2c9 -
Branch / Tag:
refs/tags/v0.5 - Owner: https://github.com/DK96-OS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9733c9b5906e08f3b7e8d8bf36e98b9045bdf2c9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file changelist_sort-0.5-py3-none-any.whl.
File metadata
- Download URL: changelist_sort-0.5-py3-none-any.whl
- Upload date:
- Size: 40.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96fadc0330ff834c7d45643daac6df28ad2b1ac35c6686d7e0b06771e1d3f667
|
|
| MD5 |
70c4f2ed797685fb630835e64de49ece
|
|
| BLAKE2b-256 |
a16f54fce33c8565b7d51d7bad36f6ae8db09685908e037361d1542980e8e0c0
|
Provenance
The following attestation bundles were made for changelist_sort-0.5-py3-none-any.whl:
Publisher:
publish.yml on DK96-OS/changelist-sort
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
changelist_sort-0.5-py3-none-any.whl -
Subject digest:
96fadc0330ff834c7d45643daac6df28ad2b1ac35c6686d7e0b06771e1d3f667 - Sigstore transparency entry: 785453539
- Sigstore integration time:
-
Permalink:
DK96-OS/changelist-sort@9733c9b5906e08f3b7e8d8bf36e98b9045bdf2c9 -
Branch / Tag:
refs/tags/v0.5 - Owner: https://github.com/DK96-OS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9733c9b5906e08f3b7e8d8bf36e98b9045bdf2c9 -
Trigger Event:
release
-
Statement type: