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

Example to show How to get Commit Date #927

Merged
merged 3 commits into from
Oct 11, 2018

Conversation

LeviMatus
Copy link
Contributor

@LeviMatus LeviMatus commented Oct 11, 2018

What does this change do?

Adds a small example of how to get at the date a commit took place.

Changes

doc/examples/Commit.rst

Adds a block of code that demonstrates how to get at a commit's date.

Motivation

This example is in the spirit of #874.

When I began using PyGithub it was not readily apparent to me where the commit date was being abstracted to. Being unfamiliar with Git's API, it took some convincing for me to be satisfied that the Commit.commit.author/committer.date path would get me the commit date.

I would hope that this would save somebody a little bit of time in the future.

How has this been tested?

I've built the docs locally and made sure the HTML is generated as expected.

Screenshots

2018-10-11 3

@sfdye
Copy link
Member

sfdye commented Oct 11, 2018

Simply awesome, kudos to building the docs locally for test evidence! One small suggestion, could you add a real example and print out the result, like what the other examples do?

@LeviMatus
Copy link
Contributor Author

@sfdye, good catch. I've updated the example.

Copy link
Member

@sfdye sfdye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@sfdye sfdye merged commit ac8966c into PyGithub:master Oct 11, 2018
candrikos pushed a commit to candrikos/PyGithub that referenced this pull request Sep 25, 2020
## What does this change do?
Adds a small example of how to get at the date a commit took place.

### Changes
#### doc/examples/Commit.rst
Adds a block of code that demonstrates how to get at a commit's date.

## Motivation
This example is in the spirit of PyGithub#874.

When I began using PyGithub it was not readily apparent to me where the commit date was being abstracted to. Being unfamiliar with Git's API, it took some convincing for me to be satisfied that the `Commit.commit.author/committer.date` path would get me the commit date.

I would hope that this would save somebody a little bit of time in the future.

## How has this been tested?
I've built the docs locally and made sure the HTML is generated as expected.

## Screenshots
![2018-10-11 3](https://user-images.githubusercontent.com/16039329/46782728-add4d980-ccfd-11e8-88dd-1e48be629eb5.png)
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.

None yet

2 participants