<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>levi &#8211; redpanthers.co</title>
	<atom:link href="/author/levi/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Red Panthers - Experts in Ruby on Rails, System Design and Vue.js</description>
	<lastBuildDate>Mon, 29 Apr 2019 11:28:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.7</generator>
	<item>
		<title>Rails 5.2.0</title>
		<link>/rails-5-2-0/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:12 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rails 5]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16152</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[

<p class="western" align="justify"><span style="font-size: large">Cheers everyone, the new Rails 5.2.0 has released. Let’s have a look at the new features and upgrades in it.</span></p>




<p class="western" align="justify"><span style="font-size: large">It’s been too hard to deal with file uploads in Rails. T</span><span style="font-size: large">here’s been a lot of fine plugins available, but it was overdue that we incorporated something right into the framework. Finally, we have one, in the form of <a href="https://github.com/rails/rails/blob/d3893ec38ec61282c2598b01a298124356d6b35a/activestorage/README.md">Active Storage</a></span><span style="font-size: large">. This release includes Active Storage, a new framework provided by Rails to make it easier to upload and process files. With this new framework, we’ve solved for the modern approach of uploading files straight to the cloud. Out of the box, there’s support for Amazon’s S3, Google’s Cloud Storage, and Microsoft Azure Cloud File Storage. If you’re dealing with images, you can create variants on the fly. If you’re dealing with videos or PDFs, you can create previews on the fly. And regardless of the type, you can analyze uploads for metadata extraction asynchronously. This framework is not only used in production, but it is born for production.</span></p>




<p class="western" align="justify"><span style="font-size: large">There’s a sparkling new <a href="https://github.com/rails/rails/pull/31134">Redis Cache Storage</a> that incorporates general partial, fragment, and other Rails caching jobs into a cohesive unit that anyone can use.</span></p>


<span style="font-size: large">This new Redis Cache Store supports Redis::Distributed, for Memcached-like sharding across Redises. It’s fault tolerant, so will treat failures like misses, rather than kill the request with an exception. It even supports distributed MGETs for that full partial collection caching goodness.</span>


<h3 class="western" align="justify"></h3>




<p class="western" align="justify"><span style="font-size: large">Rails 5.2.0 has Added support for PostgreSQL operator classes to </span><code class="western"><span style="font-size: large">add_index.
</span></code><span style="font-size: large">The operator classes identify database operators to be used by the index for the columns. You can assign the same operator to all columns, or not. It currently only supports PostgreSQL.</span>


<p class="western" align="justify"><span style="font-size: large">Added ability to create PostgreSQL foreign keys without validation. Normally, PostgreSQL verifies that all rows in a table satisfy its foreign keys constraints. With this option, you can create these constraints without the overhead of checking if they are valid.</span></p>




<p class="western" align="justify"><span style="font-size: large">Rails 5.2.0 also has embraced the cherry of HTTP/2 with early hints. This means we can automatically instruct the web server to send required style sheet and JavaScript assets early. This means a faster page delivery.</span></p>




<p class="western" align="justify"><span style="font-size: large">On the topic of performance, Rails now ships with <a href="https://github.com/Shopify/bootsnap">Bootsnap</a> in the default </span><code class="western"><span style="font-size: large">Gemfile</span></code><span style="font-size: large">. This generally reduces application boot times by over 50%.</span></p>




<p class="western" align="justify"><span style="font-size: large"> CSRF and XSS have enhanced that further in Rails 5.2 with the addition of a new DSL that allows you to configure a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy">Content Security Policy</a> for your application. We can configure a global default policy and then override it on a per-resource basis and even use lambdas to inject per-request values into the header such as account subdomains in a multi-tenant application.</span></p>




<p class="western" align="justify"><span style="font-size: large">In Rails 5.2, we’ve rectified the mess by deprecating the two different kinds of secrets and introduced a new shared concept called <a href="https://github.com/rails/rails/pull/30067">Credentials</a>. Credentials, like AWS access keys and other forms of logins and passwords, were the dominant use case for secrets. </span><span style="font-size: large">Credentials are always encrypted. This means they’re safe to check into revision control, as long as you keep the key out of it. This means atomic deploys and there is no need to mess with environment variables.</span></p>




<p class="western" align="justify"><span style="font-size: large">Since Rails 5.1, we’ve also made great strides with <a href="https://github.com/rails/webpacker">Webpacker</a>. So Rails 5.2 is meant to pair beautifully with the new Webpacker 3.0 release. Rails have fully embraced modern JavaScript with a pre-configured build pipeline run by Webpack. We keep strengthening that relationship.</span></p>




<p class="western" align="justify"><span style="font-size: large">Thanks again to everyone who continue to pour their love and support into Ruby on Rails! Happy Coding.</span></p>

]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Setting up your own private GIT server</title>
		<link>/setting-up-your-own-private-git-server/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16369</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
