<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ai Baranga!</title>
    <description>personal homepage of baranga / henning
</description>
    <link>https://baranga.de/</link>
    <atom:link href="https://baranga.de/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 12 Nov 2018 07:38:06 +0000</pubDate>
    <lastBuildDate>Mon, 12 Nov 2018 07:38:06 +0000</lastBuildDate>
    <generator>Jekyll v3.7.4</generator>
    
      <item>
        <title>Find last edit (after forgetting to stop time tracking)</title>
        <description>&lt;p&gt;Every now and then I forget to stop time tracking and can’t remember when I left the office
(especially after weekends). So normally I just consult git logs via &lt;a href=&quot;https://github.com/kamranahmedse/git-standup&quot;&gt;git-standup&lt;/a&gt;. That works
pretty nice because you should always check in your stuff before you leave.
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;But as you may already guessing sometimes I manage to even forget about that, like today. To solve
the issue I assume that my last save of a source file relates roughly to when I left the office.&lt;/p&gt;

&lt;p&gt;So I came up with this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git status &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; | sed &lt;span class=&quot;nt&quot;&gt;-nr&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/ M (.)/\1/p'&lt;/span&gt; | xargs stat &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; %y&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;git status -s | sed -nr 's/ M (.)/\1/p'&lt;/code&gt; part will return a list of files with uncommitted
changes. The following &lt;code class=&quot;highlighter-rouge&quot;&gt;xargs stat -c %y&lt;/code&gt; prints modification time for each file.&lt;/p&gt;

</description>
        <pubDate>Tue, 13 Feb 2018 00:00:00 +0000</pubDate>
        <link>https://baranga.de/blog/2018/02/13/last-edit.html</link>
        <guid isPermaLink="true">https://baranga.de/blog/2018/02/13/last-edit.html</guid>
        
        <category>productivity</category>
        
        <category>snippets</category>
        
        
        <category>blog</category>
        
      </item>
    
      <item>
        <title>Use gitflow on gitlab projects with merge requests</title>
        <description>&lt;p&gt;I use &lt;a href=&quot;https://github.com/petervanderdoes/gitflow-avh&quot;&gt;gitflow-avh&lt;/a&gt; and &lt;a href=&quot;https://gitlab.com/&quot;&gt;gitlab&lt;/a&gt; for several years and I’m quiet happy
with these tools. It just happened some months ago my team and me started some
projects using gitflow together with gitlab merge requests (MR). Merge
request are really helpful for code reviews and discussions around features.
But unfortunately they don’t integrate with gitflow very well.
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;Gitlab encourages you to use &lt;a href=&quot;https://docs.gitlab.com/ee/workflow/gitlab_flow.html&quot;&gt;gitlab flow&lt;/a&gt; which works quiet different
than the gitflow &lt;a href=&quot;http://nvie.com/posts/a-successful-git-branching-model/&quot;&gt;approach&lt;/a&gt;. Branches getting merged against
develop (like feature branches) are no problem. Just adjust your target
branch. But branches getting merged against master are another topic.&lt;/p&gt;

&lt;p&gt;Gitflow does a lot more then gitlab when merging a release or hotfix
branch against master: it creates a tag and updates develop. So naturally one
would just get the approval of colleges and automated test results via CI in
the MR and do the merge locally afterwards.&lt;/p&gt;

&lt;p&gt;Gitlab supports this approach and will mark a MR as merged as soon as it
detects it got merged into target branch. It “just” needs the source branch
to stay around for that. That’s my problem: gitflow automatically deletes the
merged branch remotely and gitlab can’t detect the MR got merged.&lt;/p&gt;

&lt;p&gt;To work around one could do two things:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;finishing feature/hotfix/release with &lt;code class=&quot;highlighter-rouge&quot;&gt;--keepremote&lt;/code&gt; flag
    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git flow release finish 1.2.3 --keepremote
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;or enable &lt;code class=&quot;highlighter-rouge&quot;&gt;--keepremote&lt;/code&gt; flag permanently:
    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git config --add gitflow.release.finish.keepremote true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now gitlab will detect a MR got merged, mark it as this and provide a
“remove source” button. To enable this in all my projects a created a
&lt;a href=&quot;https://gitlab.com/snippets/1665860&quot;&gt;small script&lt;/a&gt; and run it in the relevant git repositories.&lt;/p&gt;

</description>
        <pubDate>Fri, 23 Jun 2017 00:00:00 +0000</pubDate>
        <link>https://baranga.de/blog/2017/06/23/git-flow-for-gitlab-projects.html</link>
        <guid isPermaLink="true">https://baranga.de/blog/2017/06/23/git-flow-for-gitlab-projects.html</guid>
        
        
        <category>blog</category>
        
      </item>
    
      <item>
        <title>Hi!</title>
        <description>&lt;p&gt;Welcome to my blog. This first post is here just to fill the start page with
some content so it doesn’t feel empty.&lt;/p&gt;
</description>
        <pubDate>Thu, 07 Jul 2016 00:00:00 +0000</pubDate>
        <link>https://baranga.de/blog/2016/07/07/hi.html</link>
        <guid isPermaLink="true">https://baranga.de/blog/2016/07/07/hi.html</guid>
        
        
        <category>blog</category>
        
      </item>
    
  </channel>
</rss>
