Housekeeping on Wednesday, 11th of February, Anno Domini MMIX, at the hour of the...
[git/dscho.git] / blog.rss
blob4e42eafe5f6c114a251333da6003315f18af18b4
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
3 <channel>
4 <title>Dscho's blog</title>
5 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html</link>
6 <atom:link href="http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=blog.rss" rel="self" type="application/rss+xml"/>
7 <description>A few stories told by Dscho</description>
8 <lastBuildDate>Wed, 11 Feb 2009 03:53:26 +0100</lastBuildDate>
9 <language>en-us</language>
10 <item>
11 <title>Thunderbird, oh Thunderbird, you always make my small brain hurt</title>
12 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234320806</link>
13 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234320806</guid>
14 <pubDate>Wed, 11 Feb 2009 03:53:26 +0100</pubDate>
15 <description><![CDATA[Thunderbird, oh Thunderbird, you always make my small brain hurt
16 </p><p>
17 There was a lengthy discussion on the Git mailing list about using Thunderbird,
18 a not quite unpopular mailing program, to send inline patches.
19 </p><p>
20 It is really kind of sad that the Thunderbird developers do not see how
21 stubbornly they offend quite a number of people and scare them away from their
22 program. After all, you should try to be liberal in what you accept and strict
23 in what you emit. No, that does not mean that you should force others to
24 switch their mailers because you strictly adher to your philosophy in what you
25 emit, ignoring the rest of the world.
26 </p><p>
27 In any case, I am not affected (as long as I do not get mails from a poor soul
28 stuck with Thunderbird).
29 </p><p>
30 But I was a bit mean to that Thunderbird guy I dragged into the discussion, and
31 he seems really offended.
32 </p><p>
33 So I thought I'd give him a real reason to feel offended: I'll just do his work:
34 </p><p>
35 http://<a href=http://repo.or.cz>repo.or.cz</a>/w/UnFlowedThunderbird.git
36 </p><p>
37 It took my free time of two days, being not a Thunderbird developer myself.
38 Hopefully it works, and hopefully some people will feel really ashamed now.]]></description>
39 </item>
40 <item>
41 <title>format-patch --thread and Alpine</title>
42 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234141489</link>
43 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234141489</guid>
44 <pubDate>Mon, 09 Feb 2009 02:04:49 +0100</pubDate>
45 <description><![CDATA[<i>format-patch --thread</i> and Alpine
46 </p><p>
47 I started recently to pipe the output of
48 <i>git format-patch --cover-letter --stdout ...</i> directly into the
49 <i>postponed-msgs</i> folder Alpine uses, instead of pasting files into the
50 mailer.
51 </p><p>
52 The idea is to pretend that I continue a postponed mail, but in reality I
53 never wrote it, <i>format-patch</i> did.
54 </p><p>
55 However, I had problems with the <i>--thread</i> option that is implied by
56 <i>--cover-letter</i>. Alpine always generated new message IDs without adjusting
57 the <i>In-reply-to:</i> and <i>References:</i> headers of the other mails.
58 </p><p>
59 Now I found out that the reason is that the <i>Fcc:</i> headers were missing in
60 the mails, and Alpine generated them, making up new message IDs in the process.
61 </p><p>
62 Therefore I have an alias now which sets not only the <i>Fcc:</i> header, but also
63 the <i>To:</i> headers by rewriting the stream using <i>sed</i>. This is slightly
64 ugly, but so is the handling of headers in <i>format-patch</i>: if you thought
65 you could specify arbitrary headers using the command line, you are mistaken:
66 you can do that only by editing the config.
67 </p><p>
68 While at it, I also noticed a bug whereby <i>--thread --in-reply-to=...</i> simply
69 forgets the <i>--thread</i>. Maybe this week I will find time to address this bug.]]></description>
70 </item>
71 <item>
72 <title>rebase updates</title>
73 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234140696</link>
74 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234140696</guid>
75 <pubDate>Mon, 09 Feb 2009 01:51:36 +0100</pubDate>
76 <description><![CDATA[<i>rebase</i> updates
77 </p><p>
78 Phew. The last few days, I was mainly chasing bugs I introduced due to being
79 too tired to work on the merge-preserving, interactive <i>rebase</i>.
80 </p><p>
81 But finally I have something I can start working with. After my failed
82 experiment to use git-blame to split topic branches, I will sort the commits
83 in my <i>my-next</i> branch into topic branches manually.
84 </p><p>
85 Then I will add an option to <i>rebase -i -p</i> to rewrite refs which point to
86 rewritten commits, so that I can have branches <i>rebase-i-p</i>, <i>add-e</i>, etc
87 and all of them are automatically updated when I <i>rebase -i -p</i> the <i>my-next</i>
88 branch.
89 </p><p>
90 In the process, not only have I learnt the value of the <i>bookmark</i> command,
91 but made quite a few-much needed cleanups (which make
92 <i>git-rebase--interactive.sh</i> longer, but much more understandable).
93 </p><p>
94 Hopefully Stephan will pick the changes in the "rebase protocol" up, and then
95 we can have a sequencer with which I can start to make a graphical interactive
96 rebase using git-gui. Or gitk.
97 </p><p>
98 Maybe.]]></description>
99 </item>
100 <item>
101 <title>The infamous mark command in the rebase command</title>
102 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234040744</link>
103 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1234040744</guid>
104 <pubDate>Sat, 07 Feb 2009 22:05:44 +0100</pubDate>
105 <description><![CDATA[The infamous <i>mark</i> command in the <i>rebase</i> command
106 </p><p>
107 I realized today how easy it is to lose commits with the "merge preserving"
108 mode of the interactive rebase. In my case, it was when I tried to move a
109 bunch of commits from the tip of my branch into a topic branch.
110 </p><p>
111 But after moving the commits, I forgot to update the parent of the merge
112 commit. Possibly a mark command could have helped. The very same command
113 I called a nightmare for usability.
114 </p><p>
115 So I was wrong. Big news. &#x263a;
116 </p><p>
117 However, I think that the syntax "mark :1" is something best left for
118 machine consumption, not for human beings.
119 </p><p>
120 But I have an idea: we could use some garbled commit subject, or in case of
121 merge parents, the merge subject as some human readable title of the mark.
122 </p><p>
123 The rebase script would then look something like this:
124 </p><p>
125 <table
126 border=1 bgcolor=white>
127 <tr><td bgcolor=lightblue colspan=3>
128 <pre> </pre>
129 </td></tr>
130 <tr><td>
131 <table cellspacing=5 border=0
132 style="color:black;">
133 <tr><td>
134 <pre>
135 pick abcdefg Some ultra cool commit
136 bookmark ultra-cool
137 goto upstream
138 pick hijklmn Some other cool commit
139 merge parent ultra-cool Merge 'ultra-cool' into master
140 </pre>
141 </td></tr>
142 </table>
143 </td></tr>
144 </table>
145 </p><p>
146 The good news is: I added code that refuses to finish a rebase when there
147 are commits that were rewritten, but not part of the new HEAD's ancestry.]]></description>
148 </item>
149 <item>
150 <title>New valgrind series</title>
151 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233707628</link>
152 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233707628</guid>
153 <pubDate>Wed, 04 Feb 2009 01:33:48 +0100</pubDate>
154 <description><![CDATA[New valgrind series
155 </p><p>
156 I spent quite some time cleaning up that patch series, and feel pretty
157 exhausted.
158 </p><p>
159 Granted, the new <i>git rebase -i -p</i> does its job without complaint so far
160 (so much so that I think I'll release a version of my <i>rebase</i> series
161 soonish), but it <u>is</u> a hassle when you have patches that you have a hard
162 time to decide upon the order/commit boundaries.
163 </p><p>
164 For example, I could imagine that the patch making the location of the
165 templates independent of the location of the Git binaries should come
166 <u>before</u> my patch series, and the valgrind specific part should then
167 be squashed into the first valgrind commit.
168 </p><p>
169 Also, it uses two features of valgrind 3.4.0:
170 </p><p>
171 <ul>
172 <li><i>...</i> in the suppression file, and
173 <li><i>--track-origins=yes</i>
174 </ul>
175 </p><p>
176 The latter is actually the reason I am pretty willing to keep the
177 requirement of that valgrind version, as it is really, really useful.
178 </p><p>
179 I guess we will see what happens to it.]]></description>
180 </item>
181 <item>
182 <title>Problems with split-topic-branches.sh</title>
183 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233706294</link>
184 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233706294</guid>
185 <pubDate>Wed, 04 Feb 2009 01:11:34 +0100</pubDate>
186 <description><![CDATA[Problems with split-topic-branches.sh
187 </p><p>
188 So my little script that should help me to split my topic branches does
189 not work properly.
190 </p><p>
191 First some background: the idea was to let <i>git blame</i> do the hard work
192 to find overlapping changes, i.e. changes that would conflict when
193 changing the order (or skipping the first change, on which the next builds).
194 </p><p>
195 The first problem with that approach: when lines are <u>removed</u> by one
196 commit, and the next commit touches the same location, <i>git blame</i> does
197 not find that the first commit is required by the second.
198 </p><p>
199 Therefore I introduced a really slow reverse thing which tries to find
200 those commits whose removals survived until the parent of a particular
201 commit, but not further.
202 </p><p>
203 However, it does not work properly. Basically, only context sizes that
204 span the whole files lead to conflict-free topic branches so far.
205 </p><p>
206 As a consequence, I think I'll add an option --sprout to the revision
207 walker which will fake octopus merges (or a series of two-parent merges)
208 whenever it finds a perl of non-merge commits that are theoretically
209 independent, i.e. whose patches apply cleanly.]]></description>
210 </item>
211 <item>
212 <title>More valgrind fun</title>
213 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233277286</link>
214 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233277286</guid>
215 <pubDate>Fri, 30 Jan 2009 02:01:26 +0100</pubDate>
216 <description><![CDATA[More valgrind fun
217 </p><p>
218 So I spent quite a number of hours on that funny zlib/valgrind issue. The
219 thing is, zlib people claim that even if their code accesses uninitialized
220 memory, it does not produce erroneous data (by cutting out the results of the
221 uninitialized data, which is cheaper than checking for the end of the buffer
222 in an unaligned manner), so zlib will always be special for valgrind.
223 </p><p>
224 However, the bug I was chasing is funny, and different from said issue. zlib
225 deflates an input buffer to an output buffer that is exactly 58 bytes long.
226 But valgrind claims that the 52nd of those bytes is uninitialized, and <u>only</u>
227 that one.
228 </p><p>
229 But it is not. It must be 0x2c, otherwise zlib refuses to inflate the
230 buffer.
231 </p><p>
232 Now, I went into a debugging frenzy, and finally found out that zlib just
233 passes fine (with the default suppressions because of the "cute" way it
234 uses uninitialized memory), <u>except</u> when it is compiled with UNALIGNED_OK
235 defined.
236 </p><p>
237 Which Ubuntu does, of course. Ubuntu, the biggest forker of all.
238 </p><p>
239 The bad part is that it sounds like a bug in valgrind, and I <u>could</u> imagine
240 that it is an issue of an optimized memcpy() that copies int by int, and
241 that valgrind misses out on the fact that a part of that int is actually
242 <u>not</u> uninitialized.
243 </p><p>
244 But my debugging session's results disagree with that.
245 </p><p>
246 With the help of Julian Seward, the original author of valgrind, I instrumented
247 zlib's source code so that valgrind checks earlier if the byte is initialized
248 or not, to find out where the reason of the issue lies.
249 </p><p>
250 The sad part is that when I added the instrumentation to both the <u>end</u> of
251 the while() loop in compress_block() in zlib's trees.c, and just <u>after</u> the
252 while() loop (whose condition is a plain <i>variable < variable</i> comparison,
253 nothing fancy, certainly not changing any memory), only the <u>latter</u> catches
254 a valgrind error.
255 </p><p>
256 And that is truly strange.]]></description>
257 </item>
258 <item>
259 <title>Interactive stash</title>
260 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233193467</link>
261 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233193467</guid>
262 <pubDate>Thu, 29 Jan 2009 02:44:27 +0100</pubDate>
263 <description><![CDATA[Interactive stash
264 </p><p>
265 There is an easy way to split a patch:
266 </p><p>
267 <table
268 border=1 bgcolor=white>
269 <tr><td bgcolor=lightblue colspan=3>
270 <pre> </pre>
271 </td></tr>
272 <tr><td>
273 <table cellspacing=5 border=0
274 style="color:black;">
275 <tr><td>
276 <pre>
277 $ git reset HEAD^
278 $ git add -i
279 $ git commit
280 $ git diff -R HEAD@{1} | git apply --index
281 $ git commit
282 </pre>
283 </td></tr>
284 </table>
285 </td></tr>
286 </table>
287 </p><p>
288 but it misses out on the fact that the first of both commits does not
289 reflect the state of the working directory at any time.
290 </p><p>
291 So I think something like an interactive <i>stash</i> is needed. A method
292 to specify what you want to keep in the working directory, the rest should
293 be stashed. The idea would be something like this:
294 </p><p>
295 <ol>
296 <li>Add the desired changes into a temporary index.
297 <li>Put the rest of the changes in another temporary index.
298 <li>Stash the latter index.
299 <li>Synchronize the working directory with the first index.
300 <li>Clean up temporary indices.
301 </ol>
302 </p><p>
303 Or in code:
304 </p><p>
305 <table
306 border=1 bgcolor=white>
307 <tr><td bgcolor=lightblue colspan=3>
308 <pre> </pre>
309 </td></tr>
310 <tr><td>
311 <table cellspacing=5 border=0
312 style="color:black;">
313 <tr><td>
314 <pre>
315 $ cp .git/index .git/interactive-stash-1
316 $ GIT_INDEX_FILE=.git/interactive-stash-1 git add -i
317 $ cp .git/index .git/interactive-stash-2
318 $ GIT_INDEX_FILE=.git/interactive-stash-1 git diff -R |
319 (GIT_INDEX_FILE=.git/interactive-stash-2 git apply--index)
320 $ tree=$(GIT_INDEX_FILE=.git/index git write-tree)
321 $ commit=$(echo Current index | git commit-tree $tree -p HEAD)
322 $ tree=$(GIT_INDEX_FILE=.git/interactive-stash-2 git write-tree)
323 $ commit=$(echo Edited out | git commit-tree $tree -p HEAD -p $commit)
324 $ git update-ref refs/stash $commit
325 $ GIT_INDEX_FILE=.git/interactive-stash-1 git checkout-index -a -f
326 $ rm .git/interactive-stash-1 .git/interactive-stash-2
327 </pre>
328 </td></tr>
329 </table>
330 </td></tr>
331 </table>
332 </p><p>
333 This should probably go into <i>git-stash.sh</i>, maybe even with a switch
334 to start git-gui to do the interactive adding instead of git-add.]]></description>
335 </item>
336 <item>
337 <title>Splitting topic branches</title>
338 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233154567</link>
339 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233154567</guid>
340 <pubDate>Wed, 28 Jan 2009 15:56:07 +0100</pubDate>
341 <description><![CDATA[Splitting topic branches
342 </p><p>
343 One might be put off easily by the overarching use of buzzwords in the
344 description of how <i>Darcs</i> works. I, for one, do not expect an intelligent
345 author when I read <i>Theory of patches</i> and <i>based on quantum physics</i>.
346 </p><p>
347 The true story, however, is much simpler, and is actually not that dumb:
348 Let's call two commits "conflicting" when they contain at least one
349 overlapping change.
350 </p><p>
351 The idea is now: Given a list of commits (not a set, as the order is important),
352 to sort them into smaller lists such that conflicting commits are in the
353 sublists ("topic branches") and the sublists are minimal, i.e. no two
354 non-conflicting commits are in the same sublist.
355 </p><p>
356 The idea has flaws, of course, as you can have a patch changing the code,
357 and another changing the documentation, but splitting a list of commits
358 in that way is a first step to sort out my <i>my-next</i> mess, where I have
359 a linear perl of not-necessarily-dependent commits.
360 </p><p>
361 And actually, my whole rebase revamp aimed at the clean-up for my own
362 <i>my-next</i> branch, so I am currently writing a script that can be used
363 as a GIT_EDITOR for git-rebase which implements the Darcs algorithm. Kind of:
364 the result is not implicit, but explicit and can be fixed up later.]]></description>
365 </item>
366 <item>
367 <title>Showing off that you're an Alpine user ... priceless!</title>
368 <link>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233102919</link>
369 <guid>http://repo.or.cz/w/git/dscho.git?a=blob_plain;hb=blog;f=index.html#1233102919</guid>
370 <pubDate>Wed, 28 Jan 2009 01:35:19 +0100</pubDate>
371 <description><![CDATA[Showing off that you're an Alpine user ... priceless!
372 </p><p>
373 So I was in a hurry to send the patches, and sent all the patches as replies
374 to the cover-letter, and therefore typed in <i>rnyn</i> all the time, which is the
375 mantra I need to say to Alpine for <i>Reply</i>, ... include quoted message?
376 <i>No</i>, ... reply to all recipients? <i>Yes</i>, ... use first role?
377 <i>No, use default role</i>.
378 </p><p>
379 That was pretty embarassing, as it shows everybody that I still do not trust
380 <i>send-email</i>, and rather paste every single patch by hand. Which is rather
381 annoying.
382 </p><p>
383 So I started using format-patch today, to output directly to Alpine's
384 <i>postponed-msgs</i> folder, so that I can do some touchups in the mailer
385 before sending the patch series on its way.
386 </p><p>
387 However, when running format-patch with <i>--thread</i>, it generates Message-ID
388 strings that Alpine does not like, and therefore replaces.
389 </p><p>
390 Oh, well, I'll probably just investigate how the Message-IDs are supposed to
391 look, and then use sed to rewrite the generated ones by Alpine-friendly ones
392 during the redirection to <i>postponed-msgs</i>.
393 </p><p>
394 But I alread realized that doing it that way is dramatically faster than the
395 workflow I had before.
396 </p><p>
397 And safer: no more <i>rnyn</i>.]]></description>
398 </item>
399 </channel>
400 </rss>