&nbsp;
Companies like Github and Gitlab provides code hosting services based on Git. There are over 10 million people who are hosting their codes on these services. There are few limitations while using these services. One of them is restrictions of using private repositories while using the free services. One of the way to overcome this is we hosting git on our own server. By means of this, we also get more control over the server.
&nbsp;
To get started, first add a <strong>git</strong> user and a <strong>.ssh</strong> directory for the user. Follow the commands given below.


<pre class="lang:default decode:true ">$ sudo adduser git
$ su git
$ cd
$ mkdir .ssh &amp;&amp; chmod 700 .ssh
$ touch .ssh/authorized_keys &amp;&amp; chmod 600 .ssh/authorized_keys</pre>


&nbsp;
Let&#8217;s add some <strong>SSH</strong> keys to the <strong>authorized_keys </strong>file for the <strong>git </strong>user. They should be like


<pre class="lang:default decode:true ">$ cat /tmp/id_rsa.john.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCB007n/ww+ouN4gSLKssMxXnBOvf9LGt4L
ojG6rs6hPB09j9R/T17/x4lhJA0F3FR1rP6kYBRsWj2aThGw6HXLm9/5zytK6Ztg3RPKK+4k
Yjh6541NYsnEAZuXz0jTTyAUfrtU3Z5E003C4oxOj6H0rfIF1kKI9MAQLMdpGW1GYEIgS9Ez
Sdfd8AcCIicTDWbqLAcU4UpkaX8KyGlLwsNuuGztobF8m72ALC/nLF6JLtPofwFBlgc+myiv
O7TCUSBdLQlgMVOFq1I2uPWQOkOWQAHukEOmfjy2jctxSDBQ220ymjaNsHT4kgtZg2AYYgPq
dAv8JggJICUvax2T9va5 gsg-keypair
</pre>


&nbsp;
We now append them to the <strong>git</strong> user’s <strong>authorized_keys</strong><code></code>file in its <strong>.ssh</strong> directory.


<pre class="lang:default decode:true ">$ cat /tmp/id_rsa.john.pub &gt;&gt; ~/.ssh/authorized_keys
$ cat /tmp/id_rsa.josie.pub &gt;&gt; ~/.ssh/authorized_keys
$ cat /tmp/id_rsa.jessica.pub &gt;&gt; ~/.ssh/authorized_keys</pre>


&nbsp;
We can now set up an empty repository by running <strong>git init</strong> with the <strong>&#8211;bare</strong> option, which initializes a repository without a working directory.


<pre class="lang:default decode:true ">$ cd /srv/git
$ mkdir project.git
$ cd project.git
$ git init --bare
Initialized empty Git repository in /srv/git/project.git/</pre>


&nbsp;
Now one can push their first version of their project into that repository by adding it as a remote and pushing up a branch. We can now use a hostname of the server in which we have set up <strong>git</strong> user and repository.


<pre class="lang:default decode:true ">$ cd myproject
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin git@gitserver:/srv/git/project.git
$ git push origin master</pre>


&nbsp;
Now, others can clone the directory and push back the changes.


<pre class="lang:default decode:true ">$ git clone git@gitserver:/srv/git/project.git
$ cd project
$ vim README
$ git commit -am 'fix for the README file'
$ git push origin master</pre>


&nbsp;
We can restrict a user to have only <strong>git </strong>related activitis using a shell tool called <strong>git-shell</strong>. If we set the shell to a user&#8217;s login shell, he cannot have normal usage. To use, specify the <strong>git-shell</strong> instead of bash or csh for your user’s login shell.First add <strong>git-shell </strong>to <strong>/etc/shells</strong> if it does not exist.


<pre class="lang:default decode:true">$ cat /etc/shells   # see if `git-shell` is already in there.  If not...
$ which git-shell   # make sure git-shell is installed on your system.
$ sudo vim /etc/shells  # and add the path to git-shell from last command</pre>


