Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing subtree commands #443

Open
TransGirlCodes opened this issue Jan 26, 2023 · 1 comment
Open

Implementing subtree commands #443

TransGirlCodes opened this issue Jan 26, 2023 · 1 comment

Comments

@TransGirlCodes
Copy link

I was looking to write an RStudio extension to help my colleages with some more advanced git use - namely subtree add etc, my first thought was to use sys to do git commands but then my second was - use library bindings which brought me to git2r. But I then found git subtree isn't implemented in gits libraries but as a script. So I thought to use the git2r to recreate the functionality of the script, but some commands such as git check-ref-format or git read-tree don't appear to be possible. I've seen functions such as git_index_read_tree in LibGit2 which seem like they may be what I'm looking for, but I don't think they're exposed to R either. Can someone more knowledgeable weigh in on what would be required?

@stewid
Copy link
Member

stewid commented Feb 2, 2023

In order to expose new functionality from libgit2 into git2r, one must add a C function that can be called from R which then in turn calls the function in libgit2. The file src/git2r.c lists all the functions that can currently be called from R. See, for example, src/git2r_branch.c for functions that implements branch functionality from libgit2. Pull requests are welcome if you are interested in implementing new functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants