Basic versioning of GitHub repositories from within Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
35 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2
Hi everyone,

As part of my internship I am creating bindings to the GitHub API in Pharo.
As a prototype and demo, I have created a small tool last week to do some basic versioning, namely checking out a version, committing a version and showing a log of commits along with a branch tree.

Here’s a screenshot: http://i.imgur.com/iMfWOvp.png

The repository of the bindings and the tool is here: http://smalltalkhub.com/#!/~Balletie/GitHub
To load the tool into your image, execute:

(ConfigurationOfGitHub project version: #development) load: #tool

Keep in mind that this is tied to GitHub, since internally it uses the API. A nice side effect of this is that everything can be done in-memory. That is, there’s no local copy on the filesystem. One does not even need git installed.

That being said, feel free to take off with my prototype and make it work with e.g. the LibGit bindings in Pharo.

Known bug:
- When selecting a different repository from the dropdown while a version is also selected in the log, one gets a DNU. To work around this for the time being, just deselect the version before you switch repositories.

Let me know what you think and feel free to ask some questions.

Skip
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Ben Coman
On Mon, Nov 23, 2015 at 11:25 PM, Skip Lentz <[hidden email]> wrote:
> Hi everyone,
>
> As part of my internship I am creating bindings to the GitHub API in Pharo.

Sounds cool.  Do you mean the REST api?  Can you provide a link to the API docs?
cheers -ben

> As a prototype and demo, I have created a small tool last week to do some
> basic versioning, namely checking out a version, committing a version and
> showing a log of commits along with a branch tree.
>
> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png
>
> The repository of the bindings and the tool is here:
> http://smalltalkhub.com/#!/~Balletie/GitHub
> To load the tool into your image, execute:
>
> (ConfigurationOfGitHub project version: #development) load: #tool
>
> Keep in mind that this is tied to GitHub, since internally it uses the API.
> A nice side effect of this is that everything can be done in-memory. That
> is, there’s no local copy on the filesystem. One does not even need git
> installed.
>
> That being said, feel free to take off with my prototype and make it work
> with e.g. the LibGit bindings in Pharo.
>
> Known bug:
> - When selecting a different repository from the dropdown while a version is
> also selected in the log, one gets a DNU. To work around this for the time
> being, just deselect the version before you switch repositories.
>
> Let me know what you think and feel free to ask some questions.
>
> Skip

Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2

> On Nov 23, 2015, at 4:34 PM, Ben Coman <[hidden email]> wrote:
>
> On Mon, Nov 23, 2015 at 11:25 PM, Skip Lentz <[hidden email]> wrote:
>> Hi everyone,
>>
>> As part of my internship I am creating bindings to the GitHub API in Pharo.
>
> Sounds cool.  Do you mean the REST api?  Can you provide a link to the API docs?

Yes, the REST API. Here you go: https://developer.github.com/v3/
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Uko2
The project can be loaded like this:

Metacello new
        smalltalkhubUser: #Balletie project: #GitHub;
        configuration: #GitHub;
        version: #development;
        load: #tool

> On 23 Nov 2015, at 16:37, Skip Lentz <[hidden email]> wrote:
>
>
>> On Nov 23, 2015, at 4:34 PM, Ben Coman <[hidden email]> wrote:
>>
>> On Mon, Nov 23, 2015 at 11:25 PM, Skip Lentz <[hidden email]> wrote:
>>> Hi everyone,
>>>
>>> As part of my internship I am creating bindings to the GitHub API in Pharo.
>>
>> Sounds cool.  Do you mean the REST api?  Can you provide a link to the API docs?
>
> Yes, the REST API. Here you go: https://developer.github.com/v3/


Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Uko2
Is there any guide on how to use it? I’ve opened the tool, entered a username, left out the password field blank. Then I get nil exception because `self avatarUrl` of GHLoggedInUser returns nil.

Cheers.
Uko

> On 23 Nov 2015, at 16:42, Yuriy Tymchuk <[hidden email]> wrote:
>
> The project can be loaded like this:
>
> Metacello new
> smalltalkhubUser: #Balletie project: #GitHub;
> configuration: #GitHub;
> version: #development;
> load: #tool
>
>> On 23 Nov 2015, at 16:37, Skip Lentz <[hidden email]> wrote:
>>
>>
>>> On Nov 23, 2015, at 4:34 PM, Ben Coman <[hidden email]> wrote:
>>>
>>> On Mon, Nov 23, 2015 at 11:25 PM, Skip Lentz <[hidden email]> wrote:
>>>> Hi everyone,
>>>>
>>>> As part of my internship I am creating bindings to the GitHub API in Pharo.
>>>
>>> Sounds cool.  Do you mean the REST api?  Can you provide a link to the API docs?
>>
>> Yes, the REST API. Here you go: https://developer.github.com/v3/
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2

> On Nov 23, 2015, at 4:46 PM, Yuriy Tymchuk <[hidden email]> wrote:
>
> Is there any guide on how to use it? I’ve opened the tool, entered a username, left out the password field blank. Then I get nil exception because `self avatarUrl` of GHLoggedInUser returns nil.

Ah yes, that part might not be clear. The idea is that you can either enter a username and password, or enter an access token for the API and leave the password field blank. I wasn’t really sure how to convey that in the UI, perhaps this made it even more vague.

After you’ve entered the login details, the repositories you own are loaded into the dropdown list and a log is shown with the last 25 commits (yes, it’s limited to that for now).

One can then select a version and click checkout to load the packages listed on the right into the image. If all goes well you should see an arrow pointing at the currently loaded version in the list. After having done some changes, one can click commit which opens a Komitter window. (Committing is the least stable at the moment).

It would be nice to be able to select and checkout versions without having to enter your username and password, but at the moment that’s not supported..
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2
I just committed a fix for when opening a repository with more than 25 commits (which is basically any repository).
I already fixed this but did not commit it yet to the repository on smalltalkhub, oops.
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Peter Uhnak
In reply to this post by Skip Lentz-2
On Mon, Nov 23, 2015 at 04:25:28PM +0100, Skip Lentz wrote:

> Hi everyone,
>
> As part of my internship I am creating bindings to the GitHub API in Pharo.
> As a prototype and demo, I have created a small tool last week to do some basic versioning, namely checking out a version, committing a version and showing a log of commits along with a branch tree.
>
> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png <http://i.imgur.com/iMfWOvp.png>
>
> The repository of the bindings and the tool is here: http://smalltalkhub.com/#!/~Balletie/GitHub
> To load the tool into your image, execute:
>
> (ConfigurationOfGitHub project version: #development) load: #tool
>
> Keep in mind that this is tied to GitHub, since internally it uses the API. A nice side effect of this is that everything can be done in-memory.

Do you have any plans to eventually make a "Git Tool" out of it, rather
than GitHub Tool?

Why is it tied to GitHub in the first place? Are you planning to support
some github-specific features like issue tracker, etc? Because not being
able to have git repo localy is actually a hindrance and not a "nice
side effect" (unless of course you are using git as monticello).

Peter

Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Uko2
In reply to this post by Skip Lentz-2

> On 23 Nov 2015, at 16:55, Skip Lentz <[hidden email]> wrote:
>
>
>> On Nov 23, 2015, at 4:46 PM, Yuriy Tymchuk <[hidden email]> wrote:
>>
>> Is there any guide on how to use it? I’ve opened the tool, entered a username, left out the password field blank. Then I get nil exception because `self avatarUrl` of GHLoggedInUser returns nil.
>
> Ah yes, that part might not be clear. The idea is that you can either enter a username and password, or enter an access token for the API and leave the password field blank. I wasn’t really sure how to convey that in the UI, perhaps this made it even more vague.
>
> After you’ve entered the login details, the repositories you own are loaded into the dropdown list and a log is shown with the last 25 commits (yes, it’s limited to that for now).

Ok, when I enter a username and password, I get "receiver of asDateAndTime is nil” in #setDateAndTimeMapping:.

(should it work on Pharo 5?)

Cheers.
Uko

>
> One can then select a version and click checkout to load the packages listed on the right into the image. If all goes well you should see an arrow pointing at the currently loaded version in the list. After having done some changes, one can click commit which opens a Komitter window. (Committing is the least stable at the moment).
>
> It would be nice to be able to select and checkout versions without having to enter your username and password, but at the moment that’s not supported..


Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Uko2
In reply to this post by Peter Uhnak

> On 23 Nov 2015, at 17:31, Peter Uhnak <[hidden email]> wrote:
>
> On Mon, Nov 23, 2015 at 04:25:28PM +0100, Skip Lentz wrote:
>> Hi everyone,
>>
>> As part of my internship I am creating bindings to the GitHub API in Pharo.
>> As a prototype and demo, I have created a small tool last week to do some basic versioning, namely checking out a version, committing a version and showing a log of commits along with a branch tree.
>>
>> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png <http://i.imgur.com/iMfWOvp.png>
>>
>> The repository of the bindings and the tool is here: http://smalltalkhub.com/#!/~Balletie/GitHub
>> To load the tool into your image, execute:
>>
>> (ConfigurationOfGitHub project version: #development) load: #tool
>>
>> Keep in mind that this is tied to GitHub, since internally it uses the API. A nice side effect of this is that everything can be done in-memory.
>
> Do you have any plans to eventually make a "Git Tool" out of it, rather
> than GitHub Tool?
>
> Why is it tied to GitHub in the first place? Are you planning to support

I think that it’s tied to github because there are nice api. The goal is not to have a tool that helps you to work with git, but the one that allows you to browse git repos. This is a nice small project that can be a part of some larger one.

> some github-specific features like issue tracker, etc? Because not being
> able to have git repo localy is actually a hindrance and not a "nice
> side effect" (unless of course you are using git as monticello).
>
> Peter
>


Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2
In reply to this post by Peter Uhnak

> On Nov 23, 2015, at 5:31 PM, Peter Uhnak <[hidden email]> wrote:
>
> On Mon, Nov 23, 2015 at 04:25:28PM +0100, Skip Lentz wrote:
>> Hi everyone,
>>
>> As part of my internship I am creating bindings to the GitHub API in Pharo.
>> As a prototype and demo, I have created a small tool last week to do some basic versioning, namely checking out a version, committing a version and showing a log of commits along with a branch tree.
>>
>> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png <http://i.imgur.com/iMfWOvp.png>
>>
>> The repository of the bindings and the tool is here: http://smalltalkhub.com/#!/~Balletie/GitHub
>> To load the tool into your image, execute:
>>
>> (ConfigurationOfGitHub project version: #development) load: #tool
>>
>> Keep in mind that this is tied to GitHub, since internally it uses the API. A nice side effect of this is that everything can be done in-memory.
>
> Do you have any plans to eventually make a "Git Tool" out of it, rather
> than GitHub Tool?

Who knows, I like the idea of it. Again, it’s a prototype/demo/experiment of a versioning tool other than Monticello within Pharo. It didn’t take much time to create, so I decided to just try it out.

> Why is it tied to GitHub in the first place? Are you planning to support
> some github-specific features like issue tracker, etc? Because not being
> able to have git repo localy is actually a hindrance and not a "nice
> side effect" (unless of course you are using git as monticello).

For my project I needed to implement the API bindings to open pull requests. I saw this as another use case of the API and decided to experiment with it, that’s all really.
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2
In reply to this post by Uko2

> On Nov 23, 2015, at 5:32 PM, Yuriy Tymchuk <[hidden email]> wrote:
>
>
>> On 23 Nov 2015, at 16:55, Skip Lentz <[hidden email]> wrote:
>>
>>
>>> On Nov 23, 2015, at 4:46 PM, Yuriy Tymchuk <[hidden email]> wrote:
>>>
>>> Is there any guide on how to use it? I’ve opened the tool, entered a username, left out the password field blank. Then I get nil exception because `self avatarUrl` of GHLoggedInUser returns nil.
>>
>> Ah yes, that part might not be clear. The idea is that you can either enter a username and password, or enter an access token for the API and leave the password field blank. I wasn’t really sure how to convey that in the UI, perhaps this made it even more vague.
>>
>> After you’ve entered the login details, the repositories you own are loaded into the dropdown list and a log is shown with the last 25 commits (yes, it’s limited to that for now).
>
> Ok, when I enter a username and password, I get "receiver of asDateAndTime is nil” in #setDateAndTimeMapping:.
>
> (should it work on Pharo 5?)

Hmm yes it should work in Pharo 5. I didn’t get this error yet. Can you tell me what the receiver is of #setDateAndTimeMapping: when it occurs?
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Thierry Goubier
In reply to this post by Skip Lentz-2
Hi Skip,

this is interesting. It would mean the ability to handle github issues
querying/opening inside Pharo, no?

Thierry

Le 23/11/2015 16:25, Skip Lentz a écrit :

> Hi everyone,
>
> As part of my internship I am creating bindings to the GitHub API in Pharo.
> As a prototype and demo, I have created a small tool last week to do
> some basic versioning, namely checking out a version, committing a
> version and showing a log of commits along with a branch tree.
>
> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png
>
> The repository of the bindings and the tool is here:
> http://smalltalkhub.com/#!/~Balletie/GitHub
> To load the tool into your image, execute:
>
> (ConfigurationOfGitHub project version: #development) load: #tool
>
> Keep in mind that this is tied to GitHub, since internally it uses the
> API. A nice side effect of this is that everything can be done
> in-memory. That is, there’s no local copy on the filesystem. One does
> not even need git installed.
>
> That being said, feel free to take off with my prototype and make it
> work with e.g. the LibGit bindings in Pharo.
>
> Known bug:
> - When selecting a different repository from the dropdown while a
> version is also selected in the log, one gets a DNU. To work around this
> for the time being, just deselect the version before you switch
> repositories.
>
> Let me know what you think and feel free to ask some questions.
>
> Skip


Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2
In reply to this post by Uko2

> On Nov 23, 2015, at 5:32 PM, Yuriy Tymchuk <[hidden email]> wrote:
>
> Ok, when I enter a username and password, I get "receiver of asDateAndTime is nil” in #setDateAndTimeMapping:.

I also debugged this and it appears to be a corner case for some repositories where the “pushed_at” field is null for whatever reason.
I did a commit which should fix this (It just checks if the field is nil).
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Skip Lentz-2
In reply to this post by Thierry Goubier

> On Nov 23, 2015, at 6:32 PM, Thierry Goubier <[hidden email]> wrote:
>
> Hi Skip,
>
> this is interesting. It would mean the ability to handle github issues querying/opening inside Pharo, no?

Yes, if that part of the API is implemented. There are still a lot of extensions to be made.
I am planning to implement the bindings for pull requests in the near future.
Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Thierry Goubier
Le 23/11/2015 18:40, Skip Lentz a écrit :
>
>> On Nov 23, 2015, at 6:32 PM, Thierry Goubier <[hidden email]> wrote:
>>
>> Hi Skip,
>>
>> this is interesting. It would mean the ability to handle github issues querying/opening inside Pharo, no?
>
> Yes, if that part of the API is implemented. There are still a lot of extensions to be made.
> I am planning to implement the bindings for pull requests in the near future.

It would be very cool to be able to envision a git + pharo combination
where going on the github website wouldn't be necessary.

Creating and commenting on an issue directly from inside Pharo instead
of logging in fogbugz... Commenting on a commit from inside Pharo...

Would you be able to retrieve the same information from github that
GitFileTree does when it extract package version history information?

Thierry

Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Sven Van Caekenberghe-2
In reply to this post by Thierry Goubier
Yes, this is a cool project/approach.

I personally love it that it does not require a plugin and/or library that might not exist on all platforms.

Please keep going !

Sven

> On 23 Nov 2015, at 18:32, Thierry Goubier <[hidden email]> wrote:
>
> Hi Skip,
>
> this is interesting. It would mean the ability to handle github issues querying/opening inside Pharo, no?
>
> Thierry
>
> Le 23/11/2015 16:25, Skip Lentz a écrit :
>> Hi everyone,
>>
>> As part of my internship I am creating bindings to the GitHub API in Pharo.
>> As a prototype and demo, I have created a small tool last week to do
>> some basic versioning, namely checking out a version, committing a
>> version and showing a log of commits along with a branch tree.
>>
>> Here’s a screenshot: http://i.imgur.com/iMfWOvp.png
>>
>> The repository of the bindings and the tool is here:
>> http://smalltalkhub.com/#!/~Balletie/GitHub
>> To load the tool into your image, execute:
>>
>> (ConfigurationOfGitHub project version: #development) load: #tool
>>
>> Keep in mind that this is tied to GitHub, since internally it uses the
>> API. A nice side effect of this is that everything can be done
>> in-memory. That is, there’s no local copy on the filesystem. One does
>> not even need git installed.
>>
>> That being said, feel free to take off with my prototype and make it
>> work with e.g. the LibGit bindings in Pharo.
>>
>> Known bug:
>> - When selecting a different repository from the dropdown while a
>> version is also selected in the log, one gets a DNU. To work around this
>> for the time being, just deselect the version before you switch
>> repositories.
>>
>> Let me know what you think and feel free to ask some questions.
>>
>> Skip
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Uko2
In reply to this post by Skip Lentz-2
Hi Skip,

The receiver is GHRepository.

Cheers.
Uko

On 23 Nov 2015, at 17:46, Skip Lentz <[hidden email]> wrote:


On Nov 23, 2015, at 5:32 PM, Yuriy Tymchuk <[hidden email]> wrote:


On 23 Nov 2015, at 16:55, Skip Lentz <[hidden email]> wrote:


On Nov 23, 2015, at 4:46 PM, Yuriy Tymchuk <[hidden email]> wrote:

Is there any guide on how to use it? I’ve opened the tool, entered a username, left out the password field blank. Then I get nil exception because `self avatarUrl` of GHLoggedInUser returns nil.

Ah yes, that part might not be clear. The idea is that you can either enter a username and password, or enter an access token for the API and leave the password field blank. I wasn’t really sure how to convey that in the UI, perhaps this made it even more vague.

After you’ve entered the login details, the repositories you own are loaded into the dropdown list and a log is shown with the last 25 commits (yes, it’s limited to that for now).

Ok, when I enter a username and password, I get "receiver of asDateAndTime is nil” in #setDateAndTimeMapping:.

(should it work on Pharo 5?)

Hmm yes it should work in Pharo 5. I didn’t get this error yet. Can you tell me what the receiver is of #setDateAndTimeMapping: when it occurs?

Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

Dale Henrichs-3
In reply to this post by Skip Lentz-2
Very interesting ... if you put your project up on github, I would fork it and port it to tODE as this is something that has been on my todo list for awhile:)

Dale

On 11/23/2015 07:25 AM, Skip Lentz wrote:
Hi everyone,

As part of my internship I am creating bindings to the GitHub API in Pharo.
As a prototype and demo, I have created a small tool last week to do some basic versioning, namely checking out a version, committing a version and showing a log of commits along with a branch tree.

Here’s a screenshot: http://i.imgur.com/iMfWOvp.png

The repository of the bindings and the tool is here: http://smalltalkhub.com/#!/~Balletie/GitHub
To load the tool into your image, execute:

(ConfigurationOfGitHub project version: #development) load: #tool

Keep in mind that this is tied to GitHub, since internally it uses the API. A nice side effect of this is that everything can be done in-memory. That is, there’s no local copy on the filesystem. One does not even need git installed.

That being said, feel free to take off with my prototype and make it work with e.g. the LibGit bindings in Pharo.

Known bug:
- When selecting a different repository from the dropdown while a version is also selected in the log, one gets a DNU. To work around this for the time being, just deselect the version before you switch repositories.

Let me know what you think and feel free to ask some questions.

Skip

Reply | Threaded
Open this post in threaded view
|

Re: Basic versioning of GitHub repositories from within Pharo

abergel
In reply to this post by Uko2
Thanks Uko for trying

Alexandre


> Le 23 nov. 2015 à 13:32, Yuriy Tymchuk <[hidden email]> a écrit :
>
>
>> On 23 Nov 2015, at 16:55, Skip Lentz <[hidden email]> wrote:
>>
>>
>>> On Nov 23, 2015, at 4:46 PM, Yuriy Tymchuk <[hidden email]> wrote:
>>>
>>> Is there any guide on how to use it? I’ve opened the tool, entered a username, left out the password field blank. Then I get nil exception because `self avatarUrl` of GHLoggedInUser returns nil.
>>
>> Ah yes, that part might not be clear. The idea is that you can either enter a username and password, or enter an access token for the API and leave the password field blank. I wasn’t really sure how to convey that in the UI, perhaps this made it even more vague.
>>
>> After you’ve entered the login details, the repositories you own are loaded into the dropdown list and a log is shown with the last 25 commits (yes, it’s limited to that for now).
>
> Ok, when I enter a username and password, I get "receiver of asDateAndTime is nil” in #setDateAndTimeMapping:.
>
> (should it work on Pharo 5?)
>
> Cheers.
> Uko
>
>>
>> One can then select a version and click checkout to load the packages listed on the right into the image. If all goes well you should see an arrow pointing at the currently loaded version in the list. After having done some changes, one can click commit which opens a Komitter window. (Committing is the least stable at the moment).
>>
>> It would be nice to be able to select and checkout versions without having to enter your username and password, but at the moment that’s not supported..
>
>

12