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

Expose setting workdir and detatched HEADs #377

Merged
merged 2 commits into from
Jun 27, 2014
Merged

Expose setting workdir and detatched HEADs #377

merged 2 commits into from
Jun 27, 2014

Conversation

oconnor663
Copy link
Contributor

A couple new features that I need for a tool I'm working on (https://github.com/oconnor663/peru). I'm totally new to libgit2, so I'm sure I made mistakes here.

The next thing I need to expose is git_merge_trees. I'd appreciate any advice for where that belongs.

@oconnor663
Copy link
Contributor Author

I think this failure repros in master with the latest updates from libgit2.

@jdavid
Copy link
Member

jdavid commented Jun 21, 2014

Hello, please rebase or merge against master, there are conflicts since we moved to libgit2 v0.21.0

Otherwise it looks good, just the second patch does not respect the 4 spaces indentation coding style.

@oconnor663
Copy link
Contributor Author

Rebased and fixed the style. I noticed in the docs it mentions that all APIs that take an Oid should also accept a hex string. What's the right way to make this work for Repository_head__set__?

@jdavid jdavid merged commit b190169 into libgit2:master Jun 27, 2014
@jdavid
Copy link
Member

jdavid commented Jun 27, 2014

Regarding git_merge_trees, I don't know much about that side of the code, maybe @carlosmn wants to comment.

@carlosmn
Copy link
Member

carlosmn commented Jul 3, 2014

git_merge_trees is a fairly low-level operation, which doesn't necessarily belong anywhere in particular. Since its first input parameter is the repository, we could hang if off there as Repository.merge_trees(), but it's not really a repository operation, so it would fit just as well as pygit2.merge_trees() which takes in a Repository as its first argument.

@jdavid
Copy link
Member

jdavid commented Jul 3, 2014

If it takes a repository, then I vote for Repository.merge_trees()

@oconnor663
Copy link
Contributor Author

I actually ended up going with TreeBuilder and manually merging things, because what I needed was more like the "refuse to overwrite entries that already existed in the original index file" behavior of git read-tree --prefix. I couldn't see a way to specify different merge algorithms for merge_trees. Any chance I missed something?

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

Successfully merging this pull request may close these issues.

3 participants