<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Git on Noetic Nought</title>
    <link>https://punchagan.muse-amuse.in/tags/git/</link>
    <description>Recent content in Git on Noetic Nought</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>© 2006-2026 CC-BY-SA-4.0</copyright>
    <lastBuildDate>Tue, 20 Jan 2026 23:13:00 +0530</lastBuildDate>
    <atom:link href="https://punchagan.muse-amuse.in/tags/git/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Elfeed DB backup hooks</title>
      <link>https://punchagan.muse-amuse.in/blog/elfeed-db-back-up-hooks/</link>
      <pubDate>Tue, 20 Jan 2026 23:13:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/elfeed-db-back-up-hooks/</guid>
      <description>&lt;p&gt;I had a bunch of things running on my laptop &amp;ndash; video call with screenshare, my&#xA;Windows VM, Firefox with a lot of tabs, etc. And my laptop crashed! I didn&amp;rsquo;t&#xA;have the time to dig into what, why and how.&lt;/p&gt;&#xA;&lt;p&gt;Later in the day, I discovered my Elfeed&amp;rsquo;s DB was gone &amp;ndash; blown away. :( I&amp;rsquo;m&#xA;guessing the crash happened in the middle of &lt;code&gt;elfeed-db-save&lt;/code&gt;, and the data was&#xA;lost.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve now added some back-up for the DB, since I intend to use Elfeed regularly.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-emacs-lisp&#34; data-lang=&#34;emacs-lisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defvar&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-timer&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Timer for debounced elfeed database saves.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-and-backup&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Save the elfeed database and commit to git.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;boundp&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;elfeed-db&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;elfeed-db&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;elfeed-db-save&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;default-directory&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;elfeed-db-directory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;file-exists-p&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;.git&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;call-process&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;git&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;*elfeed-db-backup*&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;add&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;-A&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;call-process&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;git&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;*elfeed-db-backup*&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;commit&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;-m&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;auto-backup&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;call-process&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;git&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;*elfeed-db-backup*&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;push&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;origin&amp;#34;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;main&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-soon&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Schedule a database save after 10 seconds of idle.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;interactive&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-timer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;cancel-timer&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-timer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-timer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;run-with-idle-timer&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;#&amp;#39;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-and-backup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;; Save and backup when tags change (elfeed-web usage)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;add-hook&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;elfeed-tag-hooks&lt;/span&gt;   &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;lambda&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kp&#34;&gt;&amp;amp;rest&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-soon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;add-hook&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;elfeed-untag-hooks&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;lambda&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kp&#34;&gt;&amp;amp;rest&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-soon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;;; Save and backup when new entries are added&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;add-hook&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;&amp;#39;elfeed-db-update-hook&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;#&amp;#39;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;pc/elfeed-db-save-soon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Some useful Git configuration for Windows</title>
      <link>https://punchagan.muse-amuse.in/blog/some-useful-git-configuration-for-windows/</link>
      <pubDate>Fri, 24 Jan 2025 01:25:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/some-useful-git-configuration-for-windows/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve recently been working on Windows with a relatively involved git repository&#xA;and ran into a bunch of issues. Setting these configuration values turned out&#xA;to be very helpful!&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Allow symlinks&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --global core.symlinks &lt;span class=&#34;nb&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Don&amp;#39;t automatically change file endings to \r\n (carriage return + line feed)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --global core.autocrlf &lt;span class=&#34;nb&#34;&gt;false&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Use line feed for line endings&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --global core.eol lf&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Allow long paths in the repo&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --global core.longpaths &lt;span class=&#34;nb&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s also useful to set these as configuration values in &lt;code&gt;.gitattributes&lt;/code&gt; in a&#xA;repository to share this configuration with other people working on it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;related-posts&#34;&gt;Related posts&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://punchagan.muse-amuse.in/blog/git-resources/&#34;&gt;Git resources&lt;/a&gt; : A post with some resources to better understand git, along&#xA;with some useful git configuration.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
    </item>
    <item>
      <title>My Favorite Git Resources</title>
      <link>https://punchagan.muse-amuse.in/blog/git-resources/</link>
      <pubDate>Fri, 22 May 2020 16:07:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/git-resources/</guid>
      <description>&lt;p&gt;I often help friends who are new to using &lt;code&gt;git&lt;/code&gt; with using it. This blog post is&#xA;going to serve as a single link to share with them, instead of trying to find&#xA;individual links over and over.&lt;/p&gt;&#xA;&lt;h2 id=&#34;understanding-git&#34;&gt;Understanding Git&lt;/h2&gt;&#xA;&lt;p&gt;I got started with using &lt;code&gt;git&lt;/code&gt; after using &lt;code&gt;svn&lt;/code&gt; and &lt;code&gt;hg&lt;/code&gt; for a few months. But,&#xA;I would often be lost in the myriad of command line options, putting myself in&#xA;situations I couldn&amp;rsquo;t come out of without some scars. I didn&amp;rsquo;t really understand&#xA;how &lt;code&gt;git&lt;/code&gt; worked, and that was the real problem.&lt;/p&gt;&#xA;&lt;p&gt;Improving my mental model of how &lt;code&gt;git&lt;/code&gt; works, and then trying to fit the&#xA;commands into this mental model is what made &lt;code&gt;git&lt;/code&gt; finally click for me. The &lt;a href=&#34;http://tom.preston-werner.com/2009/05/19/the-git-parable.html&#34;&gt;Git&#xA;Parable&lt;/a&gt; really helped me understand &lt;code&gt;git&lt;/code&gt; from the inside out, and gave me a&#xA;much clearer mental model of &lt;code&gt;git&lt;/code&gt;. There was no looking back from there.&lt;/p&gt;&#xA;&lt;p&gt;If parables are not your thing, and you&amp;rsquo;d rather read something that takes a&#xA;less flowery and more straighforward approach to explaining these concepts, I&#xA;really liked John Wiegley&amp;rsquo;s &lt;a href=&#34;https://jwiegley.github.io/git-from-the-bottom-up/&#34;&gt;Git from the Bottom Up&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;day-to-day-git&#34;&gt;Day-to-day git&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://zulipchat.com&#34;&gt;Zulip&lt;/a&gt; (an open source group chat application that I spend a lot of time&#xA;contributing to) uses a rebase-heavy workflow, where good commits are merged&#xA;from different PRs, as and when they are reviewed, instead of waiting for all&#xA;the commits in a PR to be good to be merged. Developers often have to pull from&#xA;branches that have been force-pushed to, rebase their commits, squash commits,&#xA;learn to change &lt;code&gt;git&lt;/code&gt; history, etc.&lt;/p&gt;&#xA;&lt;p&gt;Zulip&amp;rsquo;s &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/git/index.html&#34;&gt;Git Guide&lt;/a&gt; is top-class documentation that gives guidelines on using git&#xA;from a practical stand-point. A lot of new developers use it to get upto speed&#xA;with Zulip&amp;rsquo;s workflow that involves a lot of things that I&amp;rsquo;ve seen devs who have&#xA;been using git for many years struggle with.&lt;/p&gt;&#xA;&lt;p&gt;The section on &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/git/pull-requests.html&#34;&gt;pull request workflow&lt;/a&gt; is quite helpful, and should work&#xA;reasonably well for contributing to other FOSS projects too.&lt;/p&gt;&#xA;&lt;p&gt;I also like the sections with recipes for common &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/git/fixing-commits.html&#34;&gt;&lt;code&gt;git&lt;/code&gt; history edit actions&lt;/a&gt;, and&#xA;the &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/git/troubleshooting.html&#34;&gt;troubleshooting section&lt;/a&gt; with recipes to get out of common troublesome&#xA;situations. &lt;a href=&#34;https://ohshitgit.com/#accidental-commit-master&#34;&gt;Oh shit, git!&lt;/a&gt; is a very similar resource to this, that has a bunch&#xA;of useful &amp;ldquo;recipes&amp;rdquo; to recover from different scenarios.&lt;/p&gt;&#xA;&lt;p&gt;Julia Evans&amp;rsquo;s &lt;a href=&#34;https://jvns.ca/blog/2019/08/30/git-exercises--navigate-a-repository/&#34;&gt;exercises&lt;/a&gt; approach to learning to explore a &lt;code&gt;git&lt;/code&gt; repository is&#xA;quite interesting, though I haven&amp;rsquo;t run through all the exercises myself.&lt;/p&gt;&#xA;&lt;h2 id=&#34;git-as-a-communication-tool&#34;&gt;Git as a communication tool&lt;/h2&gt;&#xA;&lt;p&gt;I like to look at &lt;code&gt;git&lt;/code&gt; history as telling the story of evolution of a code&#xA;base. The advice that is sometimes given to writers about doing the hardwork, so&#xA;that the readers can do less of it, holds true for git history too. Communicate&#xA;the story as clearly as possible for your readers to understand, and don&amp;rsquo;t just&#xA;publish a &amp;ldquo;stream of consciousness&amp;rdquo; piece.&lt;/p&gt;&#xA;&lt;p&gt;What does this mean in practical terms, though?&lt;/p&gt;&#xA;&lt;p&gt;I think editing git history to present a clearer story is completely acceptable.&#xA;If one tries a handful of different things, and then finally finds the solution&#xA;to do something, it&amp;rsquo;s not necessary to have all the failed attempts as commits.&#xA;Just the final approach can be a commit/pull-request, while documenting the&#xA;other approaches the commit message or as a comment in the code, if that makes&#xA;sense.&lt;/p&gt;&#xA;&lt;p&gt;Expect your collaborators (including future you) to look at not just older&#xA;versions of code, but the commit history for understanding how a piece of code&#xA;evolved, for undertsanding the history. Make your git &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-messages&#34;&gt;commit messages&lt;/a&gt; as useful&#xA;as you can. Writing a good summary line goes a long way in understanding a&#xA;change. In most cases a body would be useful to explain the how and the why of&#xA;the change, while the summary line explains the what.&lt;/p&gt;&#xA;&lt;p&gt;I like this &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-discipline&#34;&gt;commit discipline&lt;/a&gt; that the Git project itself uses, and was adopted&#xA;by the Zulip project: &amp;ldquo;Each commit is a minimal coherent idea&amp;rdquo;. Simply put, you&#xA;want each commit to be such that they can be can be deployed (and/or reverted by&#xA;itself), without depending on any other commits alongside them. You can read&#xA;more about what minimal and coherent mean in this context in the &lt;a href=&#34;https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-discipline&#34;&gt;Zulip&#xA;documentation&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;tools-for-git&#34;&gt;Tools for Git&lt;/h2&gt;&#xA;&lt;p&gt;Some of the confusion in using &lt;code&gt;git&lt;/code&gt; even after understanding how it works is&#xA;the inconsitent CLI API that it often exposes. There has been some work going&#xA;into this, to make this more consistent. But, using a nice client can help with&#xA;this. I use the excellent Emacs client for &lt;code&gt;git&lt;/code&gt; called &lt;a href=&#34;https://magit.vc/screenshots/&#34;&gt;&lt;code&gt;magit&lt;/code&gt;&lt;/a&gt;. It is an&#xA;intuitive UI on top of &lt;code&gt;git&lt;/code&gt;&amp;rsquo;s data model, that allows me to do things that I&#xA;commonly want to do, with just a few hot-keys, instead of typing out elaborate&#xA;recipes to do things. I highly recommend it, if you are an Emacs user.&lt;/p&gt;&#xA;&lt;p&gt;It is also helpful to change you shell&amp;rsquo;s prompt to tell you more about the&#xA;status of the current directory&amp;rsquo;s repository. There are a bunch of&#xA;configurations out there (Stackoverflow, Gists, etc.) that let you do this. The&#xA;git repo itself comes with a &lt;a href=&#34;https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh&#34;&gt;prompt customisation&lt;/a&gt;. I like being able to see at&#xA;least the current branch and dirty/clean state of the repo.&lt;/p&gt;&#xA;&lt;p&gt;Here are some simple changes to the global &lt;code&gt;git&lt;/code&gt; config, off the top of my head.&#xA;These could make your &lt;code&gt;git&lt;/code&gt; workflow more pleasant.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-gitconfig&#34; data-lang=&#34;gitconfig&#34;&gt;[push]&#xA;  # Push to the branch to the same remote branch as the one we are working on,&#xA;  # locally. This is the default in Git &amp;gt;= 2.0, so you may not need to set it.&#xA;  default = simple&#xA;&#xA;[diff]&#xA;  # You could configure a GUI tool to use here. (I haven&amp;#39;t used one in a long&#xA;  # time, and I don&amp;#39;t have recommendations on what to use)&#xA;  tool = icdiff&#xA;&#xA;[merge]&#xA;  # Shows common ancestor in a merge conflict. Makes it easier to understand&#xA;    # the conflict and merge, for me.&#xA;  conflictstyle = diff3&#xA;&#xA;# Never garbage collect commits/blobs that are unreachable&#xA;# The cost of keeping this data around is negligble compared losing data&#xA;[gc]&#xA;  reflogExpire = never&#xA;  reflogExpireUnreachable = never&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;outro&#34;&gt;Outro&lt;/h2&gt;&#xA;&lt;p&gt;If you have other recommendations or tools that you&amp;rsquo;d like to share with me,&#xA;please do! Using &lt;code&gt;git&lt;/code&gt; better, and understanding it better, is something that&#xA;I&amp;rsquo;m always excited about. I&amp;rsquo;d also be happy to answer questions, or help you&#xA;with specific things that you are trying to do with &lt;code&gt;git&lt;/code&gt;.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Recurse Center, 2014-06-23</title>
      <link>https://punchagan.muse-amuse.in/recurse-center/recurse-center-2014-06-23/</link>
      <pubDate>Mon, 23 Jun 2014 04:38:29 -0400</pubDate>
      <guid>https://punchagan.muse-amuse.in/recurse-center/recurse-center-2014-06-23/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;The Apprenticeship patterns book is very interesting!  I shall&#xA;continue to read it and start create daily/weekly rituals from the&#xA;actions prescribed in the book!&lt;/li&gt;&#xA;&lt;li&gt;I was reading &lt;a href=&#34;http://blogs.collab.net/git/protect-git-history#.U6fixh-caV4&#34;&gt;this post&lt;/a&gt; on &lt;code&gt;git gc&lt;/code&gt;, &lt;code&gt;reflog&lt;/code&gt;, etc. and wanted to&#xA;see what the default values were for some of the configurable&#xA;variables.  But, the git config command didn&amp;rsquo;t help.  Developer/code&#xA;defaults are also a part of the &amp;ldquo;config&amp;rdquo; system, and any tools to&#xA;inspect config variables should display them, if no other values&#xA;have been set explicitly!&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;If experience is built upon failure as much as success, then you&#xA;need a more or less private space where you can seek out failure.&amp;rdquo;&#xA;&amp;ndash; Apprenticeship Patterns.&lt;/li&gt;&#xA;&lt;li&gt;Our check-in groups changed, but 3 of us from our last check-in&#xA;group are together again!&lt;/li&gt;&#xA;&lt;li&gt;Most of the day was spent with Git.  In the morning, I learned that&#xA;setting &lt;code&gt;push.default&lt;/code&gt; to &lt;code&gt;nothing&lt;/code&gt; will prevent pushing any&#xA;branches without specifying explicitly which branch I want to push.&lt;/li&gt;&#xA;&lt;li&gt;Also, later in the day, Alan gave a presentation mapping the&#xA;internals of git to the commands, trying to give everyone a better&#xA;mental model of Git.&lt;/li&gt;&#xA;&lt;li&gt;I spent some time trying to get &lt;code&gt;jedi&lt;/code&gt; integration for &lt;code&gt;emacs&lt;/code&gt;. It&#xA;should&amp;rsquo;ve worked out of the box, but I&amp;rsquo;m not sure the ELPA&#xA;repositories have proper dependency/version management.  Seems to be&#xA;the problem, everywhere!  Dependencies of a package get updated, and&#xA;the package starts acting up&amp;hellip;&lt;/li&gt;&#xA;&lt;li&gt;Chaitu sent me a link about solving mazes using Finite Automata, and&#xA;I spent some time trying to write a simple solver, and compare it&#xA;with Nava&amp;rsquo;s breadth first search.  But, it looks like we broke her&#xA;code during the refactor.  I may get back to this, at some point.&lt;/li&gt;&#xA;&lt;li&gt;I also spent a few minutes talking to Kyle, while he was trying to&#xA;implement a simple version of the NTP protocol.  The algorithm it&#xA;turns out, is pretty simple.&lt;/li&gt;&#xA;&lt;li&gt;I started reading a little bit on crypt-analysis for Simple&#xA;Substitution ciphers, and I&amp;rsquo;ll try implementing one of the&#xA;algorithms today.&lt;/li&gt;&#xA;&lt;li&gt;The day ended with yummy pizza and video watching!  We watched &amp;ndash;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bret Victor, &lt;a href=&#34;http://vimeo.com/36579366&#34;&gt;Inventing on Principle&lt;/a&gt; (54 min)&lt;/li&gt;&#xA;&lt;li&gt;Gary Bernhardt, &lt;a href=&#34;https://www.destroyallsoftware.com/talks/wat&#34;&gt;WAT&lt;/a&gt; (4 min)&lt;/li&gt;&#xA;&lt;li&gt;Guy Steele, &lt;a href=&#34;https://www.youtube.com/watch?v=_ahvzDzKdB0&#34;&gt;Growing a Language&lt;/a&gt; (53 min)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
    </item>
    <item>
      <title>A git-diff tip</title>
      <link>https://punchagan.muse-amuse.in/blog/a-git-diff-tip/</link>
      <pubDate>Wed, 22 Aug 2012 00:00:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/a-git-diff-tip/</guid>
      <description>&lt;p&gt;One of the things with git that you can mess-up, if you are not&#xA;used to, is git diff.  A friend of mine was trying to add a couple&#xA;of new files, and changes to existing files.  But, he was on the&#xA;wrong branch, and wanted to change to a different branch, before&#xA;committing.  Being new to git, he wanted to take a patch.  Reset&#xA;the changes, apply the patch back.&lt;/p&gt;&#xA;&lt;p&gt;This is what he did&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git add new_file.txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git add old_file1.txt old_file2.txt &lt;span class=&#34;c1&#34;&gt;# don&amp;#39;t add old_file3.txt&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Oh, damn, I want to change the branch.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git diff &amp;gt; a.patch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git reset --hard&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git checkout other-branch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let me commit my changes&amp;hellip;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git apply a.patch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git show&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Oh crap!  Where are my new files?  They aren&amp;rsquo;t commited!  Lemme&#xA;add them.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls new_file.txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls: cannot access new_file.txt: No such file or directory&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Dammit!  Where are my changes gone?&lt;/p&gt;&#xA;&lt;p&gt;The problem was with &lt;code&gt;git diff&lt;/code&gt;.  It gives only the only the&#xA;un-staged changes.  &lt;code&gt;--cached&lt;/code&gt; option has to specified, to get the&#xA;staged changes in the diff output.  &lt;code&gt;git diff HEAD&lt;/code&gt; shows diff&#xA;output with both staged and un-staged changes.&lt;/p&gt;&#xA;&lt;p&gt;But the whole workflow above is a beginners workflow.  A user&#xA;comfortable with git would&amp;rsquo;ve committed and then moved the commit&#xA;around using cherry-pick or the like.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git add &amp;lt;all-files&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;My awesome changes.&amp;#34;&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;#committed on branch1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git checkout other-branch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git cherry-pick branch1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>GetHub: Chrome Notifications for Github updates</title>
      <link>https://punchagan.muse-amuse.in/blog/gethub-chrome-notifications-for-github-updates/</link>
      <pubDate>Wed, 02 Mar 2011 00:00:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/gethub-chrome-notifications-for-github-updates/</guid>
      <description>&lt;p&gt;Over the last two days, I hacked up my first Chrome extension.&#xA;I&amp;rsquo;ve been using Chrome only for the past couple of weeks or so and&#xA;I begin to like it, though some of the extensions aren&amp;rsquo;t as mature&#xA;as I would&amp;rsquo;ve liked.&lt;/p&gt;&#xA;&lt;p&gt;The original idea was floated by my friend,  Madhu, and Lee helped&#xA;me quite a bit, while I was working on it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-does-it-do&#34;&gt;What does it do?&lt;/h2&gt;&#xA;&lt;p&gt;It is a simple extension, that shows pop-ups, whenever there is&#xA;an update in your GitHub &amp;ldquo;Wall&amp;rdquo; (yes, this is a Facebook world)&#xA;or News Feed as they call it.&lt;/p&gt;&#xA;&lt;p&gt;After installation, you will need to save your &lt;code&gt;username&lt;/code&gt; and&#xA;&lt;code&gt;token&lt;/code&gt; for the extension to work.&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-to-get-it&#34;&gt;Where to get it?&lt;/h2&gt;&#xA;&lt;p&gt;Presently, you will need to get it from GitHub.&lt;/p&gt;&#xA;&lt;p&gt;I might add it to the Chrome Web Store, once I see more people&#xA;using it.  I couldn&amp;rsquo;t justify, to myself, paying the initial&#xA;one-time verification fee that Google asks for.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: &lt;span class=&#34;timestamp-wrapper&#34;&gt;&lt;span class=&#34;timestamp&#34;&gt;[2011-03-04 Fri] &lt;/span&gt;&lt;/span&gt; Added GetHub to the store&lt;/p&gt;&#xA;&lt;h2 id=&#34;comments-and-feedback&#34;&gt;Comments and Feedback&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Feel free to write to me at &lt;code&gt;punchagan+gethub@jeemail.com&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Or file issues at GitHub.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Happy GitHubbing!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Git powered wikis improved: My bit</title>
      <link>https://punchagan.muse-amuse.in/blog/git-powered-wikis-improved-my-bit/</link>
      <pubDate>Fri, 04 Feb 2011 00:00:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/git-powered-wikis-improved-my-bit/</guid>
      <description>&lt;p&gt;I accidentally came across the blog-post Git-powered wikis&#xA;improved - GitHub. And this particular paragraph caught my&#xA;eye:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The new editor has the capability to support every markup&#xA;language that GitHub Wikis support. If you&amp;rsquo;re a fan of Markdown,&#xA;Textile, pod or RDoc, the function bar buttons (e.g. bold,&#xA;italic, underline, etc.) will now work. We&amp;rsquo;ve even written brand&#xA;new inline help for many of GitHub Wiki&amp;rsquo;s supported markup&#xA;languages.&lt;/p&gt;&#xA;&lt;p&gt;The language definitions the editor uses are JSON-based and easy&#xA;to edit. If you&amp;rsquo;d like us to support a markup language that we&#xA;don&amp;rsquo;t currently support, Gollum, GitHub&amp;rsquo;s wiki software, is&#xA;entirely open source &amp;ndash; fork our code and send us a pull request&#xA;with changes that support your choice language.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I sent a quick patch for org-mode in the function bar, and it has&#xA;been accepted.  :)&lt;/p&gt;&#xA;&lt;p&gt;If not anything more, I hope, at least a couple of curious people&#xA;will explore org-mode and find it useful.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>git vs. mercurial</title>
      <link>https://punchagan.muse-amuse.in/blog/git-vs-mercurial/</link>
      <pubDate>Sun, 01 Aug 2010 00:00:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/git-vs-mercurial/</guid>
      <description>&lt;p&gt;At work, we use hg and to be frank, I haven&amp;rsquo;t really got the&#xA;hang of using it well. I&amp;rsquo;ve recently started using git for my own&#xA;work and I&amp;rsquo;m loving it.&lt;/p&gt;&#xA;&lt;p&gt;I chose git because&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;github seems to be a nice place to hang around, as compared to&#xA;bit-bucket.&lt;/li&gt;&#xA;&lt;li&gt;org-mode uses git and I need to learn to use git, if I intend&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;contribute anything to org-mode.&lt;/p&gt;&#xA;&lt;p&gt;But after using git for a month or so, I&amp;rsquo;m totally loving using&#xA;git. The way it handles merges is awesome. People go gaga over&#xA;it&amp;rsquo;s speed.&lt;/p&gt;&#xA;&lt;p&gt;But for me, it&amp;rsquo;s the way it handles branches. I can have any&#xA;number of branches on my machine, while pushing only changes in&#xA;the master branch, upstream. I can easily merge changes from one&#xA;branch to another. After putting up a lot of fight, I couldn&amp;rsquo;t&#xA;make hg do this. Not as well as git does it!&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve now decided to convert my personal repositories to git.&lt;/p&gt;&#xA;&lt;p&gt;This blog post shows how to.&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