&nbsp;


<div class="paragraph">
Now you can edit the shell for a user using <code>chsh &lt;username&gt; -s &lt;shell&gt;</code>:
</div>




<div class="listingblock">


<div class="content">


<pre class="highlight"><code class="language-console" data-lang="console">$ sudo chsh git -s $(which git-shell)</code></pre>


</div>


</div>




<div class="paragraph">
Now, the <code>git</code> user can only use the SSH connection to push and pull Git repositories and can’t shell onto the machine. If you try, you’ll see a login rejection like this.
</div>




<pre class="lang:default decode:true ">$ ssh git@gitserver
fatal: Interactive git shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.
Connection to gitserver closed.</pre>


&nbsp;
If you are in need of higher control over your git repositories, setup your own private git server.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Gitk</title>
		<link>/gitk/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16366</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
&nbsp;
A newcomer moving to git could be difficult. For a newcomer, understanding the concept of commit, checkout, branches, rebase etc could be really hard. <strong>gitk</strong> is a command that is used for visualizing the commit graph and displaying all the history of the commits made and the information of files in the trees of each revision made. <strong>gitk</strong> is a very powerful GUI tool which is very handy to the command line ignorant.
&nbsp;
To get started with <strong>gitk</strong>, we need to install it first.
For Ubuntu users, follow the commands given below.


<pre class="lang:default decode:true ">sudo apt-get update
sudo apt-get install gitk</pre>


To get installed in Mac, follow these commands.


<pre class="lang:default decode:true ">/usr/local/bin/git
brew doctor
brew update
brew install git
which git</pre>


&nbsp;
To bring up the <strong>gitk</strong> interface, run the command.


<pre class="lang:default decode:true ">gitk</pre>


Here is a sample <strong>gitk</strong> interface.
<img class="alignnone size-medium wp-image-16367" src="http://redpanthers.co/wp-content/uploads/2018/09/gitk-300x217.png" alt="" width="300" height="217" />
&nbsp;
The entire history of commits is shown in the GUI interface. The current head, the local branches, the commit message and who committed the messages are displayed. We can see the date and who committed the changes. Also, the files changed can be viewed.
&nbsp;
<strong>gitk</strong> is very helpful for beginners who are not used to command line interface.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Git gc</title>
		<link>/git-gc/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16363</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
&nbsp;
As we keep on continuously working on <strong>git</strong>, lots of garbage like file revisions and unreachable objects get accumulated in the <strong>.git</strong> folder. On large repositories and long-term projects, this affects both the operating performance as well as the disk space utilization. Hence, to clean up the garbage, we have the git garbage collector, <strong>git gc</strong>.
To clean up the garbage, we run the git command


<pre class="lang:default decode:true ">git gc</pre>


<strong>git gc</strong> will not affect the remote repository. This will just optimize the local repository. Hence, we can run <strong>git gc</strong> in any repositories. Users are encouraged to run <strong>git gc </strong>on a regular basis to keep the repositories clean and the to enhance the performance.
&nbsp;
If we want a deeper cleaning, we can run the <strong>&#8211;aggressive</strong> option.


<pre class="lang:default decode:true ">git gc --aggressive</pre>


This takes a longer time to run but is more effective than normal garbage collection. This option is not required to run often.
&nbsp;
We have an option to check if housekeeping is required or not. We run the <strong>&#8211;auto</strong> option for this. If no housekeeping is required, the command exits without performing any action.


<pre class="lang:default decode:true ">git gc --auto</pre>


If we need to prune all objects before a particular date, we can use the following command


<pre class="lang:default decode:true ">git gc --prune=&lt;date&gt;</pre>


If we need to prune all objects irrespective of the date, we can use


<pre class="lang:default decode:true ">git gc --prune=all</pre>


If we do not need to prune, we can use the following command


<pre class="lang:default decode:true ">git gc --no-prune</pre>


We can force for a garbage collection to run even while another <strong>git gc</strong> is running by forcing it like the given syntax


<pre class="lang:default decode:true ">git gc --force</pre>


&nbsp;
&nbsp;
<strong>git gc</strong> is very helpful in keeping our local repositories clean and a better performance of our hard disks.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Git Prune</title>
		<link>/git-prune/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16360</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
