ペンギンと愉快な機械の日々 このページをアンテナに追加 RSSフィード Twitter

2012-02-09

"Changed but not updated"ではなくなっていた件。

Debian勉強会にも参加している@taitiooooから

Git本で質問なんですが、53ページの「次回コミット時の状態」でChanges not staged for commit:と出た場合って、Changed but not updatedとなにが違いますか??

という質問をもらったので、調べてみました。

commit 8009d83c7e7af0a298ef858609a8201d01086396
Author: Matthieu Moy <Matthieu.Moy@imag.fr>
Date:   Tue Nov 2 16:31:19 2010 +0100

    Better "Changed but not updated" message in git-status
    
    Older Gits talked about "updating" a file to add its content to the
    index, but this terminology is confusing for new users. "to stage" is far
    more intuitive and already used in e.g. the "git stage" command name.
    
    Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --git a/wt-status.c b/wt-status.c
index fc2438f..d9f3d9f 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -88,7 +88,7 @@ static void wt_status_print_dirty_header(struct wt_status *s,
 {
        const char *c = color(WT_STATUS_HEADER, s);
 
-       color_fprintf_ln(s->fp, c, "# Changed but not updated:");
+       color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");
        if (!advice_status_hints)
                return;
        if (!has_deleted)

ということで、リビジョン8009d83cで変更されたのですね。「Gitによるバージョン管理」はバージョン1.7をベースにしているので、SidGitのバージョンは1.7.9なのでメッセージが変わっていたのですね。気づきませんでした。

変更の調べ方。

git grep "Changed but not updated"では見つからず、git grep -n "Changes not staged for commit"で下記が見つかります。

wt-status.c:169:        status_printf_ln(s, c, _("Changes not staged for commit:"));

git blameでいつ変更されたのかを確認します。

$ git blame -L169,169 wt-status.c
355ec7a1 (&#198;var Arnfj&#246;r&#240; Bjarmason 2011-02-22 23:42:13 +0000 169)        status_printf_ln(s, c, _("Changes not staged for commit:"));

これの一つ前のリビジョン(b32227e)で再度git blameを実行します。

$ git blame -L169,169 wt-status.c b32227e7
098d0e0e (Jonathan Nieder 2011-02-25 23:11:37 -0600 169)        status_printf_ln(s, c, "Changes not staged for commit:");

再度git blame。

git blame -L169,169 wt-status.c 3c624a3
8009d83c (Matthieu Moy 2010-11-02 16:31:19 +0100 169)   color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");

再度git blame。

$ git blame -L169,169 wt-status.c 7ebee44
9297f77e (Jens Lehmann 2010-03-08 13:53:19 +0100 169)                   if (d->new_submodule_commits)

と、ここで途切れたので、範囲を広げてみます。

$ git blame wt-status.c 7ebee44
(snip)
8009d83c (Matthieu Moy         2010-11-02 16:31:19 +0100  91)   color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");
(snip)

以前は91行目だったようです。もう一回git blame。

$ git blame -L91,91 wt-status.c 7ebee4416
bb914b14 (Anders Melchiorsen 2008-09-08 00:05:02 +0200 91)      color_fprintf_ln(s->fp, c, "# Changed but not updated:");

ここでメッセージが変わっています。なので、この後の変更をgit show 8009d83c wt-status.cで見ると、冒頭の変更だと分かります。もっと楽に調べる方法ないでしょうかね。git bisectと組み合わせれば良いのかなぁ…?

Gitによるバージョン管理
岩松 信洋 上川 純一 まえだこうへい 小川 伸一郎
オーム社
売り上げランキング: 22983

2012-02-08

TonicDNSをスレーブで動かす場合。

どのAPIに対してアクセスしても"Invalid request-URI"になる罠。スレーブでデータ更新は基本的にはしないのですが、PowerDNSのゾーン転送を使う場合にはそれが必要です。ゾーンの追加する時にスレーブ側のDBのdomainsテーブルにmasterサーバIPアドレスを指定し、typeをSLAVEにして登録します。ところが/authenticate経由でtokenの登録も、/zone経由で新規ゾーンの登録も更新も出来ません。POSTメソッドドメインのtypeを更新するためのメソッドupdate_domain()とは何なのか?developブランチでテストしていたので、masterブランチの挙動を確認してみてから、パッチを書こうと思います。

2012-02-07

出産ラッシュ。

と言っても、ヨメさんがマタニティ向けのヨガ&水泳教室でできた友人ばかりなので、そもそも出産日が近いので母集団に偏りがあるのでまぁ当然なのですけどね。そんなわけで、先月末くらいから結構続いています。この前の週末からはほぼ毎日のようにヨガ&水泳教室であったり、ヨメさんの昔からの友人だったり、私の前職の同期にもいたり、と。後ろの二例は偏りに入らないか。

満月が近いからなのかねー?」

とヨメさんが言っていたのですが、満月だと産気づきやすいんとかそういうのあるんでしょうか?ググってみると根拠は無いけど事例は多いようです。明日は満月なので、意外とおまめちゃんの出産もいきなり明日!ということもあるのかもしれません。さっさと寝ることにしますかね。

2012-02-06

お礼言われました。

金曜のパッチに続き、昨日のドキュメントのpull requestに対してもお礼言われました。

Thanks for your contribution mkouhei! We were actually already planning to write some usable documentation for developers. We will review your work and get back to you.

https://github.com/Cysource/TonicDNS/pull/8#issuecomment-3825532

仕事で使うのにドキュメントが必要でしたのでどうせならpull requestしておこうかなというくらいの軽い気持ちでしたが、すぐに反応がもらえるのはうれしいですね!*1

*1:開発止まっている別のは反応がまったくないので…。^^;

2012-02-05

TonicDNSのドキュメントを作成しました。

先日のTonicDNSの残タスクのうちの一つです。

TonicDNSは、README.markdownに最低限のインストール方法についてにしか書かれていません。ソースコードを読めば使い方は分かるのですが、いつもそれでは探すのが結構大変です。また仕事でも使うので、手順書作る上でドキュメントがあった方が良いので、使用方法についてのドキュメントを書きました。これもpull requestしておきました。

ちなみにこれで始めてMarkdown記法でドキュメント作成しました。慣れている分、reSTの方が楽ですね。もっともそれらよりもLaTeXの方が好きですが。