Crates.io | gimic |
lib.rs | gimic |
version | 0.1.33 |
source | src |
created_at | 2023-07-29 20:21:48.718023 |
updated_at | 2023-08-18 15:01:44.630798 |
description | The solution for maintaining borrowed directories/files in remote repos |
homepage | |
repository | https://github.com/Antsthebul/gimic |
max_upload_size | |
id | 929472 |
size | 34,312 |
Mimic Git with added functionality
Nested repo code updates
repo 1 <Main_repo>
|
|- /some/cool/file/from/repo2
Easily manage specific files/directories from other repos "remotely".
Make sure you have git
installed, and your working in a git repo
Build from source
i. After downloading the source code, run cargo build --release
ii. [Optional] Add file location of the release to system PATH
Gimic was designed to miMIC GIt, where although submodules
and subtree
are great options for including another repo into your project, you may want a little bit more granular control of what file(s) are actually pulled in and are sitting in your local directory/workspace. Using gimic
only affects your repo where the file will appear untracked (as any new file would) so it may be a good idea to update your .gitignore file or .git/exclude
Create a gloc.yaml file in the root of your poject
repo 1
|
|-gloc.yaml
If you applied installation step 2.ii, this can be run anywhere within a nested .git directory, otherwise the target build directory will need to exist within the desired "root" repo.
$ gimic checkout
This is is just a wrapper around git pull
and cp <source> <to>
. Specifying just the action only , ie. checkout
, and no other args means that a yaml file configuration exists somehwere in the execution path (ie. the place where you've called gimic
) and that when the alternate_repo is pulled down, the files will be copied from the alternate_source
to the alternate_target
. Note that at least one of the locations needs to exists, and if only one of either option does exists, this will be the default for the other option. Meaning (super simple psudo-ish code Rust) !alternate_source { alternate_target = alternate_source } (and vice versa)
. NOTE: This is currently not enforced, but will be in later versions.
File copying resembles, like Linux, where target "type" is based off of "source" type. Meaning if "source" ie (alternate_source
) is a file, "target" will be a file (regardless if it contains a designated extension). But if "source" is a directory, then target will be a direct( even IF it has a file designation). Another thing to note is that recursive file creation is standard with the checkout
command. Similar to mkdir -R
in Linux
When gimic's checkout process completes. The temporary repo( aka. alternate_repo
) is removed, unless otherwise specified within gloc.yaml configuration
$ gimic --[no-]skip-worktree target_dir
Because git update-index --skip-worktree <some_file>
does not handle directories, rather than needing to create some wicked one line code snippet, you can turn on/off the git's tracking (temporarily like original command)
Feel free to commment in the repo and let me know if you have any other suggestions or want to contribute!