&nbsp;
After merging the branches, we sometimes do not delete the branches. Even if we delete in the remote server, the branches exist in the local. We use <strong>git prune</strong> to remove the unwanted branches from the local or the remote server. <strong>git prune</strong> removes the references of the branches we do not use anymore.
&nbsp;
Usually, there are 3 kinds of branches that we need to clean up.


<ul>
 	

<li>The local branches in which we do our day to day working.</li>


 	

<li>The reference to the remote branches which we use for naming branches</li>


 	

<li>The branches on the remote server</li>


</ul>


&nbsp;
To remove the unwanted branches from the local, run the command as in the following syntax.


<pre class="lang:default decode:true ">git branch -D branch_name</pre>


To clean up the reference objects, run the command of the following syntax


<pre class="lang:default decode:true ">git remote prune reference_name</pre>


To delete the unwanted remote branches, run the command


<pre class="lang:default decode:true ">git push origin --delete branch-name</pre>


&nbsp;
<strong>Git prune</strong> comes in handy when it comes to keeping the repository neat and clean. Cleaning up the unwanted branches keeps the repository neat.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Git Rebase</title>
		<link>/git-rebase/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16357</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
&nbsp;
Git rebasing is the process of combining a series of commits to a new base commit. Rebasing is easily implemented and visualized in the context of a branching workflow. Git rebasing is changing the base of your branch from one commit to another making it appear that we created the branch from another commit. This is done by creating a new commit and applying to the specified base.
&nbsp;
The main reason to rebase is to keep a linear project history. Let's take a small example. Imagine that the master has branch has progress than what we started in the feature branch. We need to have the latest updates from the master branch to the feature branch, but we need a clean history of commits. For this purpose, we do rebase the feature branch with the master branch. Now, the feature branch will have the updates of the master, just as we created the branch from the master.
Assume that currently, I am at my feature branch. I want to rebase it with my master. I can do this by running the command


<pre class="lang:default decode:true ">git rebase master</pre>


or


<pre class="lang:default decode:true">git rebase master feature_branch</pre>


&nbsp;
There are two ways to integrate the feature branch with the master, that is merging directly and rebasing and then merging. Merging directly results in a 3-way merge and has a merge commit. Rebasing and merging is a fast-forward merge and a perfect commit history.
&nbsp;
Having a clean commit history is good, especially when it comes to finding bugs. Imagine a bug occurs in the code and the developer could not track where the bug was introduced using <strong>git log</strong>. Now, he may run <strong>git bisect</strong> to find the bad commit. Because the commit history is clean, the <strong>git bisect</strong> has a refined set of commits to work on. This helps the developer to find the bug faster.
&nbsp;
We can run <strong>git rebase</strong> in an interactive mode by either giving the option <strong>-i</strong> or <strong>&#8211;interactive</strong>


<pre class="lang:default decode:true ">git rebase --interactive</pre>


This triggers the interactive mode. Interactive mode means we can play with the commits. Instead of the standard rebase, which moves all the commits blindly, the interactive commit let us alter with the commits. We can choose the commits we need, keeping the history cleaner. We can pick the commit, alter the commit, squash or discard the commit.
&nbsp;
Rebasing is a very helpful way to integrate your branches while keeping your commit history clean, which helps while debugging.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Git Bisect</title>
		<link>/git-bisect/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16355</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
&nbsp;
Sometimes finding a bad commit is tedious and time consuming. We have to check commit by commit to find a bug in our code. We have to start from the oldest commit, check if the bug exists there, and if not, check the next newer commit.This goes on until we find the commit that caused the bug. This approach is slow and painstaking. Using <strong>git bisect</strong>, we can find the bad commit much easier.
&nbsp;
<strong>git bisect</strong> is a git command used to find the commit that introduced a bug in your code. We mention a  good commit where there was no bug and also a bad commit where we noticed the bug. <strong>git bisect</strong> picks a commit in between and asks if the commit is good or bad. This goes on till we find the bad commit. <strong>git bisect</strong> works just as a binary search does.
&nbsp;
To get started with <strong>git bisect</strong>, we run the command


<pre class="lang:default decode:true ">git bisect start</pre>


Now, we add the good commit. The syntax is


<pre class="lang:default decode:true ">git bisect good commit_id</pre>


Then, we add the bad commit as the following syntax.


<pre class="lang:default decode:true ">git bisect bad commit_id</pre>


