Getting Repository Insights From Git

Getting Repository Insights From Git

GitHub has some cool features. One of the page on GitHub I usually go through when I come across any popular repository is itsΒ contributors page.

Checkout:Β https://github.com/duckduckgo/zeroclickinfo-goodies/graphs/contributors

 

From the above example, we can get to know many statistics like how the repository is growing, number of people contributing, number of commits they have made and lot more.

Apparently, my team uses a private repository on BitbucketΒ and Bitbucket don’t have anything like contributors page just like how we see above. Maybe because Bitbucket is mostly used by enterprises to host private repositories and they won’t have any external contributors. It makes sense GitHub having contributors page because it hosts 1000s of open source projects and has numerous contributors.

Since Bitbucket doesn’t have this feature, I thought of exploring some git commands to extract these statistics from my git repository. [Got one more opportunity to learn more about Git πŸ™‚ ]

To start with, I figured out how to find number of commits made by each developer.

$ git shortlog -s -n

This would give me a list of all the contributors with number of commits they have done.

To be continued…

Advertisements

Quack and Hack, Bangalore – 2

On 5th July 2015, 11 AM IST DuckDuckGo Bangalore Community hosted their 2nd meet-up and hackathon at the Mozilla community space.

duck_duck_go
DuckDuckGo

Quack & Hack are for developers interested in contributing to the DuckDuckGo search engine. The purpose of the meet-up is to code open source “Instant Answers” for a variety of search topics. These “Instant Answers” will help users find results in few or zero clicks. Some examples are instantly finding out , who’s in space right now, the best reese’s cookie recipes, or even a regex cheat sheet.

Compared to last meet-up there were more DuckDuckGo enthusiasts this time. (Around 30-40)
Since there were few who didn’t know about DuckDuckGo, Bibhas started with an introductory talk on DuckDuckGo, mentioning about all it’s features like instant answers, bangs, privacy.

duckduckhack-meetup
Housefull. πŸ™‚

I enjoyed the hackathon more since I had some previous experience on the building instant answers, I was helping other folks.
I also showed a live demo of building instant answers. It was gmail cheat sheet.

cheat-sheet-demo
Live demo of building Instant answer – cheat sheet.

This time we had some pizzas and soda at the break. πŸ˜›
After the break we continued hacking. By the end of the meet-up there were few folks who were able to send PR to DuckDuckGo. πŸ™‚
Also, even I completed my cheat sheet and sent the PR. πŸ™‚

Hacking on Instant answers.

At last we had a group picture. πŸ™‚

group
We didn’t had enough space inside, we came out just to take a group pic. πŸ™‚

Enjoyed a lot. Will be waiting for next DuckDuckHack meet-up. πŸ˜€

Mid-night git session at dgplug

I’m using git since few months. The world of git is too big. You have lot of things to explore in that.

One way to explore things in any technology or programming language is by solving the problems.

On #dgplug (Durgapur Linux Users’ Group) channel, someone had a problem with git.

The problem statement goes like this :

A person has made 4 commits and sent a pull request. Now, the owner of the GitHub repository is asking that person to remove the last 2 commits i.e commit number – 3 and commit number – 4. How can one remove the last 2 commits keeping first 2 commits as it is ?

Sayan was there to help in this problem. He took a hands-on session at that late night (It was around 11.45 p.m IST).

If you want to learn to solve this problem, just follow these instructions :

First we cloned this repository :

$ git clone https://github.com/kushaldas/pym/

As usual, you need to change your current directory to project directory, so hit :

$ cd pym

Now you are inside the project directory. We moved into code directory of the project. To do this, hit :

$ cd code

We added a new file called helloworld.py

After this, check the status of the git by executing :

$ git status

You will be able to see helloworld.py file name in red color under Untracked files. This tells that the file has not been tracked by the git.
Please remember this point as this is important.

Next do :

$ git diff

This will not show any changes as of now.

Now add this statement in argvtest.pyΒ  file :

print 'hello world'

Note : argvtest.py file is already present in the code directory

Now again, check the status of the git by executing :

$ git status

Can you see the changes now ?

We can see argvtest.py file in red color under modified files and hellowold.py file in red color under Untracked files.

