-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathatom.xml
153 lines (104 loc) · 6.9 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Adhip Gupta]]></title>
<link href="http://adhipg.in/atom.xml" rel="self"/>
<link href="http://adhipg.in/"/>
<updated>2013-02-11T18:51:18+00:00</updated>
<id>http://adhipg.in/</id>
<author>
<name><![CDATA[Adhip Gupta]]></name>
<email><![CDATA[[email protected]]]></email>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Tracking your Toggl timer with tmux-powerline]]></title>
<link href="http://adhipg.in/notes/tracking-your-toggl-timer-with-tmux-powerline/"/>
<updated>2013-02-11T18:22:00+00:00</updated>
<id>http://adhipg.in/notes/tracking-your-toggl-timer-with-tmux-powerline</id>
<content type="html"><![CDATA[<p>I’ve recently started using <a href="http://toggl.com">Toggl</a> to track time spent on
various things. But I usually forget to turn it on when I’m actually working.</p>
<p>I wrote a little script that uses <a href="http://node.js">Node.JS</a> to get my active
running timer on Toggl and display it on my
<a href="https://github.com/erikw/tmux-powerline">tmux-powerline</a>. It displays nothing
if no timer is running.</p>
<p>The script can be found here:</p>
<div><script src='https://gist.github.com/4749181.js'></script>
<noscript><pre><code></code></pre></noscript></div>
<p>Do remember to <code>chmod +x</code> the JS file and include it as a segment in your status
bar.</p>
<p>A screenshot for completeness:</p>
<p><img src="http://adhipg.in/images/tmux-powerline-toggl.jpg"></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Using custom attributes in Markdown links]]></title>
<link href="http://adhipg.in/notes/using-custom-attributes-in-markdown-links/"/>
<updated>2013-01-27T21:58:00+00:00</updated>
<id>http://adhipg.in/notes/using-custom-attributes-in-markdown-links</id>
<content type="html"><</code></p>
<p>and then trying to add custom attributes; I can simply write</p>
<p><code><a href="http://twitter.com/adhipg" rel="me">@adhipg</a></code>.</p>
<p>Obviously you can use this for any other custom attributes/html you want.</p>
<p>Ugly - yes. But it works and does not need JavaScript.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Creating sub-repositories from your git repository]]></title>
<link href="http://adhipg.in/notes/creating-sub-repositories-from-your-git-repository/"/>
<updated>2013-01-20T00:27:00+00:00</updated>
<id>http://adhipg.in/notes/creating-sub-repositories-from-your-git-repository</id>
<content type="html"><![CDATA[<p>So you have a nice big project that you’ve been working on for a while and you
are at a state where you think it will be nice to split a part of the project.
This can be to either create it as a library to use it with other projects or
just maintain it independantly.</p>
<p>There are two steps involved:</p>
<ul>
<li>Splitting out the subpath from the repository and creating a new repository
from it.</li>
<li>Using this new git repository we’ve created in the main repository so that we
can continue working.</li>
</ul>
<p>Let’s tackle them one at a time.</p>
<h2>Splitting a subpath into a new repository</h2>
<p>I’m assuming that we’re interested in keeping the git history - else, you can
simply just copy out the directory into a new folder and init it as a new
repository.</p>
<h4>Using <code>git filter-branch</code></h4>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git filter-branch --prune=empty --subdirectory-filter my-api -- --all</span></code></pre></td></tr></table></div></figure>
<p>The <code>-- --all</code> is to ensure that we filter all the branches in the repository.</p>
<p>Next, you simply add new remotes and push your repository there.</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git remote add my-new-remote [email protected]:adhipg/new-remote.git
</span><span class='line'>git push --all</span></code></pre></td></tr></table></div></figure>
<p>Side note: You’ll have to clone the original repository again.</p>
<h4>Using <code>git subtree</code></h4>
<p><a href="https://github.com/gitster/git/blob/634392b26275fe5436c0ea131bc89b46476aa4ae/contrib/subtree/git-subtree.txt"><code>git subtree</code></a>
is a new git command that recently was added into git. Using it to create the
new repository is simple enough:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git subtree split --prefix my-api --branch my-api-repo</span></code></pre></td></tr></table></div></figure>
<p>Now the <code>my-api-repo</code> branch consists of just the contents from my-api and all
the relevant commits. This can now be used to push to a new remote:</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git push [email protected]:adhipg/new-remote.git split:master</span></code></pre></td></tr></table></div></figure>
<h2>Merging the subpath back into the original repository</h2>
<p>We use <code>git subtree</code> from earlier for this.</p>
<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git subtree add --prefix my-api --squash [email protected]:adhipg/new-remote.git master</span></code></pre></td></tr></table></div></figure>
<p>The <code>--squash</code> here implies that we just want to create a merge commit - else,
we’ll end up with duplicate commits in the history.</p>
<p><em>Up Next: Maintaining both the repositories simultaneously.</em></p>
]]></content>
</entry>
</feed>