&nbsp;
Now, the command will trigger splitting the commits into half and revise it. We respond if the commit is good or bad as <strong>git bisect good</strong> or <strong>git bisect bad</strong>.
The revision is narrowed down until we find the commit that caused the bug.
&nbsp;
Sometimes, we can automate finding the bugs. We can pass any script and check the script against each commits. The commit returning a non-zero status is the failing one.
Here, as an example, I am running a failing test


<pre class="lang:default decode:true">git bisect run rspec spec/features/my_broken_spec.rb</pre>


&nbsp;
<strong>git bisect</strong> is an awesome method to find the commit which caused the bug. It helps us saving our time and money.
&nbsp;]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Git Blame</title>
		<link>/git-blame/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16352</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[

<p align="left">Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.</p>




<p align="left">




<p align="left">More than 1 developers may change the contents of a file. Using <strong>git blame</strong>, we can find the person responsible for the last change of code of each line. The command, as the name suggests, helps to find the person who changed a line of code and to blame them. In short, <strong>git blame</strong> shows the revision and author of each code of line of a file.</p>




<p align="left">




<p align="left">To get started with <strong>git blame</strong>, try the following syntax.</p>




<pre class="lang:default decode:true ">git blame filename</pre>


We then get the list of authors of each line of code for the file. <strong>git blame</strong> operates on individual files, therefore, it&#8217;s better to specify the path of the file. Here is a sample output of <strong>git blame</strong>.


<pre class="lang:default decode:true ">$ git blame README.md
82496ea3 (kev 2018-02-28 13:37:02 -0800 1) # Git Blame example
82496ea3 (kev 2018-02-28 13:37:02 -0800 2)
89feb84d (Alie So 2018-03-01 00:54:03 +0000 3) new line
82496ea3 (kev 2018-02-28 13:37:02 -0800 4)
82496ea3 (kev 2018-02-28 13:37:02 -0800 5) git blame
82496ea3 (kev 2018-02-28 13:37:02 -0800 6)
89feb84d (Alie So 2018-03-01 00:54:03 +0000 7) sun is going down</pre>




<h2>Commonly used options</h2>


We can use a set of options for <strong>git blame</strong>. Some of them are given below.


<pre class="lang:default decode:true ">git blame -L 1,5 README.md
</pre>


This option restricts the display from lines 1 to 5.
&nbsp;


<pre class="lang:default decode:true ">git blame -e README.md</pre>


This option displays the email address of the author instead of his username.
&nbsp;


<pre class="lang:default decode:true ">git blame -w README.md</pre>


This option ignores the whitespaces in the file and mentions the authors of other lines.
&nbsp;


<pre class="lang:default decode:true">git blame -M README.md</pre>


This option detects the copied or moved lines within a file. The command returns the original author instead of the person who copied or moved the file.
&nbsp;


<pre class="lang:default decode:true ">git blame -C README.md</pre>


This option detects the copied or moved lines among any files. The command returns the original author instead of the person who copied or moved the file.
&nbsp;
<strong>git blame</strong> is a very useful command in finding the author of each line of code. and to see when the modifications were done. <strong>git blame </strong>comes in handy while managing a project.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>Working Of Git</title>
		<link>/working-of-git/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16350</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[Git, a version control software, is primarily used for source code management and tracking any changes any set of files. Git is very effective in coordinating the work of multiple people working on a project. Being a distributed revision control system, Git aims at speed, data integrity and support for distributed, non-linear workflows.
Git handles contents in one snapshot for each commit. Git knows how to apply or rollback changes. To get started, we need to run the command "git init". This converts the current working directory into a Git working directory and creates a ".git" directory. We can now start working on Git.
The checkout and commit, which are similar to other source code repositories, focuses on changesets in Git. That's why we have "add" command, which causes a change in the working directory to be moved into a staging area, known as the index, of the next command.
"git status" command helps us track the changes of files made in the current working branch. "git diff" shows us the changes in lines of code of each file made in the current working directory. "git log" shows the entire history of commits made in the current directory.
Snapshots, which are the main elements of Git commits are named as commit ID. It is derived from the content of the snapshot, which comprises the actual content and some metadata. We usually work in branches, which is a named stream of changes, which in Git is a named pointer to the snapshots. Branches are of a concept in which each snapshot can have more than a single child. A named second change made to a snapshot, resulting in a separate stream of development, called as a branch. When a change is applied to a branch, the branch label is moved to a new commit. The HEAD points to where a change has to be made in a branch. The HEAD of the development is where you last checked out your workspace and where to commit.
These are the basic working of Git. The basic concepts on how to get started with Git, add changes, find out the changed files and know the status of the current working directory or the branch is discusses here. There are other important functionalities like Git Branch, Merging branches, Git Rebase, Cherry-Picking and Reverting changes to be discussed.]]&gt;		</p>
]]></content:encoded>
										</item>
		<item>
		<title>What is Test Driven Development?</title>
		<link>/what-is-test-driven-development/</link>
				<pubDate>Mon, 29 Apr 2019 11:28:11 +0000</pubDate>
		<dc:creator><![CDATA[levi]]></dc:creator>
				<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://redpanthers.co/?p=16375</guid>
				<description><![CDATA[
				<![CDATA[]]>		]]></description>
								<content:encoded><![CDATA[<p>				<![CDATA[<strong>Test Driven Development (TDD)</strong> is a software development process that weighs on a short development cycle. The developer first writes an automated test defining the new feature or update, which fails at first, then write minimal code for the tests to pass, then refactor the code according to the needed standards.<strong> TDD</strong> is helpful in keeping the code neater, simple and bug-free
&nbsp;
<strong>TDD</strong> starts with designing and developing tests for every small functionality of an application. The test is developed which will specify and validate what the code will do. n the normal Testing process, we first generate the code and then test. Tests might fail since tests are developed even before the development. In order to pass the test, the development team has to develop and refactors the code, which means changing the code without affecting its actual behaviour.
&nbsp;
We usually follow the following sequences in <strong>TDD</strong>.


<ul>
 	

<li>Add a test</li>


 	

<li>Run all tests and see if the new one fails</li>


 	

<li>Write some code</li>


 	

<li>Run tests</li>


 	

<li>Refactor code</li>


 	

<li>Repeat</li>


</ul>


<img class="alignnone size-full wp-image-16376" src="http://redpanthers.co/wp-content/uploads/2018/09/download.png" alt="" width="196" height="257" />
&nbsp;
The simple concept of TDD is to write and correct the failed tests before writing new code. This helps to avoid duplication of code as we write a small amount of code at a time in order to pass tests. Test-Driven development is a process of developing and running automated test before actual development of the application. Hence, TDD sometimes also called as <strong>Test First Development.</strong>
&nbsp;
In short, <strong>TDD</strong> is


<ol>
 	

<li>Write a test</li>


 	

<li>Make it run.</li>


 	

<li>Change the code to make it right i.e. Refactor.</li>


 	

<li>Repeat process.</li>


</ol>


&nbsp;


<h1>Why use Test Driven Development</h1>




<ul>
 	

<li><strong>Early bug notification.</strong>Developers test their code but in the database world, this often consists of manual tests or one-off scripts. Using TDD you build up, over time, a suite of automated tests that you and any other developer can rerun at will.</li>


 	

<li><strong>Better Designed, cleaner and more extensible code.</strong>


<ul>
 	

<li>It helps to understand how the code will be used and how it interacts with other modules.</li>


 	

<li>It results in better design decision and more maintainable code.</li>


 	

<li>TDD allows writing smaller code having single responsibility rather than monolithic procedures with multiple responsibilities. This makes the code simpler to understand.</li>


 	

<li>TDD also forces to write only production code to pass tests based on user requirements.</li>


</ul>


</li>


 	

<li><strong>Confidence to Refactor</strong>


<ul>
 	

<li>If you refactor code, there can be possibilities of breaks in the code. So having a set of automated tests you can fix those breaks before release. Proper warning will be given if breaks found when automated tests are used.</li>


 	

<li>Using TDD, should results in faster, more extensible code with fewer bugs that can be updated with minimal risks.</li>


</ul>


</li>


 	

<li><strong>Good for teamwork</strong>In the absence of any team member, other team members can easily pick up and work on the code. It also aids knowledge sharing, thereby making the team more effective overall.</li>


 	

<li><strong>Good for Developers</strong>Though developers have to spend more time in writing TDD test cases, it takes a lot less time for debugging and developing new features. You will write cleaner, less complicated code.</li>


</ul>


&nbsp;
<strong>Test Driven Development</strong> is a very effective method to follow to keep our code, neat and bug-free.
&nbsp;]]&gt;		</p>
]]></content:encoded>
										</item>
	</channel>
</rss>
