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