<< All versions
Skill v1.0.1
currentAutomated scan100/100tjboudreaux/cc-plugin-perforce/tools-p4-changelist
1 files
──Details
PublishedOctober 27, 2026 at 09:14 PM
Content Hashsha256:6ad197529e0e5364...
Git SHA5aeaaacae04f
Bump Typepatch
──Files
Files (1 file, 8.4 KB)
SKILL.md8.4 KBactive
SKILL.md · 391 lines · 8.4 KB
name: tools-p4-changelist description: Perforce changelist management including creating, editing, moving files between changelists, and pending change workflows. metadata: version: "1.0.1"
Perforce Changelist Management
Overview
Changelists in Perforce group related file changes together for atomic submission. This skill covers creating, managing, and organizing changelists effectively.
When to Use
- Organizing work into logical units
- Separating multiple tasks in progress
- Preparing changes for code review
- Managing pending vs submitted changes
- Moving files between changelists
Core Concepts
Changelist Types
| Type | Description | |
|---|---|---|
| Default | Auto-created changelist for quick edits | |
| Numbered | Named changelist with description | |
| Pending | Not yet submitted | |
| Submitted | Already committed to depot | |
| Shelved | Changes stored on server, not submitted |
Creating Changelists
Create New Changelist
bash
# Create changelist (opens editor)p4 change# Create with description directlyp4 change -o | sed 's/<enter description here>/Fix player movement/' | p4 change -i# Create changelist and get numberCL=$(p4 change -o | sed 's/<enter description here>/My description/' | p4 change -i | grep -o '[0-9]*')echo "Created changelist: $CL"
Changelist Spec Format
Change: newClient: your_workspaceUser: your_usernameStatus: pendingDescription:Fix player movement bug- Fixed velocity calculation- Added ground check- Updated unit testsFiles://depot/project/Player.cs # edit//depot/project/Movement.cs # edit
Viewing Changelists
List Changelists
bash
# Your pending changelistsp4 changes -s pending -u $P4USER# All pending changelists for a pathp4 changes -s pending //depot/project/...# Recent submitted changelistsp4 changes -s submitted -m 20 //depot/project/...# Changelists by specific userp4 changes -u john.doe -m 10# Changelists in date rangep4 changes -s submitted @2024/01/01,@2024/01/31# Long output with full descriptionp4 changes -l -m 10 //depot/project/...
View Specific Changelist
bash
# View changelist detailsp4 describe 12345# View changelist without diffsp4 describe -s 12345# View changelist with shelved filesp4 describe -S 12345# View changelist specp4 change -o 12345
Editing Changelists
Modify Changelist Description
bash
# Edit changelist (opens editor)p4 change 12345# Update description programmaticallyp4 change -o 12345 | sed 's/old description/new description/' | p4 change -i
Change Changelist Owner
bash
# Admin operation - change ownerp4 change -o 12345 | sed 's/User:.*/User: new_owner/' | p4 change -i -f
Moving Files Between Changelists
Reopen Files to Different Changelist
bash
# Move single file to different changelistp4 reopen -c 12345 file.txt# Move file to default changelistp4 reopen -c default file.txt# Move all files from one changelist to anotherp4 reopen -c 12346 //...@=12345# Move files matching patternp4 reopen -c 12345 *.cs
Split Changelist
bash
# Create new changelist for some filesp4 change # Creates new CL, note the number# Move specific files to new changelistp4 reopen -c NEW_CL file1.txt file2.txt# Verify splitp4 opened -c 12345p4 opened -c NEW_CL
Merge Changelists
bash
# Move all files from CL2 to CL1p4 reopen -c 12345 //...@=12346# Delete empty changelistp4 change -d 12346
Default Changelist
Working with Default Changelist
bash
# See files in default changelistp4 opened -c default# Edit file to default changelistp4 edit file.txt# Move from default to numbered changelistp4 reopen -c 12345 file.txt# Submit only default changelistp4 submit# Move all default files to new changelistNEW_CL=$(p4 change -o | sed 's/<enter description here>/WIP: Feature X/' | p4 change -i | grep -o '[0-9]*')p4 reopen -c $NEW_CL //...@=default
Changelist Operations
Delete Changelist
bash
# Delete empty pending changelistp4 change -d 12345# Delete changelist with files (must revert or move files first)p4 revert -c 12345 //...p4 change -d 12345# Or move files then deletep4 reopen -c default //...@=12345p4 change -d 12345# Force delete (admin)p4 change -d -f 12345
Fix Submitted Changelist Description
bash
# Admin operation - fix description after submitp4 change -o 12345 | sed 's/typo/fixed/' | p4 change -i -f -u
Changelist Workflow Patterns
Feature Branch Pattern
bash
# Create changelist for featurep4 change -o | sed 's/<enter description here>/Feature: Player Dash Ability/' | p4 change -i# Note the changelist number (e.g., 12345)# All edits go to this changelistp4 edit -c 12345 Player.csp4 edit -c 12345 PlayerAbilities.csp4 add -c 12345 DashAbility.cs# Work on feature...# When ready, submitp4 submit -c 12345
Bug Fix Pattern
bash
# Quick fix to defaultp4 edit BuggyFile.cs# ... fix bug ...p4 submit -d "Fix: Null reference in PlayerController"
Multiple Tasks Pattern
bash
# Create changelist for each taskp4 change # CL for Task Ap4 change # CL for Task B# Work on Task Ap4 edit -c TASK_A_CL FileA.cs# Switch to Task Bp4 edit -c TASK_B_CL FileB.cs# Submit Task A when readyp4 submit -c TASK_A_CL# Continue Task B
Work In Progress Pattern
bash
# Create WIP changelistWIP_CL=$(p4 change -o | sed 's/<enter description here>/WIP: Do not submit/' | p4 change -i | grep -o '[0-9]*')# All experimental work goes herep4 edit -c $WIP_CL experimental.cs# When ready to submit, update descriptionp4 change $WIP_CL # Edit description, remove WIP# Submitp4 submit -c $WIP_CL
Querying Changelists
Search Changelists
bash
# Find changelists with keyword in descriptionp4 changes -l //depot/... | grep -B5 "player"# Find changelists affecting specific filep4 changes //depot/project/Player.cs# Find your changelists from last weekp4 changes -u $P4USER -s submitted @$(date -v-7d +%Y/%m/%d),@now# Count changelists per userp4 changes -s submitted -m 1000 //depot/project/... | awk '{print $6}' | sort | uniq -c | sort -rn
Changelist Statistics
bash
# Files in changelistp4 describe -s 12345 | grep "^\.\.\." | wc -l# Lines changed in changelistp4 describe 12345 | grep "^@@" | wc -l# File types in changelistp4 describe -s 12345 | grep "^\.\.\." | sed 's/.*#//' | sort | uniq -c
Integration with Workflows
Pre-Submit Checklist
bash
#!/bin/bashCL=$1# Check changelist has descriptionDESC=$(p4 change -o $CL | grep -A100 "Description:" | grep -v "Description:" | head -1)if [ -z "$DESC" ] || [ "$DESC" = " <enter description here>" ]; thenecho "ERROR: Changelist needs description"exit 1fi# Check for filesFILES=$(p4 opened -c $CL 2>/dev/null | wc -l)if [ "$FILES" -eq 0 ]; thenecho "ERROR: No files in changelist"exit 1fi# Check for unresolvedUNRESOLVED=$(p4 resolve -n //...@=$CL 2>&1 | grep -c "must resolve")if [ "$UNRESOLVED" -gt 0 ]; thenecho "ERROR: Unresolved files in changelist"exit 1fiecho "Changelist $CL ready to submit ($FILES files)"
Changelist Template
bash
# Create changelist with templatecat << 'EOF' | p4 change -iChange: newDescription:[TYPE]: Brief description## Changes- Change 1- Change 2## Testing- [ ] Unit tests pass- [ ] Manual testing done## Related- Jira: GOD-XXXXEOF
Best Practices
- Use numbered changelists for any non-trivial work
- Write descriptive descriptions - What and why
- One logical change per changelist - Atomic commits
- Don't mix refactoring with features - Separate CLs
- Prefix WIP changelists to prevent accidental submit
- Review before submit with
p4 describe -s - Keep changelists small - Easier review and rollback
- Use consistent naming - Team conventions
- Link to issue tracker in description
- Clean up empty changelists regularly
Troubleshooting
| Issue | Solution | |
|---|---|---|
| "Can't delete non-empty changelist" | Revert or move files first | |
| "Changelist unknown" | Check number, may be submitted | |
| "Can't edit submitted changelist" | Need admin -f flag | |
| Files in wrong changelist | Use p4 reopen -c | |
| Lost changelist number | p4 changes -s pending -u $USER | |
| Description too long | Some triggers limit length |