keith / git-pile

Stacked diff support for GitHub workflows
MIT License
148 stars 11 forks source link

Stop using hashes for cache dir #7

Closed keith closed 2 years ago

keith commented 2 years ago

This switches the cache paths to be derived from the repo's actual path instead of hashes to be more human discoverable. This uses the clone's path, relative to your $HOME (if it's contained within home), and replicates the structure in ~/.cache/git-pile.

In the case your repo is in a submodule, it uses the path to the submodule checkout where previously the hash actually would have been based on a git internal path.

Since only a single worktree is used even if you have multiple usable worktrees for a given repo, it adds a symlink in ~/.cache/git-pile from the sub-worktree checkout path, to the main clone directories path in ~/.cache/git-pile. This way you don't have to think about whether or not you're in the primary worktree or not when navigating in the cache.

keith commented 2 years ago

this doesn't currently work correctly with submodules. if you submit a PR for a repo in a submodule, and then for the containing repo, the repos aren't mirrored correctly

keith commented 2 years ago

I like the idea of this but am not sure what to do about submodules. closing for now