Skip to content

Push changes to multiple branches at once #4

@ethangamma24

Description

@ethangamma24

Need to add functionality that allows users to push certain dotfile changes to multiple branches at once. This will necessitate a config file.

This is an insane doozy of a feature and it's going to take me a while to think about how to do this.

A rough gameplan I can think of is as follows:

  1. Identify branches in the config file that have files/directories that should be pushed to whenever those files/directories are updated in other branches
  2. Iterating over each branch, check to see if those files/directories were updated in the changes being pushed up.
  3. If so, copy them to somewhere on local storage, check out the branch to update, copy those files/directories into the local branch, then push up changes.

Example:
I have my desktop and cloud branches set to automatically sync in any changes made to my nvim/ directory from each other. When I update my nvim/ directory from the desktop branch, those changes should also automatically be applied to the cloud branch, leaving out any changes made to other parts of the desktop branch.

Rough draft config structure:

[sync]
cloud = { files = ["nvim/*"], branches = ["desktop"] }
desktop = { files = ["nvim/*"], branches = ["cloud"] }

Note: at this point I should probably just bite the bullet and switch to JSON for the config file. With how verbose some of these config options are, it's going to be gross to write out all in one line.

Relates to #28

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions