Repository navigation
1.3.0
This release adds git cl prune, which tidies up changelists after files have been committed outside git-cl.
New: git cl prune
When you commit with plain git commit, or an IDE or AI assistant commits for you, the committed files stay in their changelist with nothing left to change. Files you delete and commit stay listed as [XX]. git cl prune cleans this up across all changelists in one go:
git cl add feature app.py util.py
git commit -m "Update app" app.py # plain Git commit
git cl prune # removes app.py, keeps util.py
- Removes files without changes (
[ ]) and files that no longer exist ([XX]). - Keeps every file that still has a Git status: modified, staged, deleted, untracked or conflicted.
- Deletes changelists that end up empty.
- Only changes changelist metadata, never file contents. Stashed changelists are not touched.
--dry-run(-n) shows what would be removed;--quiet(-q) suppresses the output.
git-cl never prunes on its own, because you may add a file to a changelist before you start editing it.
Optional: prune after every commit
To prune automatically, run git cl prune --quiet from a post-commit hook. With Git 2.54 or later:
git config --global hook.git-cl-prune.event post-commit
git config --global hook.git-cl-prune.command "git cl prune --quiet"
The hook does nothing during git cl commit, so git cl commit --keep works as before. See How do I keep changelists up to date automatically? for older Git versions and how to turn the hook off for a single repository.
Good to know
- Changelists are shared across branches, so a file that exists only on another branch shows as
[XX]and is pruned too. - Files excluded by
.gitignorehave no Git status either, so they are pruned as well.
Thanks to @patrickwolf for suggesting this in #55.
Pull requests
- Add
git cl pruneto remove stale changelist entries by @BHFock in #61 - Update version from 1.1.9 to 1.2.0 in RELEASING.md by @BHFock in #59
Full Changelog: 1.2.0...1.3.0