Housekeeping on Friday, 19th of June, Anno Domini MMIX, at the hour of the Monkey
[git/dscho.git] / index.html
blobec768017858ea196d5ea6bef5880444e6afe6bb2
1 <html>
2 <head>
3 <title>Dscho's Git log</title>
4 <meta http-equiv="Content-Type"
5 content="text/html; charset=UTF-8"/>
6 </head>
7 <body style="width:800px;background-image:url(dscho.git?a=blob_plain;hb=832be85c785c80202f17b87db7f063ae57ec2cac;f=paper.jpg);background-repeat:repeat-y;background-attachment:scroll;padding:0px;">
8 <div style="width:610px;margin-left:120px;margin-top:50px;align:left;vertical-align:top;">
9 <h1>Dscho's Git log</h1>
10 <div style="position:absolute;top:50px;left:810px;width=400px">
11 <table width=400px bgcolor=#e0e0e0 border=0>
12 <tr><th>Table of contents:</th></tr>
13 <tr><td>
14 <p><ul>
15 <li><a href=#1242408298>15 May 2009 Wasting way too much time on msysGit</a>
16 <li><a href=#1241995759>11 May 2009 Working on jgit diff</a>
17 <li><a href=#1239975597>17 Apr 2009 No time for Git</a>
18 <li><a href=#1238970571>06 Apr 2009 How to recover from a hackathon</a>
19 <li><a href=#1236554268>09 Mar 2009 So, what is missing from my <i>rebase-i-p</i> branch?</a>
20 <li><a href=#1236479389>08 Mar 2009 New Git for Windows version</a>
21 <li><a href=#1235092615>20 Feb 2009 Code reviews</a>
22 <li><a href=#1234409395>12 Feb 2009 Interactive <i>rebase</i> just learnt a new command: <i>topic</i></a>
23 <li><a href=#1234320806>11 Feb 2009 Thunderbird, oh Thunderbird, you always make my small brain hurt</a>
24 <li><a href=#1234141489>09 Feb 2009 <i>format-patch --thread</i> and Alpine</a>
25 </ul></p>
26 <a href=dscho.git?a=blob_plain;hb=da892e0e981fc68e7c4b971fdbff389c65604cbf;f=index.html>Older posts</a>
27 </td></tr></table>
28 <br>
29 <div style="text-align:right;">
30 <a href="dscho.git?a=blob_plain;hb=blog;f=blog.rss"
31 title="Subscribe to my RSS feed"
32 class="rss" rel="nofollow"
33 style="background-color:orange;text-decoration:none;color:white;font-family:sans-serif;">RSS</a>
34 </div>
35 <br>
36 <table width=400px bgcolor=#e0e0e0 border=0>
37 <tr><th>About this blog:</th></tr>
38 <tr><td>
39 <p>It is an active <a href=http://repo.or.cz/w/git/dscho.git?a=blob_plain;f=index.html;hb=5f002cab57a837125a8f901bcd1f3c1477bc3119>abuse</a> of <a href=http://repo.or.cz/>repo.or.cz</a>,
40 letting gitweb unpack the objects in the current tip of the branch <i>blog</i>,
41 including the images and the RSS feed.
42 </p><p>
43 Publishing means running a script that collects the posts, turns them into
44 HTML, makes sure all the images are checked in, and pushes the result.
45 </p><p>
46 This blog also serves to grace the world with Dscho's random thoughts on and
47 around Git.
48 </p>
49 </td></tr></table>
50 <br>
51 <table width=400px bgcolor=#e0e0e0 border=0>
52 <tr><th>Links:</th></tr>
53 <tr><td>
54 <ul>
55 <li> <a href=http://git-scm.com/>Git's homepage</a>
56 <li> <a href=http://gitster.livejournal.com/>Junio's blog</a>
57 <li> <a href=http://www.spearce.org/>Shawn's blog</a> seems to be sitting
58 idle ever since he started working for Google...
59 <li> <a href=http://torvalds-family.blogspot.com/>Linus' blog</a> does not
60 talk much about Git...
61 <li> Scott Chacon's <a href=http://whygitisbetterthanx.com/>Why Git is better
62 than X</a> site
63 <li> <a href=http://vilain.net/>The blog of mugwump</a>
64 <li> <a href=http://merlyn.vox.com/>Merlyn's blog</a>
65 <li> <a href=http://blogs.gnome.org/newren/>Elijah Newren</a> chose the
66 same path as Cogito, offering an alternative porcelain (an approach
67 that is doomed in my opinion)
68 <li> <a href=http://msysgit.googlecode.com/>The msysGit project</a>, a (mostly)
69 failed experiment to lure the many Windows developers out there to
70 contribute to Open Source for a change.
71 </ul>
72 </td></tr></table>
73 <br>
74 <table width=400px bgcolor=#e0e0e0 border=0>
75 <tr><th>Google Ads:</th></tr>
76 <tr><td>
77 <script type="text/javascript"><!--
78 google_ad_client = "pub-5106407705643819";
79 /* 300x250, created 1/22/09 */
80 google_ad_slot = "6468207338";
81 google_ad_width = 300;
82 google_ad_height = 250;
83 //-->
84 </script>
85 <script type="text/javascript"
86 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
87 </script>
88 </td></tr></table>
89 </div>
90 <h6>Friday, 15th of May, Anno Domini MMIX, at the hour of the Dog</h6>
91 <a name=1242408298>
92 <h2>Wasting way too much time on msysGit</h2>
94 <p>
95 </p><p>
96 I recently got into the bad habit of spending a large amount of my waking
97 hours working on msysGit, more than is really healthy for me.
98 </p><p>
99 For example, I spent the whole morning -- when I should have worked on a
100 very important day-job project -- on trying to fix issue 258, where
101 <i>git web--browse</i> does not work as expected because of quoting issues
102 with cmd.exe.
103 </p><p>
104 This is reducing my Git time budget to negative numbers, so much so that I
105 cannot even work on Git projects that I actually like, such as <i>jgit diff</i>
106 or <i>git rebase -i -p</i>, or at least projects I felt obliged to continue
107 to work on, such as <i>git notes</i>.
108 </p><p>
109 Now, some people who tried to teach me some time management strongly
110 criticized me for ignoring their lessons, and unfortunately, I have to agree.
111 </p><p>
112 The problem is that I would <u>hate</u> to see msysGit fall to the same state it
113 was after I stopped working on it last year. I started it, and I would like
114 it to grow, but too few people took care of the issue tracker, too few tried
115 to debug their problems themselves, too few submitted fixes.
116 </p><p>
117 I note, though, that there is a positive trend. But being the impatient person
118 I am ("2 seconds is my attention span") I tend to want the trend to be more
119 impressive.
120 </p><p>
121 Anyway, no work on msysGit for at least 4 days, that's what the doctor (me)
122 said...
123 </p>
124 <h6>Monday, 11th of May, Anno Domini MMIX, at the hour of the Rat</h6>
125 <a name=1241995759>
126 <h2>Working on jgit diff</h2>
129 </p><p>
130 Shawn did so many useful things that I use on a daily basis that I felt really
131 awful when I realized just how <u>long</u> I had promised to clean up that diff
132 implementation I wrote for JGit.
133 </p><p>
134 Alas, it appears that the thing turned out to be almost a complete rewrite, as
135 the original implementation walked the edit graph in a rather inefficient way.
136 </p><p>
137 A little background: Myers' algorithm to generate "an edit script" works on
138 the <i>edit graph</i>: imagine you have all lines of file <i>A</i> as columns and
139 all lines of file <i>B</i> as rows, then the <i>edit graph</i> is a connection of
140 the upper left corner to the lower right corner, containing only horizontal,
141 vertical or diagonal elements, where diagonal elements are only allowed when
142 the lines of both files agree at that point:
143 </p><p>
144 <pre>
145 H E L L O , W O R L D
146 ----
152 --------
153 </pre>
154 </p><p>
155 The <i>shortest</i> edit path minimizes the number of non-diagonal elements.
156 </p><p>
157 Myers' idea is to develop forward and backward paths at the same time
158 (increasing the number of non-diagonal elements uniformly), storing
159 only the latest end points. Once the paths meet, divide and conquer.
160 </p><p>
161 In theory, it would be quicker to store <u>all</u> end points and then just
162 reconstruct the shortest paths, alas, this takes way too much memory.
163 </p><p>
164 My first implementation did not remember start or end of the non-diagonal
165 parts, and had to recurse way more often than really necessary (in the end,
166 we will order the non-diagonal parts into horizontal and vertical parts
167 anyway, so start and end are sufficient).
168 </p><p>
169 The current progress can be seen <a href=http://repo.or.cz/w/egit/dscho.git/>
170 here</a>.
171 </p>
172 <h6>Friday, 17th of April, Anno Domini MMIX, at the hour of the Monkey</h6>
173 <a name=1239975597>
174 <h2>No time for Git</h2>
177 </p><p>
178 It is a shame, but most of my Git time budget is taken by msysGit these
179 days.
180 </p><p>
181 But at least msysGit is moving again; I'll probably write a Herald about
183 </p>
184 <h6>Monday, 6th of April, Anno Domini MMIX, at the hour of the Rat</h6>
185 <a name=1238970571>
186 <h2>How to recover from a hackathon</h2>
189 </p><p>
190 Phew, 2 crazy and fantastic weeks are behind me. But it takes its toll:
191 a weekend I was more offline than online.
192 </p><p>
193 Things that are important now: relax. sleep. take a walk. learn to sleep
194 more than 4 hours a night again. learn to watch a movie without thinking
195 about code. go for a run.
196 </p><p>
197 And after recovering, back to the rebase-i-p branch!
198 </p>
199 <h6>Monday, 9th of March, Anno Domini MMIX, at the hour of the Rat</h6>
200 <a name=1236554268>
201 <h2>So, what is missing from my <i>rebase-i-p</i> branch?</h2>
204 </p><p>
205 I regularly use <i>rebase -i -p</i> these days, to update my personal Git
206 tree (which used to be <i>my-next</i>).
207 </p><p>
208 There are a few things missing before I can start assembling a patch
209 series for submission:
210 </p><p>
211 <ul>
212 <li>I need to handle the commit parents which are outside of the rebased
213 ones properly. In other words, when a commit is picked whose parent is
214 not rebased, it needs to be rebased onto $ONTO.
215 <li>The patch which uses patch-id to generate DROPPED directly also tries to
216 consolidate the handling of DROPPED commits by putting them into REWRITTEN
217 instead of DROPPED, but that breaks the tests. So, this patch needs to be
218 split.
219 <li>I want to introduce one more command, <i>rephrase</i>, which allows you to
220 modify the commit message, and nothing more, and <i>halt</i>, which does the
221 same as <i>edit</i> without <i>pick</i>. Then there needs to be a new test script
222 for those commands, and this will be an early patch series.
223 <li>Time. I need time, desperately. If my day job was not as exciting as it
224 is, I would have more time for Git. As it is, I have to budget my time so
225 that I get anything done at all.
226 </ul>
227 </p><p>
228 These issues have been postponed due to Steffen taking a well-deserved
229 vacation, which means that I have to act as msysGit maintainer again.
230 </p><p>
231 And this coming week, I will have other things to do in all likeliness, so
232 that I expect to be able to submit a <i>rebase -i -p</i> patch series only next
233 week. If not then, due to a heavy workload, it will be postponed to early
234 April.
235 </p><p>
236 Oh well, the joys of being excited by several competing projects! &#x263a;
237 </p>
238 <h6>Sunday, 8th of March, Anno Domini MMIX, at the hour of the Tiger</h6>
239 <a name=1236479389>
240 <h2>New Git for Windows version</h2>
243 </p><p>
244 Phew. That was quite a day, almost exclusively spent on finishing that
245 installer. The worst part: updating GCC seemed not to be such a good idea
246 after all...
247 </p><p>
248 For Windows, we need to use the printf format <i>%I64u</i> (which is
249 non-standard, in the common way of Microsoft) if you want to print 64-bit
250 wide unsigned numbers. The rest of the world accepts the standard <i>%llu</i>.
251 </p><p>
252 After upgrading to the new GCC, a lot of warnings appeared, complaining
253 about <i>%I64u</i>. The warnings went away when I replaced the format with
254 <i>%llu</i>.
255 </p><p>
256 Being the naive I am, I mistook that for a sign that we could finally go
257 more standards-compliant.
258 </p><p>
259 However, it only means that we have to live with the warnings for now, as
260 the C runtime provided on Windows still strongly disagrees with standards
261 (and it has to continue to do so, lest it break existing programs).
262 </p><p>
263 Sigh.
264 </p><p>
265 At least I have the feeling that I caught the most important bugs before
266 releasing.
267 </p>
268 <h6>Friday, 20th of February, Anno Domini MMIX, at the hour of the Buffalo</h6>
269 <a name=1235092615>
270 <h2>Code reviews</h2>
273 </p><p>
274 It has been said that reviewing patches is a most thankless job. As I really
275 like the elegance of Git's source code, and care a lot about it, I did not
276 think that it was thankless, just a little bit tedious (especially when the
277 patch authors mistake criticism for personal attacks).
278 </p><p>
279 Usually, I am pretty good at ignoring insults as responses to my comments;
280 after all, I have a lot more enjoyable things to do than to spend time talking
281 to a guy who shows how wise he is when he thinks that I criticize him
282 <u>personally</u> when I just try to enhance his work, by offering a little bit of
283 my knowledge.
284 </p><p>
285 However, in the last days, three people really seemed to want to insult me,
286 to make me go away, to stop the fun I have with Git.
287 </p><p>
288 And they almost succeeded.
289 </p><p>
290 So I guess it is time to reassess my priorities, and maybe stop reviewing
291 Git patches altogether.
292 </p>
293 <h6>Thursday, 12th of February, Anno Domini MMIX, at the hour of the Tiger</h6>
294 <a name=1234409395>
295 <h2>Interactive <i>rebase</i> just learnt a new command: <i>topic</i></h2>
298 </p><p>
299 Today I am pretty pleased with myself. Two projects at my day job got a real
300 boost, and I implemented a shortcut that avoids the ugly 'bookmark' statement
301 in rebase scripts most of the time.
302 </p><p>
303 A typical rebase script, generated by <i>git rebase -i -p $COMMIT</i> will look
304 something like this:
305 </p><p>
306 <table
307 border=1 bgcolor=black>
308 <tr><td bgcolor=lightblue colspan=3>
309 <pre> </pre>
310 </td></tr>
311 <tr><td>
312 <table cellspacing=5 border=0
313 style="color:white;">
314 <tr><td>
315 <pre>
316 pick 1234567 My first commit
317 topic begin super-cool-feature
318 pick 2345678 The super cool feature
319 pick 3456789 Documentation for the super cool feature
320 topic end super-cool-feature
321 </pre>
322 </td></tr>
323 </table>
324 </td></tr>
325 </table>
326 </p><p>
327 The result will be a merge commit at the HEAD whose first parent is
328 "My first commit", whose second parent is "Documentation for the super
329 cool feature" and whose commit message is "Merge branch 'super-cool-feature'".
330 </p><p>
331 Side note: internally, <i>topic begin $NAME [at $COMMIT]</i> will be handled as if
332 you wrote <i>bookmark merge-parent-of-$NAME; goto $COMMIT</i>, and
333 <i>topic end $NAME [$MESSAGE]</i> will be handled as if you wrote
334 <i>bookmark $NAME; goto merge-parent-of-$NAME; merge parents $NAME [original $MARK Merge branch '$NAME']</i>.
335 </p><p>
336 Of course, being more concise, the 'topic' statement is not only nicer to the
337 eye, but also less error-prone.
338 </p><p>
339 And hopefully many people will agree with me that this rebase script is pretty
340 intuitive.
341 </p>
342 <h6>Wednesday, 11th of February, Anno Domini MMIX, at the hour of the Tiger</h6>
343 <a name=1234320806>
344 <h2>Thunderbird, oh Thunderbird, you always make my small brain hurt</h2>
347 </p><p>
348 There was a lengthy discussion on the Git mailing list about using Thunderbird,
349 a not quite unpopular mailing program, to send inline patches.
350 </p><p>
351 It is really kind of sad that the Thunderbird developers do not see how
352 stubbornly they offend quite a number of people and scare them away from their
353 program. After all, you should try to be liberal in what you accept and strict
354 in what you emit. No, that does not mean that you should force others to
355 switch their mailers because you strictly adher to your philosophy in what you
356 emit, ignoring the rest of the world.
357 </p><p>
358 In any case, I am not affected (as long as I do not get mails from a poor soul
359 stuck with Thunderbird).
360 </p><p>
361 But I was a bit mean to that Thunderbird guy I dragged into the discussion, and
362 he seems really offended.
363 </p><p>
364 So I thought I'd give him a real reason to feel offended: I'll just do his work:
365 </p><p>
366 http://repo.or.cz/w/UnFlowedThunderbird.git
367 </p><p>
368 It took my free time of two days, being not a Thunderbird developer myself.
369 Hopefully it works, and hopefully some people will feel really ashamed now.
370 </p>
371 <h6>Monday, 9th of February, Anno Domini MMIX, at the hour of the Buffalo</h6>
372 <a name=1234141489>
373 <h2><i>format-patch --thread</i> and Alpine</h2>
376 </p><p>
377 I started recently to pipe the output of
378 <i>git format-patch --cover-letter --stdout ...</i> directly into the
379 <i>postponed-msgs</i> folder Alpine uses, instead of pasting files into the
380 mailer.
381 </p><p>
382 The idea is to pretend that I continue a postponed mail, but in reality I
383 never wrote it, <i>format-patch</i> did.
384 </p><p>
385 However, I had problems with the <i>--thread</i> option that is implied by
386 <i>--cover-letter</i>. Alpine always generated new message IDs without adjusting
387 the <i>In-reply-to:</i> and <i>References:</i> headers of the other mails.
388 </p><p>
389 Now I found out that the reason is that the <i>Fcc:</i> headers were missing in
390 the mails, and Alpine generated them, making up new message IDs in the process.
391 </p><p>
392 Therefore I have an alias now which sets not only the <i>Fcc:</i> header, but also
393 the <i>To:</i> headers by rewriting the stream using <i>sed</i>. This is slightly
394 ugly, but so is the handling of headers in <i>format-patch</i>: if you thought
395 you could specify arbitrary headers using the command line, you are mistaken:
396 you can do that only by editing the config.
397 </p><p>
398 While at it, I also noticed a bug whereby <i>--thread --in-reply-to=...</i> simply
399 forgets the <i>--thread</i>. Maybe this week I will find time to address this bug.
400 </p>
401 </div>
402 </body>
403 </html>