<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Readul Hasan Chayan [Heemayl] (Posts about git)</title><link>https://heemayl.net/</link><description></description><atom:link href="https://heemayl.net/categories/git.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 &lt;a href="mailto:me@heemayl.net"&gt;Readul Hasan Chayan [Heemayl]&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-top: 10px; margin-bottom: 5px;"
src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"&gt;&lt;/a&gt;
</copyright><lastBuildDate>Mon, 22 Jul 2024 10:13:20 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Sort files in a directory by modification time in Git</title><link>https://heemayl.net/posts/sort-files-in-a-directory-by-modification-time-in-git/</link><dc:creator>Readul Hasan Chayan [Heemayl]</dc:creator><description>&lt;div&gt;&lt;p&gt;Recently, I had a &lt;em&gt;sort of&lt;/em&gt; unusual requirement to get the last modified file (tracked by &lt;code&gt;git&lt;/code&gt;) in a certain directory for a specific branch. I tried to look for any existing &lt;a href="https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain"&gt;&lt;em&gt;porcelain&lt;/em&gt; or &lt;em&gt;plumbing&lt;/em&gt;&lt;/a&gt; command in &lt;code&gt;git&lt;/code&gt; that can be used to advantage, but couldn't find anything, so had to stitch up something combining several utilities.&lt;/p&gt;
&lt;p&gt;Here's how it looks eventually:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://heemayl.net/posts/sort-files-in-a-directory-by-modification-time-in-git/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>git</category><category>gnu/linux</category><guid>https://heemayl.net/posts/sort-files-in-a-directory-by-modification-time-in-git/</guid><pubDate>Sat, 17 Feb 2024 15:39:06 GMT</pubDate></item><item><title>Prevent editor invocation on `git pull` or `git merge`</title><link>https://heemayl.net/posts/prevent-editor-invocation-on-git-pull-or-git-merge/</link><dc:creator>Readul Hasan Chayan [Heemayl]</dc:creator><description>&lt;div&gt;&lt;p&gt;While doing &lt;code&gt;git pull&lt;/code&gt; or &lt;code&gt;git merge&lt;/code&gt;, if it's a mechanical merge (i.e. not a fast-forward merge), &lt;code&gt;git&lt;/code&gt; invokes the configured editor with an auto-generated merge commit message to give more flexibility to explain the merge. But the invocation of an interactive editor breaks the CI/CD workflow, hence we need something that can automatically save the merge commit with the auto-generated message without invoking the editor (given that's fine with your use case).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;git&lt;/code&gt; provides an environment variable to make this easier -- &lt;code&gt;GIT_MERGE_AUTOEDIT&lt;/code&gt;. We can run &lt;code&gt;git pull&lt;/code&gt; (or &lt;code&gt;git merge&lt;/code&gt;) with the value of this environment variable set to &lt;code&gt;no&lt;/code&gt; i.e.:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://heemayl.net/posts/prevent-editor-invocation-on-git-pull-or-git-merge/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>ci/cd</category><category>git</category><guid>https://heemayl.net/posts/prevent-editor-invocation-on-git-pull-or-git-merge/</guid><pubDate>Mon, 30 Nov 2020 07:27:47 GMT</pubDate></item></channel></rss>