Commit some images on Sunday, 25th of January, Anno Domini MMIX, at the hour of the...
[git/dscho.git] / index.html
blob0680237fb046d64a0cf38b49d1e9dcbf67b90a90
1 <html>
2 <head>
3 <title>Dscho's blog</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=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;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 blog</h1>
10 <div style="position:absolute;top:50px;left:810px;width=400px">
11 <table width=400px bgcolor=#e0e0e0 border=1>
12 <tr><th>Table of contents:</th></tr>
13 <tr><td>
14 <p><ul>
15 <li><a href=#1232888842>25 Jan 2009 Regular diff with word coloring (as opposed to word diff)</a>
16 <li><a href=#1232828715>24 Jan 2009 Ideas for a major revamp of the <i>--preserve-merges</i> handling in <i>git rebase</i></a>
17 <li><a href=#1232778113>24 Jan 2009 Thoughts about <i>interactive rebase</i></a>
18 <li><a href=#1232745071>23 Jan 2009 Git Logos</a>
19 <li><a href=#1232742582>23 Jan 2009 How to deal with files that are not source code when merging</a>
20 <li><a href=#1232626236>22 Jan 2009 The UGFWIINI contest</a>
21 <li><a href=#1232611542>22 Jan 2009 Top-posting</a>
22 <li><a href=#1232607201>22 Jan 2009 Sverre's hat</a>
23 <li><a href=#1232604722>22 Jan 2009 Let there be images!</a>
24 <li><a href=#1232599693>22 Jan 2009 My blog has style</a>
25 </ul></p>
26 <a href=dscho.git?a=blob_plain;hb=d6f05382ca9cc377d05499544424e670acdfc7b9;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=1>
37 <tr><th>Links:</th></tr>
38 <tr><td>
39 <ul>
40 <li> <a href=http://git-scm.com/>Git's homepage</a>
41 <li> <a href=http://gitster.livejournal.com/>Junio's blog</a>
42 <li> <a href=http://www.spearce.org/>Shawn's blog</a> seems to be sitting
43 idle ever since he started working for Google...
44 <li> <a href=http://torvalds-family.blogspot.com/>Linus' blog</a> does not
45 talk much about Git...
46 <li> Scott Chacon's <a href=http://whygitisbetterthanx.com/>Why Git is better
47 than X</a> site
48 <li> <a href=http://vilain.net/>The blog of mugwump</a>
49 <li> <a href=http://blogs.gnome.org/newren/>Elijah Newren</a> chose the
50 same path as Cogito, offering an alternative porcelain (an approach
51 that is doomed in my opinion)
52 <li> <a href=http://msysgit.googlecode.com/>The msysGit project</a>, a (mostly)
53 failed experiment to lure the many Windows developers out there to
54 contribute to Open Source for a change.
55 </ul>
56 </td></tr></table>
57 <br>
58 <table width=400px bgcolor=#e0e0e0 border=1>
59 <tr><th>Google Ads:</th></tr>
60 <tr><td align=center>
61 <script type="text/javascript"><!--
62 google_ad_client = "pub-5106407705643819";
63 /* 300x250, created 1/22/09 */
64 google_ad_slot = "6468207338";
65 google_ad_width = 300;
66 google_ad_height = 250;
67 //-->
68 </script>
69 <script type="text/javascript"
70 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
71 </script>
72 </td></tr></table>
73 </div>
74 <h6>Sunday, 25th of January, Anno Domini MMIX, at the hour of the Goat</h6>
75 <a name=1232888842>
76 <h2>Regular diff with word coloring (as opposed to word diff)</h2>
78 <p>
79 </p><p>
80 You know, if I were a bit faster with everything I do, I could do so much more!
81 </p><p>
82 For example, Junio's idea that you could keep showing a regular diff, only
83 coloring the words that have been removed/deleted.
84 </p><p>
85 Just imagine looking at the diff of a long line in LaTeX source code. It
86 should be much nicer to the eye to see the complete removed/added sentences
87 instead of one sentence with colored words in between, disrupting your read
88 flow.
89 </p><p>
90 Compare these two versions:
91 </p><p>
92 Regular diff with colored words:
93 <blockquote><tt>
94 -This sentence has a <font color=red>tyop</font> in it.<br>
95 +This sentence has a <font color=green>typo</font> in it.<br>
96 </tt></blockquote>
97 </p><p>
98 Word diff:
99 <blockquote><tt>
100 This sentence has a <font color=red>tyop</font><font color=green>typo</font> in it.<br>
101 </tt></blockquote>
102 </p><p>
103 And it should not be hard to do at all!
104 </p><p>
105 In <i>diff&#95;words&#95;show()</i>, we basically get the minus lines as
106 <i>diff&#95;words->minus</i> and the plus lines as <i>diff&#95;words->plus</i>. The
107 function then prepares the word lists and calls the xdiff engine to do all the
108 hard work, analyzing the result from xdiff and printing the lines in
109 <i>fn&#95;out&#95;diff&#95;words&#95;aux()</i>.
110 </p><p>
111 So all that would have to be changed would be to <u>record</u> the positions
112 of the removed/added words instead of outputting them, and at the end printing
113 the minus/plus buffers using the recorded information to color the words.
114 </p><p>
115 This would involve
116 </p><p>
117 <ul>
118 <li>adding two new members holding the offsets in the <i>diff&#95;words</i>
119 struct,
120 <li>having a special handling for that mode in
121 <i>fn&#95;out&#95;diff&#95;words&#95;aux()</i> that appends the offsets and
122 returns,
123 <li>adding a function <i>show&#95;lines&#95;with&#95;colored&#95;words()</i> that
124 outputs a buffer with a given prefix ('-' or '+') and coloring the words at
125 given offsets with a given color,
126 <li>modify <i>diff&#95;words&#95;show()</i> to call that function for the "special
127 case: only removal" and at the end of the function, and
128 <li> disabling the <i>fwrite()</i> at the end of <i>diff<u>words</u>show()</i> for that
129 mode.
130 </ul>
131 </p><p>
132 Of course, the hardest part is to find a nice user interface for that. Maybe
133 <i>--colored-words</i>? &#x263a;
134 </p>
135 <h6>Saturday, 24th of January, Anno Domini MMIX, at the hour of the Pig</h6>
136 <a name=1232828715>
137 <h2>Ideas for a major revamp of the <i>--preserve-merges</i> handling in <i>git rebase</i></h2>
140 </p><p>
141 As probably everybody agrees, the code to preserve merges is a big mess
142 right now.
143 </p><p>
144 Worse, the whole concept of "pick <merge-sha1>" just does not fly well.
145 </p><p>
146 So I started a <u>major</u> cleanup, which happens to reduce the code very
147 nicely so far.
148 </p><p>
149 It will take a few days to flesh out, I guess, but these are the major
150 ideas of my work:
151 </p><p>
152 <b>pick $sha1</b><br>
153 <blockquote>will only work on non-merges in the future.</blockquote>
154 <b>merge $sha1 [$sha1...] was $sha1 Merge ...</b><br>
155 <blockquote>will merge the given list of commits into the current HEAD, for
156 the user's reference and to keep up-to-date what was rewritten,
157 the original merge is shown after the keyword "was" (which is not
158 a valid SHA-1, luckily).</blockquote>
159 <b>goto $sha1</b><br>
160 <blockquote>will reset the HEAD to the given commit.</blockquote>
161 <b>$sha1'</b><br>
162 <blockquote>for merge and goto, if a $sha1 ends in a single quote, the
163 rewritten commit is substituted (if there is one).</blockquote>
164 </p><p>
165 Example:
166 </p><p>
167 <pre>
168 A - B - - - E
170 C - D
171 </pre>
172 </p><p>
173 could yield this TODO script:
174 </p><p>
175 <pre>
176 pick A
177 pick C
178 pick D
179 goto A'
180 pick B
181 merge D' was E
182 </pre>
183 </p><p>
184 This should lead to a much more intuitive user experience.
185 </p><p>
186 I am very sorry if somebody actually scripted <i>rebase -i -p</i> (by setting
187 GIT_EDITOR with a script), but I am very certain that this cleanup is
188 absolutely necessary to make <i>rebase -i -p</i> useful.
189 </p>
190 <h6>Saturday, 24th of January, Anno Domini MMIX, at the hour of the Dragon</h6>
191 <a name=1232778113>
192 <h2>Thoughts about <i>interactive rebase</i></h2>
195 </p><p>
196 Somebody mentioned that my <i>my-next</i> branch is a mess, as it mixes all
197 kinds of topics.
198 </p><p>
199 That is undeniably true, however, there is a good reason that I do not
200 have a lot of topic branches: I work on more than just one computer.
201 </p><p>
202 To make sure that I do not lose a commit by mistake, I always <i>rebase -i</i>
203 the <i>my-next</i> branch of the computer I happen to work on on top of the
204 <i>my-next</i> branch I fetch from <a href=http://repo.or.cz>repo.or.cz</a>.
205 </p><p>
206 To rebase a lot of topic branches at the same time seems a bit complicated.
207 But that is actually what the <i>-p</i> option (preserve merges) is all about.
208 </p><p>
209 The only problem is that the code for <i>rebase -i -p</i> has been messed up
210 recently, quite successfully, I might add.
211 </p><p>
212 Worse, some people are pushing for a completely and total unintuitive syntax.
213 </p><p>
214 So maybe I will start to work on <i>-p</i> again, for my own use (I should learn
215 to heed the principle more: work on things I can use myself).
216 </p><p>
217 My current idea is to implement a "goto" statement that will jump to another
218 commit. To make it easily usable, I will add the semantics that "goto" will
219 always try to go to the <u>rewritten</u> version of the given commit; if the user
220 wanted to have the original commit, she has to paste the unabbreviated commit
221 name.
222 </p><p>
223 The more I think about it, the more I actually like this idea &#x263a;
224 </p><p>
225 Of course, working on this little project means that I will have to cope with
226 that ugly code again. *urgh*
227 </p>
228 <h6>Friday, 23rd of January, Anno Domini MMIX, at the hour of the Pig</h6>
229 <a name=1232745071>
230 <h2>Git Logos</h2>
233 </p><p>
234 The other day, when I did not exactly have too much time on my hands, but
235 definitely too much motivation, I played around creating several logos.
236 </p><p>
237 An ambigram (if you turn it 180 degrees around the appropriate axis, it looks
238 exactly the same as unrotated):
239 </p><p>
240 <center>
241 <table border=0>
242 <tr>
243 <td align=center>
244 <embed type="image/svg+xml"
245 src="dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=git-ambigram.svg" width=317 />
246 </td>
247 </tr>
248 <tr>
249 <td align=center>
250 <a href=dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=git-ambigram.svg>git-ambigram.svg</a>
251 </td>
252 </tr>
253 </table>
254 </center>
255 </p><p>
256 A play on gitk:
257 </p><p>
258 <center>
259 <table border=0>
260 <tr>
261 <td align=center>
262 <embed type="image/svg+xml"
263 src="dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=git-gitk-logo.svg" width=325 />
264 </td>
265 </tr>
266 <tr>
267 <td align=center>
268 <a href=dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=git-gitk-logo.svg>git-gitk-logo.svg</a>
269 </td>
270 </tr>
271 </table>
272 </center>
273 </p><p>
274 A play on the test you have to go through before getting new glasses:
275 </p><p>
276 <center>
277 <table border=0>
278 <tr>
279 <td align=center>
280 <embed type="image/svg+xml"
281 src="dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=git-visual-test.svg" width=325 />
282 </td>
283 </tr>
284 <tr>
285 <td align=center>
286 <a href=dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=git-visual-test.svg>git-visual-test.svg</a>
287 </td>
288 </tr>
289 </table>
290 </center>
291 </p><p>
292 This is Henrik Nyh's logo (converted to .svg by yours truly):
293 </p><p>
294 <center>
295 <table border=0>
296 <tr>
297 <td align=center>
298 <embed type="image/svg+xml"
299 src="dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=gitlogo.svg" width=165 />
300 </td>
301 </tr>
302 <tr>
303 <td align=center>
304 <a href=dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=gitlogo.svg>gitlogo.svg</a>
305 </td>
306 </tr>
307 </table>
308 </center>
309 </p><p>
310 And of course, the original logo...
311 </p><p>
312 <center>
313 <table border=0>
314 <tr>
315 <td align=center>
316 <embed type="image/svg+xml"
317 src="dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=original-git-logo.svg" width=165 />
318 </td>
319 </tr>
320 <tr>
321 <td align=center>
322 <a href=dscho.git?a=blob_plain;hb=aaa9edafbe6ca5349ad7b36848fb294e5f4fc529;f=original-git-logo.svg>original-git-logo.svg</a>
323 </td>
324 </tr>
325 </table>
326 </center>
327 </p><p>
328 Maybe some of you have fun with them...
329 </p>
330 <h6>Friday, 23rd of January, Anno Domini MMIX, at the hour of the Pig</h6>
331 <a name=1232742582>
332 <h2>How to deal with files that are not source code when merging</h2>
335 </p><p>
336 Last week, one of the mentors of last year's <a href=http://code.google.com/soc>
337 Summer of Code</a> mentioned the idea that merge strategies are in dear need
338 for file types other than source code.
339 </p><p>
340 I think this idea is awesome, even if I cannot bring myself to believe that
341 any of the file types would make a good Summer of Code project: either they
342 are too complicated (think raster images such as .png or even .jpg), or they
343 are too straight-forward (think LaTeX, where all that is needed is a good
344 graphical user interface to inspect the three versions: <i>ours</i>, <i>baseline</i>
345 and <i>theirs</i>).
346 </p><p>
347 The LaTeX idea would be a good project for me to mentor, though: I have a
348 pretty clear idea how it should be done; I just lack the time (and motivation)
349 to do it myself.
350 </p><p>
351 As for OpenOffice text documents, vector graphics (such as .svg), or more
352 specific data such as spreadsheets, I think that all of these are really
353 difficult: the problem is not so much the implementation (i.e. the programming
354 part of it), but the design.
355 </p><p>
356 This design should involve much more than a Summer of Code project is about:
357 you would need to survey users' expectations, and at least the mentor -- if
358 not the student -- would need to be an expert in usability questions, which
359 is rather unlikely in the realm of Open Source.
360 </p><p>
361 Maybe this is the missing part in Open Source: we have many brilliant
362 programmers, but next to nobody with a good idea how to design intuitive
363 user interfaces.
364 </p><p>
365 That might be related to the fact that brilliant software engineers, as they
366 can be found in Open Source, are not exactly known for their social skills,
367 a human trait that seems to be a very important prerequisite for designing
368 intuitive user interfaces.
369 </p><p>
370 Well, I have <a href=http://git.or.cz/gitwiki/SoC2009Ideas#head-6188833471f79f277e162ef9fbe1592aa10b5f6c>
371 added</a> the proposal to Git's Summer of Code idea page on the Git Wiki; We will
372 see what comes out of it.
373 </p>
374 <h6>Thursday, 22nd of January, Anno Domini MMIX, at the hour of the Goat</h6>
375 <a name=1232626236>
376 <h2>The UGFWIINI contest</h2>
379 </p><p>
380 Just in case somebody finds this blog, here is a challenge. Inspired by my
381 own little hack (this blog), I announce the "Using Git For What It Is Not
382 Intended" contest.
383 </p><p>
384 And it is especially cool, since the acronym sounds cool! You might miss
385 this fact if you do no know that I pronounce the "F" like an "A" so that
386 it sounds cool.
387 </p><p>
388 This will be a running contest; whenever I have 10 valid applications, I
389 will announce a winner on the Git mailing list.
390 </p><p>
391 So, what accounts for a valid application?
392 </p><p>
393 <ul>
394 <li> You must use a Git program (the term is used loosely here, GitWeb is
395 considered a Git program, for example).
396 <li> The program must be intended for something completely different than
397 what you are using it for. E.g. GitWeb -- which was intended to let
398 you browse through the history using your web browser -- is used
399 to serve a blog to the wide world.
400 <li> You must be able to prove that you actually used the Git program to
401 the purpose you claim, preferably in a live demonstration like this
402 one.
403 <li> Nobody and nothing must be harmed in the process (except your
404 laughing muscle, that's okay).
405 </ul>
406 </p><p>
407 So, how does such an abuse look like?
408 </p><p>
409 <ul>
410 <li> ... like this blog.
411 <li> Managing your mail (in maildir format) in a Git repository.
412 <li> Finding duplicate files by
413 <table
414 border=1 bgcolor=black>
415 <tr><td bgcolor=lightblue colspan=3>
416 &nbsp;
417 </td></tr>
418 <tr><td>
419 <table cellspacing=5 border=0
420 style="color:white;">
421 <tr><td>
422 <pre>
423 $ git init
424 $ git add .
425 $ git ls-files --stage | sort -k2 | uniq -d -s7 -w40
426 </pre>
427 </td></tr>
428 </table>
429 </td></tr>
430 </table>
431 <li> Abusing the Git alias mechanism to call scripts defined directly in
432 the config.
433 </ul>
434 </p><p>
435 I am really looking forward to all of your submissions... *chuckles*
436 </p><p>
437 </p>
438 <h6>Thursday, 22nd of January, Anno Domini MMIX, at the hour of the Snake</h6>
439 <a name=1232611542>
440 <h2>Top-posting</h2>
443 </p><p>
444 Okay, last post for a while. But this is something that is nagging me
445 tremendously. I should probably just let go, but in my deepest inner self,
446 really close to my heart, I refuse to believe that any human beings could
447 be incapable of certain degrees of reason.
448 </p><p>
449 Take the example of top-posting. Everybody who read a top-posted email
450 knows that you have to scroll down, possibly weeding through tons of
451 pages to find out what the heck the author of the last reply was replying
453 </p><p>
454 Never mind that it would take the author of the reply just a couple of
455 seconds to remove all the irrelevant stuff -- as she already knows what
456 is the relevant part, saving minutes, in case of mailing lists hours,
457 easily, to the readers who otherwise would have to discern what is
458 irrelevant and what is relevant first.
459 </p><p>
460 It is a horrible time waste. But of course not for the top-poster.
461 </p><p>
462 The problem is that I frequently run into such people, and when I write
463 them a polite mail, explaining to them that it is impolite to top-post,
464 and why, the answers I get sometimes make me check if the sky is still up
465 and the earth down. Yesterday was an example of such a dubitable
466 pleasure.
467 </p><p>
468 Most funny are the ridiculous attempts by those persons at explaining why
469 top-posting is <i>so</i> much superior to anything else.
470 </p><p>
471 Which is good, because if they were not that funny, they would be pretty sad.
472 </p>
473 <h6>Thursday, 22nd of January, Anno Domini MMIX, at the hour of the Dragon</h6>
474 <a name=1232607201>
475 <h2>Sverre's hat</h2>
478 </p><p>
479 The fun part about a blog is that you can talk about less technical stuff.
480 For example, Sverre's hat.
481 </p><p>
482 Let me start a bit earlier, so that you get the context.
483 </p><p>
484 Last year, at the <a href=http://git.or.cz/gitwiki/GitTogether>GitTogether</a>,
485 we had an <a href=http://en.wikipedia.org/wiki/Unconference>unconference style
486 conference</a>, which basically meant that it was our job to decide what
487 we want to talk about.
488 </p><p>
489 It turned out to be pretty hard, because there was so much we wanted to
490 discuss, and because we wanted to get to know each other, and we wanted to
491 do some hacking.
492 </p><p>
493 So to help us decide what subjects, and in which order we wanted to have
494 scheduled, Shawn opened a series on <a href=http://moderator.appspot.com/>
495 Google Moderator</a>, a nifty, yet simple application which allows a group
496 to agree quickly on an agenda.
497 </p><p>
498 It worked quite well; However, that little saboteur displayed his sense of
499 humor so overtly that some entertaining Gitter put the question "Should Sverre
500 wear a hat?" on the agenda.
501 </p><p>
502 Sure enough, the subject got voted up, and eventually, we got Sverre a hat:
503 </p><p>
504 <center><img src=dscho.git?a=blob_plain;hb=30319f7436828cd15db8a531a0057351d8e361c0;f=sverre-hat.jpg sverre-hat.jpg></center>
505 </p><p>
506 By the way, another thing I like about this blog engine is that there are no
507 comments... Nothing is more annoying than leaving a comment on a blog,
508 forgetting about it for a few months, and then finding somebody answered
509 ages ago.
510 </p><p>
511 Update: Sverre says it was dsymonds idea.
512 </p>
513 <h6>Thursday, 22nd of January, Anno Domini MMIX, at the hour of the Dragon</h6>
514 <a name=1232604722>
515 <h2>Let there be images!</h2>
518 </p><p>
519 One of the most important features of blogs is the ability to insert images.
520 So what would this blog be, if it could not present something that says
521 more than a thousand words?
522 </p><p>
523 So here it goes, my first picture in this blog, taken from my Google Tech
524 Talk in Mountain View:
525 </p><p>
526 <center><img src=dscho.git?a=blob_plain;hb=85b89d1cd73acd65ca4381be901d50287dde8170;f=all-your-rebase.png width=500px></center>
527 </p><p>
528 Now this blog starts to look like a real blog...
529 </p>
530 <h6>Thursday, 22nd of January, Anno Domini MMIX, at the hour of the Rabbit</h6>
531 <a name=1232599693>
532 <h2>My blog has style</h2>
535 </p><p>
536 It is official. The blog has a style sheet now.
537 </p><p>
538 The major problem was how to design the system such that it would work
539 both locally and on <a href=http://repo.or.cz>repo.or.cz</a> via gitweb.
540 </p><p>
541 Basically, I realized that I'd need a dry run mode anyway, to prevent
542 all my failed attemp.. oops, I meant, to prevent an accidental push
543 when I am at an, ahem, intermediate state of the 'blog' branch.
544 </p><p>
545 Therefore, I could write a different file locally, which I can load
546 into my venerable Firefox.
547 </p><p>
548 The next plans with my new toy are to enable an easy way to support
549 showing images, and then maybe a table of contents. External links
550 would be cool (<a href=http://repo.or.cz>repo.or.cz</a> does not count, it is special-cased), too.
551 </p><p>
552 And later maybe a cut-off, with automatic generation of links to older
553 posts. Hmm, for those, I'll have to change the URL to include the
554 current commit name, so that the images will be found, too...
555 </p><p>
556 Which in turn means that I'll have to parse the source for new
557 images first, so that they can be in the commit that index.html
558 will link to, <u>before</u> it gets committed. Oh well, that cannot be
559 helped! &#x263a;
560 </p>
561 </div>
562 </body>
563 </html>