Skip to content

Feature request: More intuitive commands #901

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

Open
caleb15 opened this issue Aug 2, 2019 · 1 comment
Open

Feature request: More intuitive commands #901

caleb15 opened this issue Aug 2, 2019 · 1 comment

Comments

@caleb15
Copy link

caleb15 commented Aug 2, 2019

repo.create_head(branch_name) would be more intuitive as repo.create_branch(branch_name) or repo.branch.create(branch_name)

Merging a branch would be more intuitive as repo.merge(from=branch_name) instead of

# prepare a merge
master = cloned_repo.heads.master                         # right-hand side is ahead of us, in the future
merge_base = cloned_repo.merge_base(new_branch, master)   # allwos for a three-way merge
cloned_repo.index.merge_tree(master, base=merge_base)     # write the merge result into index
cloned_repo.index.commit("Merged past and now into future ;)",
                         parent_commits=(new_branch.commit, master.commit))

It would be nice if you could do repo.head.sha in addition to repo.head.commit.hexsha

Because of the above I switched to repo.git.gitCommand to access the git commands directly.

Thanks for making the gitpython library!

@Byron
Copy link
Member

Byron commented Aug 11, 2019

I am glad GitPython is useful to you!

I agree that the current API is cumbersome to some extend, which is due to GitPython itself being mostly on the level of 'plumbing'. The terms mentioned above as well as the ease at which one can do certain operations are usually implemented in porcelain only.

As GitPython is in maintenance mode, all quality of life improvements must be submitted as a PR, but I think it's OK to keep this issue for ideas.

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

No branches or pull requests

2 participants