Skip to main content

Git Branch Stacking Utility

Project description

Panqake - Git Branch Stacking Utility

Panqake is a CLI implementing the git-stacking workflow. It helps manage stacked branches, making it easier to work with multiple dependent pull requests.

Installation

  1. uv tool install panqake
    
  2. Dependencies:

    • gh: GitHub CLI (optional, only needed for PR creation)

Usage

Create a new branch in the stack

panqake new feature-login

This creates a new branch based on your current branch and tracks the relationship.

View the branch stack

panqake list

Displays a tree view of your current branch stack.

Update branches after changes

panqake update

After making changes to a branch, this command rebases all child branches to incorporate your changes and pushes the updates to remote branches, updating any associated PRs.

To skip pushing to remote, use the --no-push flag:

panqake update --no-push

Delete a branch and relink the stack

panqake delete feature-old

Deletes a branch and relinks its children to its parent, maintaining the stack structure.

Create PRs for the branch stack

panqake pr

Creates pull requests for each branch in the stack, starting from the bottom.

Modify/amend commits

# Amend the current commit with changes
panqake modify

# Amend with a new commit message
panqake modify -m "New commit message"

# Create a new commit instead of amending
panqake modify --commit -m "New feature commit"

This command lets you modify your current commit by amending it or create a new commit.

Update remote branch and PR

panqake update-pr

After modifying commits, this command updates the remote branch and any associated PR. It handles force pushing with safeguards when necessary.

Note: The update command now includes this functionality by default. Use update-pr if you only want to push changes without rebasing child branches.

Merge PRs and manage the stack

# Merge the current branch's PR
panqake merge

# Merge a specific branch's PR
panqake merge feature-branch

# Merge without deleting the local branch
panqake merge --no-delete-branch

# Merge without updating child branches
panqake merge --no-update-children

This command merges a PR using GitHub CLI and performs post-merge management:

  • Deletes the local branch after merge (optional)
  • Updates all child branches to use the new parent branch
  • Rebases child branches onto the new base
  • Updates PR base references for child PRs

Workflow Example

  1. Start a new feature stack from main:

    git checkout main
    panqake new feature-base
    
  2. Make your initial changes and commit.

  3. Create a dependent branch for additional work:

    panqake new feature-ui
    
  4. Make changes and commit in the feature-ui branch.

  5. If you need to update the feature-base branch:

    git checkout feature-base
    # Make changes and commit
    panqake update
    
  6. If you need to modify a commit:

    # Make changes to files
    panqake modify -m "Updated implementation"
    panqake update-pr  # To update the remote branch and PR
    
  7. Create PRs for your stack:

    panqake pr
    
  8. When a PR is approved and ready to merge:

    panqake merge feature-base
    

    This will merge the PR, delete the local branch, and update all child branches automatically.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Changelog

v0.1.1 (Unreleased)

  • Added merge command for merging PRs and managing the branch stack after merge
  • Added branch cleanup after successful merge
  • Added automatic rebasing of child branches after parent branches merge
  • Added updating of PR base references for child PRs
  • Added modify command for amending commits or creating new ones
  • Added update-pr command for updating remote branches and PRs
  • Improved force pushing with --force-with-lease for safety
  • Switched CLI interface from prompt_toolkit to questionary for improved user experience
  • Enhanced command-line prompts with better styling and autocomplete
  • Fixed styling issues in branch listing display
  • Improved output formatting for colored text
  • Added custom color scheme that works well on both light and dark terminals
  • Added documentation for the style system

v0.1.0

  • Initial release with core functionality
  • Branch stacking management
  • PR creation support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panqake-0.2.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panqake-0.2.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file panqake-0.2.0.tar.gz.

File metadata

  • Download URL: panqake-0.2.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.16

File hashes

Hashes for panqake-0.2.0.tar.gz
Algorithm Hash digest
SHA256 09e1f95a329ba878b5a986db95eff3f471378f4fbd3ef1f68ffa77d7aa922bc3
MD5 8f4d7a85b6a3e3a430f2ad6b8fdf3ce6
BLAKE2b-256 b7d6471fef47176fbb692ee154866676980e58e197ef21c6e8b31c0832ca7f69

See more details on using hashes here.

File details

Details for the file panqake-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: panqake-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.16

File hashes

Hashes for panqake-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2705f93ea9ee22de777cdcfa7912d6674ffc91dbc7ae9a14c47b4f315c4148d
MD5 cb72c127d45e6f3b9dfd5eb5b7805dee
BLAKE2b-256 f9a126652b1421fb67849820e19403538c1062afdef168e13a81faa049a4e713

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page