<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eduardo Lisboa</title>
    <description>The latest articles on DEV Community by Eduardo Lisboa (@elisboa).</description>
    <link>https://dev.to/elisboa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F751568%2F7436d74b-3784-4306-965b-51ac410d61e7.png</url>
      <title>DEV Community: Eduardo Lisboa</title>
      <link>https://dev.to/elisboa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/elisboa"/>
    <language>en</language>
    <item>
      <title>Commit early, commit often</title>
      <dc:creator>Eduardo Lisboa</dc:creator>
      <pubDate>Mon, 11 Apr 2022 19:23:11 +0000</pubDate>
      <link>https://dev.to/elisboa/commit-early-commit-often-2c3g</link>
      <guid>https://dev.to/elisboa/commit-early-commit-often-2c3g</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;It has been commonplace that people are kind of afraid of commiting. It's not rare to see big, heavy changes in one single commit. And this is not good, since it will not be easy to code review.&lt;/p&gt;

&lt;p&gt;There are many, many ways to improve commits, and this goes through two simple tips: &lt;strong&gt;standardize your commits&lt;/strong&gt; and &lt;strong&gt;create more branches&lt;/strong&gt;. Let's talk about them a bit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Standardize your commits
&lt;/h2&gt;

&lt;p&gt;It is very important to have a standard for message commits, because it makes it easier to read, as well as to reuse them. We only need to change specific details, depending on the changes being made. &lt;/p&gt;

&lt;p&gt;It works better when there's already a chosen flow, which is generally previously agreed with other team members. There are many options available, and lately I have been using gitmoji.dev as an add-on to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create more branches
&lt;/h2&gt;

&lt;p&gt;Maybe because of subversion, people think that branching may create some overhead on the project. But that is not true. I see branching, along with git messages as part of the documentation. They must explain directly what is being done.&lt;/p&gt;

&lt;p&gt;If a feature branch is created and two people are working on that, tasks must be defined and each (sub) branch should be created for each person. Then, one approves the changes of the other and vice-versa.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Regarding the commits, along with standardization, I also like to commit empty changes using &lt;code&gt;git commit --allow-empty&lt;/code&gt; to mark the beginning of a branch, or some intermediate and important point. I even commit broken or incomplete code this way!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit --allow-empty -m":boom: going to lunch, incomplete code is pending bugfix on feature WorldDomination"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Branching &lt;em&gt;per se&lt;/em&gt; may lead to a "branch hell" problem, but only if they are not properly managed. A branch must be created and then, when it's purpouse is reached, the pull request (or merge request) must be created, approved or rejected and them the branch must be deleted.&lt;/p&gt;

&lt;p&gt;And that's it. If you have any doubts or suggestions, let me know in the comments below.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>Don't panic when using CLI</title>
      <dc:creator>Eduardo Lisboa</dc:creator>
      <pubDate>Mon, 22 Nov 2021 11:23:05 +0000</pubDate>
      <link>https://dev.to/elisboa/dont-panic-when-using-cli-3d99</link>
      <guid>https://dev.to/elisboa/dont-panic-when-using-cli-3d99</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;When using the Command Line Interface, we often find a few long and / or confusing commands. And this post intends to ease the pain of getting along with that.&lt;/p&gt;

&lt;p&gt;When things start to get complicated, there are some things that can be done. In this post, we are talking about three of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Aliases&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Comments&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Development
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Aliases
&lt;/h3&gt;

&lt;p&gt;An alias is exactly what it means: a nickname. It is very useful when running commands that take too much arguments. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias lah=ls -ltrah
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when running the &lt;code&gt;lah&lt;/code&gt; command, it will be exactly like running &lt;code&gt;ls -ltrah&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Functions
&lt;/h3&gt;

&lt;p&gt;A function is probably the best way to run a group of commands. When adding a &lt;code&gt;if&lt;/code&gt; or a &lt;code&gt;for&lt;/code&gt; statement, it gets even more interesting. Let's suppose we want to connect to a server which is still being provisioned or rebooted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function keeptrying() {
    until $@
    do
        sleep 1
        echo -e "Trying to run $1 again"
    done
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, this function can be called like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;keeptrying ssh myserver -l myuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Due to the &lt;code&gt;until&lt;/code&gt; statement, this function will keep trying forever to run any command given, until it is successful. Possibilities are infinite, limited only by our imagination. Be creative.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comments
&lt;/h3&gt;

&lt;p&gt;This resource is more useful when searching for commands on history logs. While aliases can be useful to shorten a complex command, comments can be useful in another way: finding those damn complex commands. When relying on CLI, a lot of useful commands are run and often revisited. For this, we can use Control + R and start typing the command we want to find. But... what if we could search for it's description instead of the command itself? Very useful when we can't even remember the command, isn't it?&lt;/p&gt;

&lt;p&gt;All we have to do is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -ltrah # list hidden files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can revisit this command by pressing Control + R and typing &lt;code&gt;list hidden files&lt;/code&gt;, or even only &lt;code&gt;hidden&lt;/code&gt;. Pressing Control + R again will show the next other search result. Pretty neat, isn't it?&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are plenty of things we can do by mastering such techniques. As said before, the most important thing is to &lt;em&gt;be creative&lt;/em&gt;. First, start by playing with these guys until getting used to them. Then, start doing real things that will change your life forever.&lt;/p&gt;

&lt;p&gt;Hope to have helped. &lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>productivity</category>
      <category>sre</category>
    </item>
  </channel>
</rss>
