Replies: 2 comments 4 replies
-
Wow, that was fast! The
|
Beta Was this translation helpful? Give feedback.
-
I wonder if this actually belongs in a git helper package. Plucking a file or subtree out of git history is an obscure bit of git-fu, and there are plenty of non-targets related workflows for which it would be helpful to have something like Then |
Beta Was this translation helpful? Give feedback.
-
Help
Description
I've created a couple of functions to read previous versions of targets in cloud storage (e.g., AWS S3 versioning), using the git reference to look at git history and then download the appropriate cloud versions referenced in the
meta
file: https://gist.github.com/noamross/e05d3884b8ec8b4dce8380e24163851d .The purpose is to do comparison of objects across history without fully checking out to those project states. For instance, one could create a report of how model performance changes across commits or branches:
The approach is to:
_targets
(or other store directory) from git history into a temporary directory named for the SHA of that subtreetar_read()
ortar_load()
using the temporary directory as the store.One problem with this is, due to current limitations of
git2r
, themeta
file can be extracted from the git repo history, but not the binary (rds/qs/...) target object files. So this only works with targets that are stored on AWS or "file" type targets. I'd like it to work for cases where one commits target objects to git history directly. See ropensci/git2r#460 for what is needed to do this.Another limitation is if file targets need to be read in and compared, they lie outside the
_targets
/store directory. But I already have what I need to make atar_file_version("filename.txt", "HEAD~3")
that extracts the file and returns the temporary path to it. The binary issue still applies, though.Both of these could be fixed if, instead of the current approach, I use a
processx::run()
call to the CLI git to check out the whole repo or a subtree at a given commit to a temporary directory. I think this would be heavier, more fragile and complex across platforms or git versions, though, so I hope thegit2r
limitation can be fixed.I'm interested in some feedback:
tarchetypes
?Give it a go, and let me know what you think!
@emmamendelsohn @n8layman
Beta Was this translation helpful? Give feedback.
All reactions