<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Version-Control on Noetic Nought</title>
    <link>https://punchagan.muse-amuse.in/tags/version-control/</link>
    <description>Recent content in Version-Control on Noetic Nought</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>© 2006-2026 CC-BY-SA-4.0</copyright>
    <lastBuildDate>Mon, 28 Jul 2014 22:23:39 -0400</lastBuildDate>
    <atom:link href="https://punchagan.muse-amuse.in/tags/version-control/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Recurse Center, 2014-07-28</title>
      <link>https://punchagan.muse-amuse.in/recurse-center/recurse-center-2014-07-28/</link>
      <pubDate>Mon, 28 Jul 2014 22:23:39 -0400</pubDate>
      <guid>https://punchagan.muse-amuse.in/recurse-center/recurse-center-2014-07-28/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;There seemed to be excitement in the space to have Jessica around.  We had&#xA;coffee with her, and I chatted with her briefly. She encouraged me to try and&#xA;send a patch to CPython, that involved debugging and fixing some C issues.&lt;/li&gt;&#xA;&lt;li&gt;I spent some time with Tom, while he tried to get &lt;code&gt;cinspect&lt;/code&gt; working for him,&#xA;and it seemed like having the developer next to you, helped.  As always.  We&#xA;didn&amp;rsquo;t make any fixes to the code, but it worked.&lt;/li&gt;&#xA;&lt;li&gt;I spent the afternoon, adding tests for a simple issue, to see how patches are sent.&lt;/li&gt;&#xA;&lt;li&gt;Later, I paired with Sophia for an hour to refactor the vcs code. It&amp;rsquo;s&#xA;beginning to look much better than what it used to, and I like that.&lt;/li&gt;&#xA;&lt;li&gt;Jessica&amp;rsquo;s talk on buffer overflows was enlightening and entertaining. It was&#xA;very similar to a talk that Max gave on one of the thursdays, but it was&#xA;exciting nevertheless.&lt;/li&gt;&#xA;&lt;li&gt;After the talk, I am inspired to try and work through the Hacking: Art of&#xA;exploitation, at some point. I&amp;rsquo;m beginning to feel like time at HackerSchool&#xA;running out!&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>
  </channel>
</rss>