Now do :

$ git diff

You can see the changes you have made. If you have added a new line you will be able see it in green color preceding with + (plus) symbol. If you have deleted a line you will be able see it in red color preceding with – (minus) symbol.

I hope you have completely understood till here. πŸ™‚

Now do :

$ git add argvtest.py

The argvtest.py file is now staged. To check this, do :

$ git status

You can see the color of the modified file i.e argvtest.py has been changed from red to green. This represent that the file has been staged and tracked by git.

Now do :

$ git diff

You don’t see nothing, because by default git diff shows whatever is there in modified.

Since we have nothing in modified area, it doesn’t show anything.

argvtest.py file is now staged and if you want to see the changes, do :

$ git diff --staged

This will show the changes in the staged area.

Note : $ git diff --staged and $ git diff --cached does same thing.

Now let’s commit this by doing :

$ git commit

This will open a text editor and you will see the text in there “Changes to be committed”.

Now write the commit message in the first line, then save and quit. (Lines starting with # will be ignored)

To see your commit, do :

$ git log

To see the changes made in the commit, do :

$ git log -p

There will be lot of commits, now do :

$ git reset --soft HEAD~1

$ git status

See the output. Understood what $ git reset --soft HEAD~1 did ?

Soft reset brings the changes to staged.

Now,

$ git reset HEAD argvtest.py

will bring into unstaged area as you can see in the output, it shows the file name under Unstaged changes.

HEAD is referred as the topmost commit in git just like tip is referred as the topmost commit in mercurial.

HEAD~1 takes 1 commit behind.
HEAD~2 takes 2 commit behind and so on…

Important note : If we do $ git reset --soft HEAD then we won’t loose the changes made in other commits which were removed.

I hope after reading this post you would have understood how to solve the above mentioned problem. πŸ™‚

Quack and Hack – Bangalore Meetup

Hola. πŸ™‚
This is a short blog post on our 1st Quack and Hack DuckDuckGo meet-up just to keep track of the progress.

I’m a big fan of Dax (mascot of DuckDuckGo). And that’s one of the reason why I’m writing this blog post. πŸ˜€

duck_duck_go

On May 12th, DuckDuckGo Community published a blog post, Hack your city – building a developers community all across the globe. They were looking for leaders from various regions to lead this meetup. I was excited by reading this, since it would help me to work together in group. πŸ™‚

On June 3rd, we had our 1st meetup at HasGeek House in Indranagar.

We had around 15 – 20 duckers( πŸ˜› ) at the place who very enthusiastic to know about DuckDuckGo. We started the session 6.00 – 6.30 p.m. Since most of them didn’t know much about DuckDuckGo, Bhibas showed us this video. This video highlights all the features of DuckDuckGo.

quack-hack-1

After this, Bhibas gave a live demo on how these instant works, showing examples like – who’s in space right now, reese’s cookie recipes, gimp cheat sheet etc. Few months ago even I had worked on an Instant Answer, this was the right time to show how it works and tell them it is easy to build instant answers on DuckDuckGo. An instant answer could be as simple as this – duckduckhack sagarhani, if you type duckduckhack followed by your GitHub user name it has to show like this :

duckduckhack-sagarhani

Some of the other examples of instant answers – gravatar, 3 + 3, time new delhi,etc. This instant answer sunrise in Delhi was built by Bibhas.

After watching all this, we were curious to know how these are build ?

We visited this page – DuckDuckHack . This page give the complete details on how various types of instant answers are built. Bibhas explained each of these various types of instant answers like Goodie, Spice, Fathead, Longtail. Also, we checked it’s code on their GitHub repository. We make use of perl language to build these instant answers. We inspected the code of various instant answers which were available on GitHub repository. He also spoke about submitting ideas for instant answers to the community before start working on it.

quack-hack-2

Now, we knew how these instant answers are build. So, we wanted to start building instant answers. Before that, it was required to setup the development environment for it. This page helps in do it. Setting-up development environment took some time since we had a bandwidth issue. However, by the end of the session we were able to do it. Since we were ready to code, we decided to have our next meet-up in first week of July and create some cool instant answers and make the search engine better!

Oops! I missed out mentioning about something. πŸ˜›
Yes. Swags. πŸ™‚ DuckDuckGo provides cool swags like T-shirts and Stickers. Sadly, Bibhas was not able to get it. 😦 He said he would definitely get some for our next meet-up. πŸ˜›

duckduckg0-swag

So, do NOT miss our next next meet-up at any cost. Also, since next meet-up would be for longer duration we would getting snacks too. πŸ˜›

P.S : I like DuckDuckGo more than Google. I had designed this few weeks ago, so that people will start using DuckDuckGo. #goGLUGgo

goGLUGgo_duckduckgo

Webmaker at Dayananda Sagar College of Engineering

Blog post by the Speaker of our Webmaker party! πŸ˜‰

What does the Fox say?

Having reached Bangalore on 30th (March) morning from Kannur, I must say that sleep was something that I yearned. But no! The mind and body wanted two different things, so the body finally compromised with coffee. Got to the office at around 10:30 am to notice that there was no one inside. Opened it myself and started working on the slides for the event(yes, just few hours before the event because that’s the way I roll). As I was preparing the slides, I dropped a text asking Sagar and Sam (the super hero event organizers) what time I should be startingΒ  from my office. I also had another Mozillian co-speaker, Shivika, who was supposed to reach on the venue since she was co-presenting. Status check with her and I figured that she already boarded the train.

The traffic sure decided to mess things but having taken their advice, I was…

View original post 367 more words

Mozilla Webmaker Party – DSCE Firefox Club

This was my dream event. πŸ˜€ You know why? All these days, I used to attend Webmaker parties organised in other Firefox Clubs. But, for the first time we organized it in our Club. πŸ™‚ Also this is our first Mozilla event in our club. πŸ˜€

Our department had a Technical fest “iRis“, we thought this would be the right time to start our club and conduct our first event. Just few days before our event we had a session on Bugzilla and FSA meet-up @MozSpaceBLR. I raised this topic to discuss with them regarding the planning and the executing of this event. They all pitched in few ideas to get started with our event.

I mailed the plan of our event to Shreyas Narayana Kutty (@dunebuggie) and invited him to come down here and talk about Mozilla mission,Β  How to contribute to mozilla?, webmaker tools, webmaker application on smartphone along with us. Sheyas without thinking anything, he just said YES, he would love to come here and take up this session.

webmaker-coming-soon
Mozilla Webmaker Party Cooming Soo… @ DSCE – Firefox Club.

As soon as he confirmed that he would come and take up this session we started to create a hype in our college by sharing the “Coming Soon…” poster across social medias. Students became very curious to know more about this since this was the first mozilla event in our college and the poster also contained the logo of Firefox and Mozilla Communities.

After few days we released the Final poster of the event which contained all the details regarding the event.

webmaker-final

Many students were bit confused since they didn’t knew about Webmaker tools. They started to ask us whether we have arranged a DJ to this party? πŸ˜€ πŸ˜€ πŸ˜€

I shared a video which I made few weeks before through PopcornMakerΒ  and also a screenshot of a webpage which I modified through X-ray Goggles. This was also our 2nd version of teaser to the event.

vtu

On 30th March, 2015.

Shreyas along with his friend shivika arrived at our college by 1.30 p.m. We started our session by 2.00 p.m. Shreyas spoke about Mozilla mission, How to contribute to Mozilla ? and about webmaker tools. He also showed them the demo of these Webmaker tools. He gave them a theme – ICC Cricket World Cup based on that students started to work on it. We gave them 60 minutes of time to complete there work. After this Shivika spoke about “WoMoz” to the students.

webmaker

Since this was the first time students were working on webmaker tools, they did quite well. We appreciated them by giving Firefox and Webmaker Stickers. YaY! They loved these awesome stickers.

At last but not the least, I would like to thank Shreyas and his co-spreaker Shivika for helping us in organizing this event. Also, My Mozilla Bangalore Community (@MozSpaceBLR) for all kind support. πŸ™‚

We would be coming up with more and more events like this in up-coming days!

#TeachTheWeb #RockTheWeb #Mozilla #Webmaker #MozIris