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