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

add git features #3

Open
2 of 4 tasks
edouard-lopez opened this issue Mar 1, 2019 · 2 comments
Open
2 of 4 tasks

add git features #3

edouard-lopez opened this issue Mar 1, 2019 · 2 comments

Comments

@edouard-lopez
Copy link
Owner

edouard-lopez commented Mar 1, 2019

  • Display git branch name v1.4.0
  • Display * when git repository is dirty v1.3.0
  • Display when branch is ahead
    (commits to push)
  • Display when branch is being
    (commits to pull)
@edouard-lopez
Copy link
Owner Author

See How to get count of unpublished commit with GitPython?

 repo.iter_commits('BRANCH..BRANCH@{u}')

@edouard-lopez
Copy link
Owner Author

edouard-lopez commented Mar 19, 2019

Check status of local Python relative to remote with GitPython

 commits_behind = repo.iter_commits('master..origin/master')

and

commits_ahead = repo.iter_commits('origin/master..master')

Then you can use something like the following to go from iterator to a count:

count = sum(1 for c in commits_ahead)

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

1 participant