From f497de923b54c09f710d131344ce1f07315adf97 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Thu, 1 Oct 2015 01:25:45 +0900 Subject: [PATCH 01/43] =?UTF-8?q?-=20content-addressable=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=80=8D?= =?UTF-8?q?=E3=81=AB=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index c34f8439..fab73e58 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -13,7 +13,8 @@ You can insert any kind of content into it, and it will give you back a key that To demonstrate, you can use the plumbing command `hash-object`, which takes some data, stores it in your `.git` directory, and gives you back the key the data is stored as. First, you initialize a new Git repository and verify that there is nothing in the `objects` directory: ////////////////////////// -Git は連想記憶ファイル・システムです。素晴らしい。…で、それはどういう意味なのでしょう?それは、Git のコアの部分が単純なキーバリューから成り立つデータストアである、という意味です。`hash-object` という配管コマンドを使用することで、それを実際にお見せすることができます。そのコマンドはあるデータを取り出して、それを `.git` ディレクトリに格納し、そのデータが格納された場所を示すキーを返します。まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 +Git は内容アドレスファイルシステムです。 +素晴らしい。…で、それはどういう意味なのでしょう?それは、Git のコアの部分が単純なキーバリューから成り立つデータストアである、という意味です。`hash-object` という配管コマンドを使用することで、それを実際にお見せすることができます。そのコマンドはあるデータを取り出して、それを `.git` ディレクトリに格納し、そのデータが格納された場所を示すキーを返します。まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 [source,console] ---- From bd3516b5411a2d9718d38eb9466d9e1eae857b74 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Thu, 1 Oct 2015 01:30:32 +0900 Subject: [PATCH 02/43] =?UTF-8?q?-=20key-value=20data=20store=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E3=82=AD=E3=83=BC=E3=83=BB=E3=83=90=E3=83=AA=E3=83=A6?= =?UTF-8?q?=E3=83=BC=E5=9E=8B=E3=83=87=E3=83=BC=E3=82=BF=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=A2=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index fab73e58..fde26f4e 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -14,7 +14,10 @@ To demonstrate, you can use the plumbing command `hash-object`, which takes some First, you initialize a new Git repository and verify that there is nothing in the `objects` directory: ////////////////////////// Git は内容アドレスファイルシステムです。 -素晴らしい。…で、それはどういう意味なのでしょう?それは、Git のコアの部分が単純なキーバリューから成り立つデータストアである、という意味です。`hash-object` という配管コマンドを使用することで、それを実際にお見せすることができます。そのコマンドはあるデータを取り出して、それを `.git` ディレクトリに格納し、そのデータが格納された場所を示すキーを返します。まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 +素晴らしい。 +…で、それはどういう意味なのでしょう? +それは、Gitのコアの部分はシンプルなキー・バリュー型データストアである、という意味です。 +`hash-object` という配管コマンドを使用することで、それを実際にお見せすることができます。そのコマンドはあるデータを取り出して、それを `.git` ディレクトリに格納し、そのデータが格納された場所を示すキーを返します。まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 [source,console] ---- From e20da017c9587491a590b9ae4053c7764091d41d Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Thu, 1 Oct 2015 01:33:30 +0900 Subject: [PATCH 03/43] =?UTF-8?q?-=20You=20can=20insert=20...=E3=81=AE?= =?UTF-8?q?=E6=96=87=E3=81=8C=E8=A8=B3=E5=87=BA=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 1 + 1 file changed, 1 insertion(+) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index fde26f4e..471e2bfd 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -17,6 +17,7 @@ Git は内容アドレスファイルシステムです。 素晴らしい。 …で、それはどういう意味なのでしょう? それは、Gitのコアの部分はシンプルなキー・バリュー型データストアである、という意味です。 +ここにはどんな種類のコンテンツでも格納でき、それに対応するキーが返されます。キーを使えば格納したコンテンツをいつでも取り出せます。 `hash-object` という配管コマンドを使用することで、それを実際にお見せすることができます。そのコマンドはあるデータを取り出して、それを `.git` ディレクトリに格納し、そのデータが格納された場所を示すキーを返します。まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 [source,console] From c04c85897a3368fdd602c0230b2f9c4578e578b3 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Thu, 1 Oct 2015 01:41:29 +0900 Subject: [PATCH 04/43] =?UTF-8?q?-=20=E3=80=8C=E3=81=9D=E3=82=8C=E5=AE=9F?= =?UTF-8?q?=E9=9A=9B=E3=81=AB=E3=81=8A=E8=A6=8B=E3=81=9B=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E3=80=8C=E3=81=9D=E3=82=8C=E3=80=8D=E3=81=8C?= =?UTF-8?q?=E5=88=86=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E6=96=87=E3=81=AE=E9=A0=86=E5=BA=8F=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=20-=20takes=20some=20data=E3=81=AF=E3=80=8C=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=92=E5=8F=96=E3=82=8A=E5=87=BA=E3=81=99?= =?UTF-8?q?=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=92=E5=8F=97=E3=81=91=E5=8F=96=E3=82=8B?= =?UTF-8?q?=E3=80=8D=20-=20=E3=82=AD=E3=83=BC=E3=81=AF=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=8C=E6=A0=BC=E7=B4=8D=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E3=80=8C=E5=A0=B4=E6=89=80=E3=80=8D=E3=82=92=E7=A4=BA=E3=81=99?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E5=8D=98=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=82=AD=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 471e2bfd..208d66e9 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -18,7 +18,8 @@ Git は内容アドレスファイルシステムです。 …で、それはどういう意味なのでしょう? それは、Gitのコアの部分はシンプルなキー・バリュー型データストアである、という意味です。 ここにはどんな種類のコンテンツでも格納でき、それに対応するキーが返されます。キーを使えば格納したコンテンツをいつでも取り出せます。 -`hash-object` という配管コマンドを使用することで、それを実際にお見せすることができます。そのコマンドはあるデータを取り出して、それを `.git` ディレクトリに格納し、そのデータが格納された場所を示すキーを返します。まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 +これは `hash-object` という配管コマンドを使えば実際に確認できます。このコマンドはデータを受け取り、それを `.git` ディレクトリに格納し、そのデータを格納しているキーを返します。 +まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 [source,console] ---- From d18465fd8aabfbaa69d2b7daab5f2d6046d5c16a Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Thu, 1 Oct 2015 01:42:03 +0900 Subject: [PATCH 05/43] =?UTF-8?q?-=20"=E3=83=AC=E3=83=9D=E3=82=B8=E3=83=88?= =?UTF-8?q?=E3=83=AA"=E2=86=92"=E3=83=AA=E3=83=9D=E3=82=B8=E3=83=88?= =?UTF-8?q?=E3=83=AA"=E3=81=AB=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 208d66e9..82e71faf 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -19,7 +19,7 @@ Git は内容アドレスファイルシステムです。 それは、Gitのコアの部分はシンプルなキー・バリュー型データストアである、という意味です。 ここにはどんな種類のコンテンツでも格納でき、それに対応するキーが返されます。キーを使えば格納したコンテンツをいつでも取り出せます。 これは `hash-object` という配管コマンドを使えば実際に確認できます。このコマンドはデータを受け取り、それを `.git` ディレクトリに格納し、そのデータを格納しているキーを返します。 -まずは、初期化された新しいGit レポジトリには `objects` ディレクトリが存在しないことを確認します。 +まずは、初期化された新しいGitリポジトリには `objects` ディレクトリが存在しないことを確認します。 [source,console] ---- From 1837234826a4bd2f3f058370d9b0af5e4c38f3d1 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Tue, 6 Oct 2015 01:39:56 +0900 Subject: [PATCH 06/43] =?UTF-8?q?-=20=E3=80=8C=E5=B9=BE=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=80=8D=E2=86=92?= =?UTF-8?q?=E3=80=8C=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=82=92=E5=B9=BE?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=80=8D=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 82e71faf..6398b312 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -37,7 +37,8 @@ $ find .git/objects -type f Git has initialized the `objects` directory and created `pack` and `info` subdirectories in it, but there are no regular files. Now, store some text in your Git database: ////////////////////////// -Git は `objects` ディレクトリを初期化して、その中に `pack` と `info` というサブディレクトリを作ります。しかし、ファイルはひとつも作られません。今から Git データベースに幾つかのテキストを格納してみます。 +Gitは `objects` ディレクトリを初期化して、その中に `pack` と `info` というサブディレクトリを作ります。しかし、ファイルはひとつも作られません。 +今からGitデータベースにテキストを幾つか格納してみます。 [source,console] ---- From 83151d961e24776e9dc9cf8273540356ffe9118b Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Tue, 6 Oct 2015 01:47:21 +0900 Subject: [PATCH 07/43] =?UTF-8?q?-=20tell=E3=82=92=E3=80=8C=E4=BC=9D?= =?UTF-8?q?=E3=81=88=E3=82=8B=E3=80=8D=E2=86=92=E3=80=8C=E6=8C=87=E7=A4=BA?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=80=8D=E3=81=AB=E5=A4=89=E6=9B=B4=20-=20wh?= =?UTF-8?q?at=20the=20key=20would=20be=E3=81=AF=E3=80=8C=E3=82=AD=E3=83=BC?= =?UTF-8?q?=E3=81=A8=E3=81=AA=E3=82=8B=E3=82=82=E3=81=AE=EF=BC=88=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=88=97=EF=BC=89=E3=80=8D=20-=20=E3=83=80=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E4=BB=A5=E9=99=8D=E3=81=AF=E3=82=AB=E3=83=83?= =?UTF-8?q?=E3=82=B3=E6=9B=B8=E3=81=8D=E3=81=AB=E3=81=97=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=A6=E3=82=82=E5=9C=B0=E3=81=AE=E6=96=87=E3=81=A7=E6=9B=B8?= =?UTF-8?q?=E3=81=91=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20-=20in?= =?UTF-8?q?=20a=20bit=E3=81=AF=E3=80=8C=E3=81=99=E3=81=90=E5=BE=8C?= =?UTF-8?q?=E3=81=A7=E3=80=8D=20-=20Now=20you=20can=20see=20...=20?= =?UTF-8?q?=E3=81=8C=E3=80=8C=E7=9F=A5=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=81=BE=E3=81=97=E3=81=9F=E3=80=8D=E3=81=A8?= =?UTF-8?q?=E9=81=8E=E5=8E=BB=E5=BD=A2=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=81=AE=E3=81=AF=E3=81=8A=E3=81=8B=E3=81=97?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 6398b312..30d586ca 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -53,7 +53,11 @@ The output from the command is a 40-character checksum hash. This is the SHA-1 hash – a checksum of the content you're storing plus a header, which you'll learn about in a bit. Now you can see how Git has stored your data: ////////////////////////// -`-w` オプションは `hash-object` に、オブジェクトを格納するように伝えます。`-w` オプションを付けない場合、コマンドはただオブジェクトのキーが何かを伝えます。`--stdin` オプションは、標準入力からコンテンツを読み込むようにコマンドに伝えます。これを指定しない場合、`hash-object` はコマンドラインオプションの最後にファイルパスが指定されることを期待して動作します。コマンドを実行すると、40文字から成るチェックサムのハッシュ値が出力されます。これは、SHA-1ハッシュです。(後ほど知ることになりますが、これは格納するコンテンツにヘッダーを加えたデータに対するチェックサムです)これでGitがデータをどのようにして格納するかを知ることができました。 +`-w` オプションは、 `hash-object` にオブジェクトを格納するよう指示しています。`-w` オプションを付けない場合、コマンドはただオブジェクトのキーとなる文字列を返します。 +`--stdin` オプションは、標準入力からコンテンツを読み込むよう指示しています。これを指定しない場合、`hash-object` はコマンドラインオプションの最後にファイルパスが指定されることを期待して動作します。 +コマンドを実行すると、40文字から成るチェックサムのハッシュ値が出力されます。 +これは、SHA-1ハッシュです。すぐ後で説明しますが、これは格納するコンテンツにヘッダーを加えたデータに対するチェックサムです。 +これで、Gitがデータをどのようにして格納するか見ることができるようになりました。 [source,console] ---- From daec3ca5249cd5ec9b5a1093b4416e86f76e30b0 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Tue, 6 Oct 2015 01:57:21 +0900 Subject: [PATCH 08/43] =?UTF-8?q?-=20=E3=80=8C=E3=81=B2=E3=81=A8=E3=81=A4?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8A=E3=81=BE=E3=81=99=E3=80=8D=E2=86=92=E3=80=8C=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C=E3=81=B2=E3=81=A8=E3=81=A4?= =?UTF-8?q?=E3=81=82=E3=82=8A=E3=81=BE=E3=81=99=E3=80=8D=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20-=20=E3=80=8C=E6=9C=80=E5=88=9D=E3=81=AB=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84=E3=82=92=E6=A0=BC=E7=B4=8D?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=99=E3=80=8D=E3=81=A0=E3=81=A8=E3=80=8C?= =?UTF-8?q?=E6=AC=A1=E3=81=AB=E2=97=8B=E2=97=8B=E3=82=92=E6=A0=BC=E7=B4=8D?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=99=E3=80=8D=E3=81=8C=E6=9D=A5=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E8=AA=AD=E3=82=81=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=81=A7initially=E3=81=AF=E3=80=8C=E3=81=BE=E3=81=9A=E3=80=8D?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=20-=20per=20piece=20of=20content?= =?UTF-8?q?=E3=81=AF=E3=80=8C=E4=B8=80=E3=81=A4=E3=81=AE=E9=83=A8=E5=88=86?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=8D=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=80=8C=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84=EF=BC=88?= =?UTF-8?q?1=E3=81=A4=EF=BC=89=E3=81=94=E3=81=A8=E3=81=AB=E3=80=8D=20-=20?= =?UTF-8?q?=E3=80=8CSHA-1=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=B5=E3=83=A0=E3=80=8D=E3=81=A0=E3=81=A8=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=B5=E3=83=A0=E3=81=AE=E5=AF=BE=E8=B1=A1?= =?UTF-8?q?=E3=81=8C=E4=BD=95=E3=81=8B=E6=9B=96=E6=98=A7=E3=81=AA=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E3=80=8CSHA-1=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=B5=E3=83=A0=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3=20-=20?= =?UTF-8?q?=E3=80=8C=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=B5=E3=83=A0?= =?UTF-8?q?=E3=82=92=E7=94=A8=E3=81=84=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E5=90=8D=E3=81=A7=E6=A0=BC=E7=B4=8D=E3=80=8D=E3=81=A0?= =?UTF-8?q?=E3=81=A8=E3=80=8C=E6=A0=BC=E7=B4=8D=E3=80=8D=E3=81=8C=E5=89=8D?= =?UTF-8?q?=E3=81=AE=E6=96=87=E3=81=A8=E9=87=8D=E8=A4=87=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=8C=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E5=90=8D=E3=81=AF=E3=80=9C=E3=81=A7=E6=B1=BA=E3=81=BE=E3=82=8A?= =?UTF-8?q?=E3=81=BE=E3=81=99=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3=20-=20?= =?UTF-8?q?=E3=80=8C=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=81=AF?= =?UTF-8?q?=E3=80=9C=E3=81=A7=E6=B1=BA=E3=81=BE=E3=82=8B=E3=80=8D=E3=81=8C?= =?UTF-8?q?2=E3=81=A4=E3=81=AE=E6=96=87=E3=81=A7=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=80=8C=E3=80=9C?= =?UTF-8?q?=E3=81=8C=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=8A=E3=81=BE=E3=81=99=E3=80=8D=E3=81=A8=E3=81=84?= =?UTF-8?q?=E3=81=86=E8=A8=80=E3=81=84=E5=9B=9E=E3=81=97=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 30d586ca..5b993d4f 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -70,7 +70,9 @@ You can see a file in the `objects` directory. This is how Git stores the content initially – as a single file per piece of content, named with the SHA-1 checksum of the content and its header. The subdirectory is named with the first 2 characters of the SHA-1, and the filename is the remaining 38 characters. ////////////////////////// -ひとつのファイルが `objects` ディレクトリの中にあります。このようして Git は、最初にコンテンツを格納します。ひとつの部分のコンテンツにつき 1ファイルで、コンテンツとそのヘッダーに対する SHA-1のチェックサムを用いたファイル名で格納します。サブディレクトリは、SHA-1ハッシュのはじめの2文字で名付けられ、残りの38文字でファイル名が決まります。 +`objects` ディレクトリの中にファイルがひとつあります。 +Gitはまずこのようにしてコンテンツを格納します。コンテンツ1つごとに1ファイルで、ファイル名はコンテンツとそのヘッダーに対するSHA-1チェックサムで決まります。 +SHA-1ハッシュのはじめの2文字がサブディレクトリの名前になり、残りの38文字がファイル名になります。 ////////////////////////// You can pull the content back out of Git with the `cat-file` command. From d29fee7342a31bdb198663ec293c7e95143bee0c Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Tue, 6 Oct 2015 02:03:22 +0900 Subject: [PATCH 09/43] =?UTF-8?q?-=20pull=20back=20out=E3=81=AF=E3=81=93?= =?UTF-8?q?=E3=81=93=E3=81=A7=E3=81=AF=E5=8D=98=E3=81=AB=E3=80=8C=E5=8F=96?= =?UTF-8?q?=E3=82=8A=E5=87=BA=E3=81=99=E3=80=8D=E3=81=AE=E6=84=8F=E5=91=B3?= =?UTF-8?q?=20-=20Swiss=20army=20knife=E3=81=AF=E5=8D=98=E3=81=AB=E3=80=8C?= =?UTF-8?q?=E3=81=84=E3=82=8D=E3=81=84=E3=82=8D=E3=81=AA=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=81=AB=E4=BD=BF=E3=81=88=E3=82=8B=E3=80=8D=E3=81=A8=E3=81=84?= =?UTF-8?q?=E3=81=86=E6=84=8F=E5=91=B3=E3=81=AA=E3=81=AE=E3=81=A7=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E3=81=AF=E6=AE=8B=E3=81=95=E3=81=9A=E3=80=8C=E4=B8=87?= =?UTF-8?q?=E8=83=BD=E3=83=8A=E3=82=A4=E3=83=95=E3=80=8D=E3=81=A8=E3=81=99?= =?UTF-8?q?=E3=82=8B=20-=20=E3=80=8C=E4=BE=BF=E5=88=A9=E3=81=AA=E3=80=8D?= =?UTF-8?q?=E3=81=A8=E3=81=84=E3=81=86=E8=AA=9E=E3=81=AF=E5=8E=9F=E6=96=87?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20-=20figure=20out=E3=81=8C=E8=A8=B3=E5=87=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 5b993d4f..da756610 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -79,7 +79,9 @@ You can pull the content back out of Git with the `cat-file` command. This command is sort of a Swiss army knife for inspecting Git objects. Passing `-p` to it instructs the `cat-file` command to figure out the type of content and display it nicely for you: ////////////////////////// -`cat-file` コマンドを使って、コンテンツを Git の外に引き出すことができます。これは Git オブジェクトを調べることにおいて、`cat-file` は万能ナイフ(Swiss army knife)のような便利なコマンドです。`-p` オプションを付けると、`cat-file` コマンドはコンテンツのタイプをわかりやすく表示してくれます。 +`cat-file` コマンドを使うと、コンテンツをGitから取り出すことができます。 +このコマンドは、Gitオブジェクトを調べるための万能ナイフのようなものです。 +`-p` オプションを付けると、`cat-file` コマンドはコンテンツのタイプを判別し、わかりやすく表示してくれます。 [source,console] ---- From 825744af0f5b7117382e5aaef8d61204403269a4 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Tue, 6 Oct 2015 02:09:08 +0900 Subject: [PATCH 10/43] =?UTF-8?q?-=20you=20can=E3=81=AEyou=E3=82=84your=20?= =?UTF-8?q?database=E3=81=AEyour=E3=81=AF=E8=A8=B3=E5=87=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E5=BF=85=E8=A6=81=E3=81=8C=E3=81=AA=E3=81=84=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E5=89=8A=E9=99=A4=20-=20pull=20back=20out=E3=81=AF?= =?UTF-8?q?=E3=81=93=E3=81=93=E3=81=A7=E3=81=AF=E5=8D=98=E3=81=AB=E3=80=8C?= =?UTF-8?q?=E5=8F=96=E3=82=8A=E5=87=BA=E3=81=99=E3=80=8D=E3=81=AE=E6=84=8F?= =?UTF-8?q?=E5=91=B3=20-=20content=20in=20files=E3=81=AF=E3=80=8C=E8=A4=87?= =?UTF-8?q?=E6=95=B0=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=80=8D?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E4=B8=80=E8=88=AC=E3=81=AE=E4=B8=AD=E3=81=AB?= =?UTF-8?q?=E3=81=82=E3=82=8B=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E6=84=8F=E5=91=B3=20-=20some=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B=E3=81=AE=E3=80=8D?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E3=81=A1=E3=82=87?= =?UTF-8?q?=E3=81=A3=E3=81=A8=E3=81=97=E3=81=9F=E3=80=8D=E7=A8=8B=E5=BA=A6?= =?UTF-8?q?=E3=81=AE=E6=84=8F=E5=91=B3=E3=81=A7=E3=80=81simple=E3=81=A8?= =?UTF-8?q?=E6=84=8F=E5=91=B3=E3=81=8C=E9=87=8D=E3=81=AA=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E7=9C=81=E7=95=A5=20-=20contents=E3=81=AF=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E7=9A=84=E3=81=AA=E3=80=8C=E3=82=B3=E3=83=B3=E3=83=86?= =?UTF-8?q?=E3=83=B3=E3=83=84=E3=80=8D=E3=81=A8=E3=80=81=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=AE=E3=80=8C=E5=86=85=E5=AE=B9=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E4=B8=A1=E6=96=B9=E3=81=A7=E4=BD=BF=E3=82=8F=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=81=E6=96=87?= =?UTF-8?q?=E8=84=88=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E4=BD=BF?= =?UTF-8?q?=E3=81=84=E5=88=86=E3=81=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index da756610..18d64f2a 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -95,7 +95,10 @@ You can also do this with content in files. For example, you can do some simple version control on a file. First, create a new file and save its contents in your database: ////////////////////////// -これであなたは Git にコンテンツを追加し、それを再び外に引き出すことができるようになりました。複数のファイルがあるコンテンツに対してもこれと同様のことを行うことができます。例えば、あるファイルに対して幾つかの簡単なバージョン管理行うことができます。まず、新規にファイルを作成し、あなたのデータベースにそのコンテンツを保存します。 +これで、Gitにコンテンツを追加したり、取り出したりできるようになりました。 +ファイルの内容に対しても、これと同様のことを行えます。 +例えば、あるファイルに対して簡単なバージョン管理を行うことができます。 +まず、新規にファイルを作成し、データベースにその内容を保存します。 [source,console] ---- From e0cce80b7286373e2ea267ce7575786f5ba31fe0 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:09:25 +0900 Subject: [PATCH 11/43] =?UTF-8?q?-=20contents=E3=81=93=E3=81=93=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E3=80=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E3=80=8D=E3=81=AE=E6=84=8F=E5=91=B3=20-=20?= =?UTF-8?q?=E3=80=8C=E5=B9=BE=E3=81=A4=E3=81=8B=E3=80=8D=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=A6=E3=82=82=E6=84=8F=E5=91=B3=E3=81=8C=E9=80=9A?= =?UTF-8?q?=E3=81=98=E3=82=8B=E3=81=AE=E3=81=A7=E7=9C=81=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 18d64f2a..a1fd4c82 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -110,7 +110,7 @@ $ git hash-object -w test.txt ////////////////////////// Then, write some new content to the file, and save it again: ////////////////////////// -それから、幾つか新しいコンテンツをそのファイルに書き込んで、再び保存します。 +それから、新しい内容をそのファイルに書き込んで、再び保存します。 [source,console] ---- From 093cd309a4e22f6b7b523748ca30c38a6cc0c7e8 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:41:16 +0900 Subject: [PATCH 12/43] =?UTF-8?q?-=20=E3=80=8C=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=80=8D=E3=81=AF=E3=80=8C=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=84=E3=80=8D=E3=81=AB=E3=81=AF=E3=81=8B?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=20-=20?= =?UTF-8?q?=E3=80=8C=E3=81=9D=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=80=8D=E3=81=8C=E3=81=A9=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=8B=E3=82=8F=E3=81=8B=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=8C=E4=B8=8A=E8=A8=98=E3=81=AE=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index a1fd4c82..f5698c5f 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -122,7 +122,7 @@ $ git hash-object -w test.txt ////////////////////////// Your database contains the two new versions of the file as well as the first content you stored there: ////////////////////////// -データベースには、そこに格納した最初のコンテンツのバージョンに加えて、そのファイルの新しいバージョンが二つ追加されています。 +データベースには、最初に格納したコンテンツに加えて、上記のファイルのバージョン二つが新規に追加されています。 [source,console] ---- From 1618023cea031f6a14e88f7f8f8a6bb86324b61e Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:46:32 +0900 Subject: [PATCH 13/43] =?UTF-8?q?-=20revert=E3=81=AF=E3=80=8C=E5=8F=96?= =?UTF-8?q?=E3=82=8A=E6=B6=88=E3=81=97=E3=80=8D=E3=81=AB=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index f5698c5f..9edba6aa 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -135,7 +135,7 @@ $ find .git/objects -type f ////////////////////////// Now you can revert the file back to the first version ////////////////////////// -これで、そのファイルを最初のバージョンに復帰(revert)することができます。 +これで、上記のファイルの変更を取り消して最初のバージョンに戻せるようになりました。 [source,console] ---- From 0264751f950434bbf5eda5593ab249721eb4daa5 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:47:08 +0900 Subject: [PATCH 14/43] =?UTF-8?q?-=20=E6=96=87=E3=81=8C=E4=B8=AD=E9=80=94?= =?UTF-8?q?=E5=8D=8A=E7=AB=AF=E3=81=AB=E7=B5=82=E3=82=8F=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 9edba6aa..abfe9688 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -147,7 +147,7 @@ version 1 ////////////////////////// or the second version: ////////////////////////// -あるいは、二つ目のバージョンに。 +また、二つ目のバージョンにもできます。 [source,console] ---- From 861fbf1edc5f53f5d1965cb56739eecef5f61739 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:49:58 +0900 Subject: [PATCH 15/43] =?UTF-8?q?-=20=E3=80=8C=E8=A6=9A=E3=81=88=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E2=86=92=E3=80=8C=E8=A6=9A=E3=81=88=E3=81=A6=E3=81=8A?= =?UTF-8?q?=E3=81=8F=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3=20-=20=E3=80=8C?= =?UTF-8?q?=E3=82=B7=E3=82=B9=E3=83=86=E3=83=A0=E5=86=85=E3=81=AB=E3=80=8D?= =?UTF-8?q?=E3=81=AF=E6=9C=80=E5=88=9D=E3=81=AE=E3=80=8C=E6=A0=BC=E7=B4=8D?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E8=BF=91=E3=81=8F=E3=81=AB=E7=A7=BB=E5=8B=95?= =?UTF-8?q?=20-=20=E3=81=93=E3=81=93=E3=81=A7=E3=81=AFcontent=E3=81=AF?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E3=80=8C=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index abfe9688..6813cf4a 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -161,7 +161,9 @@ But remembering the SHA-1 key for each version of your file isn't practical; plu This object type is called a blob. You can have Git tell you the object type of any object in Git, given its SHA-1 key, with `cat-file -t`: ////////////////////////// -しかし、それぞれのファイルのバージョンの SHA-1キーを覚えることは実用的ではありません。加えて、あなたはコンテンツのみを格納していてファイル名はシステム内に格納していません。このオブジェクトタイプはブロブ(blob)と呼ばれます。`cat-file -t` コマンドに SHA-1キーを渡すことで、あなたは Git 内にあるあらゆるオブジェクトのタイプを問い合わせることができます。 +しかし、それぞれのファイルのバージョンのSHA-1キーを覚えておくのは実用的ではありません。加えて、ファイル名はシステムに格納されておらず、ファイルの内容のみが格納されています。 +このオブジェクトタイプはブロブ(blob)と呼ばれます。 +`cat-file -t` コマンドに SHA-1キーを渡すことで、あなたは Git 内にあるあらゆるオブジェクトのタイプを問い合わせることができます。 [source,console] ---- From b16944a280657b6aaddc8363d232caec0ac56122 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:58:26 +0900 Subject: [PATCH 16/43] =?UTF-8?q?-=20a=20group=20of=20files=E3=81=AF?= =?UTF-8?q?=E3=80=8C=EF=BC=88=E4=BD=95=E3=82=89=E3=81=8B=E3=81=AE=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E3=81=A7=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=EF=BC=89=E8=A4=87=E6=95=B0=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=80=8D=20-=20=E3=80=8C=E7=B0=A1=E7=95=A5=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=BE=E3=81=99=E3=80=8D=E2=86=92?= =?UTF-8?q?=E3=80=8C=E7=B0=A1=E7=95=A5=E5=8C=96=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=BE=E3=81=99=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20-=20tree=20and=20blob=20objects=E3=81=AFtree=20objects=20and?= =?UTF-8?q?=20blob=20objects=E3=81=AE=E6=84=8F=E5=91=B3=20-=20more=20or=20?= =?UTF-8?q?less=E3=81=AF=E3=80=8C=E3=81=BB=E3=81=BC=E3=80=8D=20-=20?= =?UTF-8?q?=E3=80=8C=E3=81=BE=E3=81=9F=E3=81=9D=E3=82=8C=E3=82=89=E3=81=AE?= =?UTF-8?q?=E3=83=84=E3=83=AA=E3=83=BC=E3=81=AF=E3=80=8D=E3=81=8Ctree=20en?= =?UTF-8?q?try=E3=81=AE=E6=84=8F=E5=91=B3=E3=81=A7=E3=81=82=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 6813cf4a..28b7ee39 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -184,7 +184,11 @@ All the content is stored as tree and blob objects, with trees corresponding to A single tree object contains one or more tree entries, each of which contains a SHA-1 pointer to a blob or subtree with its associated mode, type, and filename. For example, the most recent tree in a project may look something like this: ////////////////////////// -次のタイプはツリーです。これは、ファイル名の格納の問題を解決して、さらに、あるグループに属するファイル群を一緒に格納します。Git がコンテンツを格納する方法は、UNIXのファイルシステムに似ていますが少し簡略されています。すべてのコンテンツはツリーとブロブのオブジェクトとして格納されます。ツリーは UNIXのディレクトリエントリーに対応しており、ブロブは幾分かは iノード またはファイルコンテンツに対応しています。1つのツリーオブジェクトは1つ以上のツリーエントリーを含んでいて、またそれらのツリーは、それに関連するモード、タイプ、そしてファイル名と一緒に、ブロブまたはサブツリーへの SHA-1ポインターを含んでいます。例えば、あるプロジェクトの最新のツリーはこのように見えるかもしれません。 +次のタイプはツリーです。これにより、ファイル名の格納の問題を解決して、さらに、複数のファイルをまとめて格納できるようになります。 +Git がコンテンツを格納する方法は、UNIXのファイルシステムに似ていますが少し簡略化されています。 +すべてのコンテンツはツリーオブジェクトまたはブロブオブジェクトとして格納されます。ツリーは UNIXのディレクトリエントリーと対応しており、ブロブはiノードやファイルコンテンツとほぼ対応しています。 +1つのツリーオブジェクトには1つ以上のツリーエントリーが含まれています。このツリーエントリーには、ブロブか、サブツリーとそれに関連するモード、タイプ、ファイル名へのSHA-1ポインターが含まれています。 +例えば、あるプロジェクトの最新のツリーはこのように見えるかもしれません。 [source,console] ---- From 5f2b7eb0a4244c84d611acb5abfd61e223f8be25 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 00:59:31 +0900 Subject: [PATCH 17/43] =?UTF-8?q?-=20pointed=E3=81=AF=E3=80=8C=E6=8C=87?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 28b7ee39..4a4a90e3 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -202,7 +202,8 @@ $ git cat-file -p master^{tree} The `master^{tree}` syntax specifies the tree object that is pointed to by the last commit on your `master` branch. Notice that the `lib` subdirectory isn't a blob but a pointer to another tree: ////////////////////////// -`master^{tree}` のシンタックスは、`master` ブランチ上での最後のコミットによってポイントされたツリーオブジェクトを示します。`lib` サブディレクトリがブロブではなく、別のツリーへのポインタであることに注意してください。 +`master^{tree}` のシンタックスは、`master` ブランチ上での最後のコミットが指しているツリーオブジェクトを示します。 +`lib` サブディレクトリはブロブではなく、別のツリーへのポインタであることに注意してください。 [source,console] ---- From 09e8511cb16c86e826f3c930ce87b492da80b4e1 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:03:48 +0900 Subject: [PATCH 18/43] =?UTF-8?q?-=20=E3=80=8C=E6=A6=82=E5=BF=B5=E7=9A=84?= =?UTF-8?q?=E3=81=AB=E3=80=8D=E2=86=92=E3=80=8C=E6=A6=82=E5=BF=B5=E7=9A=84?= =?UTF-8?q?=E3=81=AB=E3=81=AF=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 4a4a90e3..0acdb1ec 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -214,7 +214,7 @@ $ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 ////////////////////////// Conceptually, the data that Git is storing is something like this: ////////////////////////// -概念的に、Git が格納するデータは次のようなものです。 +概念的には、Gitが格納するデータは次のようなものです。 ////////////////////////// .Simple version of the Git data model. From 7fc007d8618f3be350d2c0f936c449c3281b0bd4 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:13:38 +0900 Subject: [PATCH 19/43] =?UTF-8?q?-=20your=20own=E3=81=AF=E3=80=8C=E7=8B=AC?= =?UTF-8?q?=E8=87=AA=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C?= =?UTF-8?q?=E8=87=AA=E5=89=8D=E3=81=A7=E3=80=8D=20-=20=E3=80=8C=E5=B9=BE?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=81=AE=E3=80=8D=E3=81=AF=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=A6=E3=82=82=E6=84=8F=E5=91=B3=E3=81=8C=E9=80=9A=E3=81=98?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E7=9C=81=E7=95=A5=20-=20=E3=80=8C?= =?UTF-8?q?=E3=82=BB=E3=83=83=E3=83=88=E3=82=A2=E3=83=83=E3=83=97=E3=80=8D?= =?UTF-8?q?=E2=86=92=E3=80=8C=E4=BD=9C=E6=88=90=E3=80=8D=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20-=20=E3=80=8C=E5=8D=98=E4=B8=80=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=83=AA=E3=80=8D=EF=BC=9D=E3=80=8Ctest.txt?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E6=9C=80=E5=88=9D?= =?UTF-8?q?=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=80=8D?= =?UTF-8?q?=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=82=8F?= =?UTF-8?q?=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 0acdb1ec..07a26e47 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -232,13 +232,14 @@ You use this command to artificially add the earlier version of the test.txt fil You must pass it the `--add` option because the file doesn't yet exist in your staging area (you don't even have a staging area set up yet) and `--cacheinfo` because the file you're adding isn't in your directory but is in your database. Then, you specify the mode, SHA-1, and filename: ////////////////////////// -独自のツリーを作ることもかなり簡単に行えます。Git は通常、ステージングエリアもしくはインデックスの状態を取得することによってツリーを作成し、 -そこから一連のツリーオブジェクトを書き込みます。そのため、ツリーオブジェクトを作るには、まず幾つかのファイルをステージングしてインデックスをセットアップしなければなりません。 -test.txt ファイルの最初のバージョンである単一エントリーのインデックスを作るには、`update-index` という配管コマンドを使います。 -前バージョンの test.txt ファイルを新しいステージングエリアに人為的に追加するにはこのコマンドを使います。 -ファイルはまだステージングエリアには存在しない(未だステージングエリアをセットアップさえしていない)ので、`--add` オプションを付けなければなりません。 +自前でツリーを作るのも非常に簡単です。 +Gitは通常、ステージングエリアやインデックスの状態を取得してツリーを作成し、そのツリーをもとに一連のツリーオブジェクトを書き込みます。 +そのため、ツリーオブジェクトを作るには、まずファイルをステージングしてインデックスを作成しなければなりません。 +単一のエントリー – ここではtest.txtファイルの最初のバージョン – からインデックスを作るには、`update-index` という配管コマンドを使います。 +このコマンドは、前のバージョンのtest.txtファイルをあえて新しいステージングエリアに追加する際に使用します。 +ファイルはまだステージングエリアには存在しない(まだステージングエリアをセットアップさえしていない)ので、`--add` オプションを付けなければなりません。 また、追加しようとしているファイルはディレクトリには無くデータベースにあるので、`--cacheinfo`オプションを付ける必要があります。 -その次に、モードと SHA-1、そしてファイル名を指定します。 +その次に、モード、SHA-1、ファイル名を指定します。 [source,console] ---- From 0fdb202cd55f83de6cf13e371ff5881e6a9a9f87 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:20:20 +0900 Subject: [PATCH 20/43] =?UTF-8?q?-=20option=E3=81=AF=E3=80=8C=E3=82=AA?= =?UTF-8?q?=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=80=8D=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=80=8C=E5=88=A9=E7=94=A8=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E9=81=B8=E6=8A=9E=E8=82=A2=E3=80=8D=E3=81=AE=E6=84=8F?= =?UTF-8?q?=E5=91=B3=20-=20much=20less=20flexible=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E3=81=9D=E3=82=8C=E3=81=BB=E3=81=A9=E6=9F=94=E8=BB=9F=E6=80=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=84=E3=80=8D=20-=20=E3=80=8CGit?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=AE=E3=81=8C=E4=B8=89?= =?UTF-8?q?=E3=81=A4=E3=81=A0=E3=81=91=E3=80=8D=E3=81=A7=E3=81=82=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=80=8C=E4=B8=89=E3=81=A4=E3=82=92=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=AE=E3=81=8CGit=E3=81=AE?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E5=AF=BE=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=A0=E3=81=91=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 07a26e47..5c2d7712 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -252,7 +252,9 @@ In this case, you're specifying a mode of `100644`, which means it's a normal fi Other options are `100755`, which means it's an executable file; and `120000`, which specifies a symbolic link. The mode is taken from normal UNIX modes but is much less flexible – these three modes are the only ones that are valid for files (blobs) in Git (although other modes are used for directories and submodules). ////////////////////////// -この例では、`100644` のモードを指定しています。これは、それが通常のファイルであることを意味します。他には、実行可能ファイルであることを意味する `100755` や、シンボリックリンクであることを示す `120000` のオプションがあります。このモードは通常の UNIX モードから取り入れた概念ですが融通性はもっと劣ります。これら三つのモードは、(他のモードはディレクトリとサブモジュールに使用されますが)Git のファイル(ブロブ)に対してのみ有効です。 +この例では、`100644` のモードを指定しています。これは、それが通常のファイルであることを意味します。 +他に指定できるモードとしては、実行可能ファイルであることを意味する `100755` や、シンボリックリンクであることを示す `120000` があります。 +このモードは通常の UNIX モードから取り入れた概念ですが、それほど柔軟性はありません。Git中のファイル(ブロブ)に対しては、上記三つのモードのみが有効です(ディレクトリとサブモジュールに対しては他のモードも使用できます)。 ////////////////////////// Now, you can use the `write-tree` command to write the staging area out to a tree object. From 8aefe71bf2feb15e0678f192fa14c964dd6f9f19 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:22:10 +0900 Subject: [PATCH 21/43] =?UTF-8?q?-=20=E4=BB=96=E3=81=AENow,=20you=20can=20?= =?UTF-8?q?=E3=80=9C=E3=81=AE=E3=81=8F=E3=81=A0=E3=82=8A=E3=81=A8=E6=96=87?= =?UTF-8?q?=E8=A8=80=E3=82=92=E7=B5=B1=E4=B8=80=20-=20=E3=80=8C=E4=B8=80?= =?UTF-8?q?=E5=88=87=E3=80=8D=E3=81=AF=E5=8E=9F=E6=96=87=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4=20-=20=E3=80=8C?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E7=9A=84=E3=81=AB=E3=80=8D=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E4=BD=9C=E3=82=8B=E3=80=8D=E3=81=AE=E8=BF=91=E3=81=8F=E3=81=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 5c2d7712..81139fd0 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -260,7 +260,8 @@ The mode is taken from normal UNIX modes but is much less flexible – these thr Now, you can use the `write-tree` command to write the staging area out to a tree object. No `-w` option is needed – calling `write-tree` automatically creates a tree object from the state of the index if that tree doesn't yet exist: ////////////////////////// -これであなたは `write-tree` コマンドを使って、ステージングエリアをツリーオブジェクトに書き出すことができます。`-w` オプションは一切必要とされません。`write-tree` コマンドを呼ぶことで、ツリーがまだ存在しない場合に、自動的にインデックスの状態からツリーオブジェクトを作ります。 +これで、 `write-tree` コマンドを使って、ステージングエリアをツリーオブジェクトに書き出せるようになりました。 +`-w` オプションは不要です。`write-tree` コマンドを呼ぶと、ツリーがまだ存在しない場合には、インデックスの状態をもとに自動的にツリーオブジェクトが作られす。 [source,console] ---- From 24590be018b00a4ce02fe0b571abe706eaa1f693 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:23:18 +0900 Subject: [PATCH 22/43] =?UTF-8?q?-=20=E3=80=8C=E3=81=99=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=8C=E3=81=A7=E3=81=8D=E3=82=8B=E3=80=8D=E2=86=92?= =?UTF-8?q?=E3=80=8C=E3=81=A7=E3=81=8D=E3=82=8B=E3=80=8D=E3=81=AB=E7=9F=AD?= =?UTF-8?q?=E7=B8=AE=20-=20=E4=B8=80=E3=81=A4=E5=89=8D=E3=81=AE=E6=AE=B5?= =?UTF-8?q?=E8=90=BD=E3=81=AE=E6=9B=B8=E3=81=8D=E5=87=BA=E3=81=97=E3=81=A8?= =?UTF-8?q?=E8=A8=80=E3=81=84=E5=9B=9E=E3=81=97=E3=82=92=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 81139fd0..3797e216 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -274,7 +274,7 @@ $ git cat-file -p d8329fc1cc938780ffdd9f94e0d364e0ea74f579 ////////////////////////// You can also verify that this is a tree object: ////////////////////////// -また、これがツリーオブジェクトであることを検証することができます。 +また、これがツリーオブジェクトであることを検証できるようになりました。 [source,console] ---- From a275487271a8a9d664324996203464c1489d430b Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:24:40 +0900 Subject: [PATCH 23/43] =?UTF-8?q?-=20test.txt=E3=80=8C=E3=81=AB=E3=80=8D?= =?UTF-8?q?=E5=8A=A0=E3=81=88=E3=82=8B=E3=82=8F=E3=81=91=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=81=A7=E8=A8=80=E3=81=84=E5=9B=9E=E3=81=97?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20-=20now=E3=81=AF=E3=81=93?= =?UTF-8?q?=E3=81=93=E3=81=A7=E3=81=AF=E3=80=8C=E3=81=93=E3=82=8C=E3=81=8B?= =?UTF-8?q?=E3=82=89=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C?= =?UTF-8?q?=E4=BB=8A=E5=BA=A6=E3=81=AF=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 3797e216..fdebca5c 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -285,7 +285,7 @@ tree ////////////////////////// You'll now create a new tree with the second version of test.txt and a new file as well: ////////////////////////// -これから、二つ目のバージョンの test.txt に新しいファイルを加えて新しくツリーを作ります。 +今度は、二つ目のバージョンのtest.txtと、新規作成したファイルから、新しくツリーを作ります。 [source,console] ---- From 9b2b63076b81d70bb9a21905eb8caca1984a33ab Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:28:32 +0900 Subject: [PATCH 24/43] =?UTF-8?q?-=20test.txt=E3=81=A8new.txt=E3=81=AE?= =?UTF-8?q?=E9=A0=86=E5=BA=8F=E3=81=8C=E9=80=86=E3=81=A0=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20-=20=E3=80=8C=E3=82=B9?= =?UTF-8?q?=E3=83=86=E3=83=BC=E3=82=B8=E3=83=B3=E3=82=B0=E3=82=A8=E3=83=AA?= =?UTF-8?q?=E3=82=A2=E3=81=AB=E3=81=AF=E3=80=9C=E6=8C=81=E3=81=A4=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=AA=E3=82=8A=E3=81=BE=E3=81=99=E3=80=8D?= =?UTF-8?q?=E3=81=A0=E3=81=A8=E6=9B=B8=E3=81=8D=E5=87=BA=E3=81=97=E3=81=A8?= =?UTF-8?q?=E6=9C=AB=E5=B0=BE=E3=81=8C=E6=95=B4=E5=90=88=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3=20-=20write?= =?UTF-8?q?=E3=81=A8see=E3=81=AF=E4=B8=A6=E5=88=97=E3=81=AA=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E3=81=9D=E3=81=AE=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index fdebca5c..bcb1a885 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -298,7 +298,8 @@ $ git update-index --add new.txt Your staging area now has the new version of test.txt as well as the new file new.txt. Write out that tree (recording the state of the staging area or index to a tree object) and see what it looks like: ////////////////////////// -これでステージングエリアには、new.txt という新しいファイルに加えて、新しいバージョンの test.txt を持つようになります。(ステージングエリアまたはインデックスの状態を記録している)そのツリーを書き出してみると、以下のように見えます。 +これでステージングエリアには、新しいバージョンのtest.txtに加えて、new.txt という新しいファイルが登録されました。 +このツリー(ステージングエリアまたはインデックスの状態をツリーオブジェクトとして記録しているツリー)を書き出して、どのようになったか見てみましょう。 [source,console] ---- From 253254d9feedc0b2d6f4f70e9fd66b8f37d94bdf Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:30:55 +0900 Subject: [PATCH 25/43] =?UTF-8?q?-=20from=20earlier=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E6=9C=80=E5=88=9D=E3=81=AE=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=80=8C=E5=85=88=E3=81=BB=E3=81=A9=E3=81=AE=E3=80=8D?= =?UTF-8?q?=20-=20this=20one=E3=81=AF=E3=80=8C=E3=81=93=E3=81=AE=E4=B8=AD?= =?UTF-8?q?=E3=81=AE=EF=BC=91=E3=81=A4=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=80=8C=E3=81=93=E3=82=8C=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index bcb1a885..9b9b4d98 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -316,7 +316,10 @@ Just for fun, you'll add the first tree as a subdirectory into this one. You can read trees into your staging area by calling `read-tree`. In this case, you can read an existing tree into your staging area as a subtree by using the `--prefix` option to `read-tree`: ////////////////////////// -このツリーは両方のファイルエントリを持っていて、さらに、test.txt の SHA-1ハッシュは最初の文字(`1f7a7a`)から ``バージョン2'' の SHA-1ハッシュとなっていることに注意してください。ちょっと試しに、最初のツリーをサブディレクトリとしてこの中の1つに追加してみましょう。`read-tree` を呼ぶことで、ステージングエリアの中にツリーを読み込むことができます。このケースでは、`--prefix` オプションを付けて `read-tree` コマンド使用することで、ステージングエリアの中に既存のツリーを、サブツリーとして読み込むことができます。 +このツリーに両方のファイルエントリがあること、また、test.txtのSHA-1が先ほどの ``version 2'' のSHA-1(`1f7a7a`)であることに注意してください。 +ちょっと試しに、最初のツリーをサブディレクトリとしてこの中に追加してみましょう。 +`read-tree` を呼ぶことで、ステージングエリアの中にツリーを読み込むことができます。 +このケースでは、`--prefix` オプションを付けて `read-tree` コマンドを使用することで、ステージングエリアの中に、既存のツリーをサブツリーとして読み込むことができます。 [source,console] ---- From 272889c35cd674155f0e1c0e236c58006b219b36 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Wed, 7 Oct 2015 01:42:58 +0900 Subject: [PATCH 26/43] =?UTF-8?q?-=20get=E3=81=AF=E3=81=93=E3=81=93?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=80=8C=E8=A6=8B=E3=81=A4=E3=81=8B=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E3=81=A8=E7=9B=B4=E8=A8=B3=E3=81=99=E3=82=8B=E3=81=A8?= =?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=82=8B=E3=81=AE=E3=81=A7=E6=84=8F=E8=A8=B3?= =?UTF-8?q?=20-=20top=20level=20of=20the=20working=20directory=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E4=BD=9C=E6=A5=AD=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=81=AE=E7=9B=B4=E4=B8=8B=E3=80=8D=20-=20Yo?= =?UTF-8?q?u=20can=20think=20of=E3=81=AF=E3=80=8C=E3=80=9C=E3=81=AE?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=82=A4=E3=83=A1=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=80=8D=E3=81=A0=E3=81=8C=E3=80=8C?= =?UTF-8?q?=E3=82=A4=E3=83=A1=E3=83=BC=E3=82=B8=E3=81=AF=E6=AC=A1=E3=81=AE?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA=E3=82=8B=E3=80=8D=E3=81=A8?= =?UTF-8?q?=E6=84=8F=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 9b9b4d98..ef67e952 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -336,14 +336,15 @@ $ git cat-file -p 3c4e9cd789d88d8d89c1073707c3585e41b0e614 If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the test.txt file. You can think of the data that Git contains for these structures as being like this: ////////////////////////// -先ほど書き込んだ新しいツリーから作業ディレクトリを作っていれば、二つのファイルが作業ディレクトリのトップレベルに見つかり、また、最初のバージョンの test.txt ファイルが含まれている `bak` という名前のサブディレクトリが見つかります。これらの構造のために Git がデータをどのように含めているかは、次のようにイメージすることができます。 +先ほど書き込んだ新しいツリーから作業ディレクトリを作っていれば、作業ディレクトリの直下にファイルが二つと、最初のバージョンのtest.txtファイルが含まれている `bak` という名前のサブディレクトリが入ります。 +このような構造に対し、Gitが格納するデータのイメージは次のようになります。 ////////////////////////// .The content structure of your current Git data. image::images/data-model-2.png[The content structure of your current Git data.] ////////////////////////// -.現在のGitデータのコンテンツ構造 -image::images/data-model-2.png[現在のGitデータのコンテンツ構造] +.現在のGitデータの内容の構造 +image::images/data-model-2.png[現在のGitデータの内容の構造] [[_git_commit_objects]] ////////////////////////// From 0b135086bfaa08086b5b241075e21498b4f63c3f Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 00:43:08 +0900 Subject: [PATCH 27/43] =?UTF-8?q?=E8=AA=A4=E5=AD=97=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index ef67e952..249f9235 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -261,7 +261,7 @@ Now, you can use the `write-tree` command to write the staging area out to a tre No `-w` option is needed – calling `write-tree` automatically creates a tree object from the state of the index if that tree doesn't yet exist: ////////////////////////// これで、 `write-tree` コマンドを使って、ステージングエリアをツリーオブジェクトに書き出せるようになりました。 -`-w` オプションは不要です。`write-tree` コマンドを呼ぶと、ツリーがまだ存在しない場合には、インデックスの状態をもとに自動的にツリーオブジェクトが作られす。 +`-w` オプションは不要です。`write-tree` コマンドを呼ぶと、ツリーがまだ存在しない場合には、インデックスの状態をもとに自動的にツリーオブジェクトが作られます。 [source,console] ---- @@ -285,7 +285,7 @@ tree ////////////////////////// You'll now create a new tree with the second version of test.txt and a new file as well: ////////////////////////// -今度は、二つ目のバージョンのtest.txtと、新規作成したファイルから、新しくツリーを作ります。 +今度は、二つめのバージョンのtest.txtと、新規作成したファイルから、新しくツリーを作ります。 [source,console] ---- @@ -298,7 +298,7 @@ $ git update-index --add new.txt Your staging area now has the new version of test.txt as well as the new file new.txt. Write out that tree (recording the state of the staging area or index to a tree object) and see what it looks like: ////////////////////////// -これでステージングエリアには、新しいバージョンのtest.txtに加えて、new.txt という新しいファイルが登録されました。 +これでステージングエリアには、新しいバージョンのtest.txtに加えて、new.txtという新しいファイルが登録されました。 このツリー(ステージングエリアまたはインデックスの状態をツリーオブジェクトとして記録しているツリー)を書き出して、どのようになったか見てみましょう。 [source,console] From d23057bd5897ad8c148c3fc45c92bd91b63ca8ee Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 00:54:04 +0900 Subject: [PATCH 28/43] =?UTF-8?q?-=20track=E3=81=AE=E5=8E=9F=E8=AA=9E?= =?UTF-8?q?=E3=81=AF=E4=BB=A5=E9=99=8D=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=82=81=E5=89=8A=E9=99=A4=20-=20different?= =?UTF-8?q?=20=E3=80=9Cs=E3=81=AF=E3=80=8C=E3=81=84=E3=82=8D=E3=81=84?= =?UTF-8?q?=E3=82=8D=E3=81=AA=E3=80=8D=E3=80=8C=E3=81=9D=E3=82=8C=E3=81=9E?= =?UTF-8?q?=E3=82=8C=E7=95=B0=E3=81=AA=E3=82=8B=E3=80=8D=20-=20=E3=80=8C?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=80=8D=E3=81=8C=E4=BA=8C=E5=BA=A6=E5=87=BA?= =?UTF-8?q?=E3=81=A6=E3=81=8F=E3=82=8B=E3=81=AE=E3=81=A7=EF=BC=91=E3=81=A4?= =?UTF-8?q?=E3=81=AB=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B=20-=20who,=20when?= =?UTF-8?q?,=20why=E3=81=AE=E9=A0=86=E5=BA=8F=E3=81=8C=E9=80=86=E3=81=A0?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20-=20fo?= =?UTF-8?q?r=20you=E3=81=AF=E6=97=A5=E6=9C=AC=E8=AA=9E=E4=B8=8A=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=8F=E3=81=A6=E3=82=82=E6=84=8F=E5=91=B3?= =?UTF-8?q?=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=89=E3=81=AA=E3=81=84=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E7=9C=81=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 249f9235..ba83ac1d 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -357,7 +357,9 @@ You have three trees that specify the different snapshots of your project that y You also don't have any information about who saved the snapshots, when they were saved, or why they were saved. This is the basic information that the commit object stores for you. ////////////////////////// -追跡(track)したいと思うプロジェクトの異なるスナップショットを特定するためのツリーが三つありますが、前の問題が残っています。スナップショットを呼び戻すためには3つすべての SHA-1 の値を覚えなければならない、という問題です。さらに、あなたはそれらのスナップショットがいつ、どのような理由で、誰が保存したのかについての情報を一切持っておりません。これはコミットオブジェクトがあなたのために保持する基本的な情報です。 +追跡したいプロジェクトに対し、それぞれ異なる内容のスナップショットを示すツリー三つができました。ですが、各スナップショットを呼び戻すには3つのSHA-1の値すべてを覚えておかなければならない、という以前からの問題は残ったままです。 +さらに、そのスナップショットを誰が、いつ、どのような理由で保存したのかについての情報が一切ありません。 +これはコミットオブジェクトに保存される基本的な情報です。 ////////////////////////// To create a commit object, you call `commit-tree` and specify a single tree SHA-1 and which commit objects, if any, directly preceded it. From dd9609f35b78f2f91e88cd4d4c39298440167afc Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:00:42 +0900 Subject: [PATCH 29/43] =?UTF-8?q?-=20=E3=80=8C=E5=8D=98=E4=B8=80=E3=83=84?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=80=8D=E2=86=92=E3=80=8C=E3=83=84=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=82=92=EF=BC=91=E3=81=A4=E3=80=8D=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20-=20directly=20precede=E3=81=AF=E3=80=8C=E7=9B=B4?= =?UTF-8?q?=E5=89=8D=E3=81=AB=E6=9D=A5=E3=82=8B=E3=80=8D=20-=20=E3=80=8C?= =?UTF-8?q?=E3=81=82=E3=81=AA=E3=81=9F=E3=81=8C=E3=80=8D=E3=81=AF=E6=97=A5?= =?UTF-8?q?=E6=9C=AC=E8=AA=9E=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=81=A6?= =?UTF-8?q?=E3=82=82=E6=84=8F=E5=91=B3=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7=E7=9C=81=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index ba83ac1d..350004a1 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -365,7 +365,8 @@ This is the basic information that the commit object stores for you. To create a commit object, you call `commit-tree` and specify a single tree SHA-1 and which commit objects, if any, directly preceded it. Start with the first tree you wrote: ////////////////////////// -コミットオブジェクトを作成するには、単一ツリーの SHA-1 と、もしそれに直に先行して作成されたコミットオブジェクトがあれば、それらを指定して `commit-tree` を呼びます。あなたが書き込んだ最初のツリーから始めましょう。 +コミットオブジェクトを作成するには、ツリーのSHA-1を一つと、もしそれの直前に来るコミットオブジェクトがあれば、それらを指定して `commit-tree` を呼びます。 +最初に書き込んだツリーから始めましょう。 [source,console] ---- From 9fe0c0216444191a6bfe31133746d1d0f931370d Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:01:10 +0900 Subject: [PATCH 30/43] =?UTF-8?q?-=20=E8=A8=80=E3=81=84=E5=9B=9E=E3=81=97?= =?UTF-8?q?=E3=82=92=E3=81=93=E3=82=8C=E3=81=BE=E3=81=A7=E3=81=AENow=20you?= =?UTF-8?q?=20can=20...=E3=81=AE=E6=96=87=E3=81=A8=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 350004a1..9ab01913 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -377,7 +377,7 @@ fdf4fc3344e67ab068f836878b6c4951e3b15f3d ////////////////////////// Now you can look at your new commit object with `cat-file`: ////////////////////////// -これで `cat-file` コマンドを呼んで新しいコミットオブジェクトを見ることができます。 +これで、`cat-file` コマンドを使って、新しいコミットオブジェクトを見られるようになりました。 [source,console] ---- From 147f6327dba53659d80b1f9d46edaa84e541ec65 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:05:15 +0900 Subject: [PATCH 31/43] =?UTF-8?q?-=20=E6=96=87=E3=81=AE=E4=B8=A6=E5=88=97?= =?UTF-8?q?=E9=96=A2=E4=BF=82=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20-=20au?= =?UTF-8?q?thor=E3=82=84commiter=E3=81=AF=E4=BB=96=E3=81=AE=E7=AB=A0?= =?UTF-8?q?=E3=81=A7=E3=82=82=E3=80=8C=E4=BD=9C=E8=80=85=E3=80=8D=E3=82=84?= =?UTF-8?q?=E3=80=8C=E3=82=B3=E3=83=9F=E3=83=83=E3=82=BF=E3=83=BC=E3=80=8D?= =?UTF-8?q?=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E5=8E=9F=E8=AA=9E?= =?UTF-8?q?=E3=81=AF=E5=89=8A=E9=99=A4=20-=20blank=20line=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E7=A9=BA=E8=A1=8C=E3=80=8D=20-=20=E3=80=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E3=81=97=E3=81=A6=E3=81=84=E3=81=BE=E3=81=99=E3=80=8D?= =?UTF-8?q?=E3=81=A0=E3=81=A8=E5=AE=9F=E9=9A=9B=E3=81=AE=E3=82=B3=E3=83=9F?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=81=AE=E3=82=88=E3=81=86=E3=81=AB=E8=81=9E=E3=81=93=E3=81=88?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=8C=E4=BD=BF=E7=94=A8=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=99=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 9ab01913..130a8dc5 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -392,7 +392,7 @@ first commit ////////////////////////// The format for a commit object is simple: it specifies the top-level tree for the snapshot of the project at that point; the author/committer information (which uses your `user.name` and `user.email` configuration settings and a timestamp); a blank line, and then the commit message. ////////////////////////// -コミットオブジェクトの形式はシンプルです。それはプロジェクトのその時点のスナップショットに対して、トップレベルのツリーを指定します。その時点のスナップショットには、作者(author)/コミッター(committer)の情報(`user.name` および `user.email` の設定と現在のタイムスタンプを使用しています)、ブランクライン、そしてコミットメッセージが含まれます。 +コミットオブジェクトの形式はシンプルです。その内容は、プロジェクトのある時点でのスナップショットのトップレベルのツリー、作者とコミッターの情報(`user.name` および `user.email` の設定と現在のタイムスタンプを使用します)、空行、そしてコミットメッセージとなっています。 ////////////////////////// Next, you'll write the other two commit objects, each referencing the commit that came directly before it: From 29d33ec6863cf325890527b3d03cf0eaa8404641 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:06:17 +0900 Subject: [PATCH 32/43] =?UTF-8?q?-=20=E3=80=8C=E7=9B=B4=E5=89=8D=E3=81=AB?= =?UTF-8?q?=E6=9D=A5=E3=81=9F=E3=80=8D=E3=81=AE=E3=80=8C=E6=9D=A5=E3=81=9F?= =?UTF-8?q?=E3=80=8D=E3=81=AFcame=E3=81=AE=E7=9B=B4=E8=A8=B3=E3=81=A0?= =?UTF-8?q?=E3=81=8C=E7=9C=81=E7=95=A5=E3=81=97=E3=81=A6=E3=82=82=E6=84=8F?= =?UTF-8?q?=E5=91=B3=E3=81=8C=E5=A4=89=E3=82=8F=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 130a8dc5..bfedd9c0 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -397,7 +397,7 @@ The format for a commit object is simple: it specifies the top-level tree for th ////////////////////////// Next, you'll write the other two commit objects, each referencing the commit that came directly before it: ////////////////////////// -次に、あなたは二つのコミットオブジェクトを書き込みます。各コミットオブジェクトはその直前に来たコミットを参照しています。 +次に、コミットオブジェクトを新たに二つ書き込みます。各コミットオブジェクトはその直前のコミットを参照しています。 [source,console] ---- From b31e798d12f58d17af23f9874a95fe4b29444328 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:21:45 +0900 Subject: [PATCH 33/43] =?UTF-8?q?-=20you=20created=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E3=81=82=E3=81=AA=E3=81=9F=E3=81=8C=E3=81=93=E3=82=8C=E3=81=BE?= =?UTF-8?q?=E3=81=A7=E3=81=AB=E4=BD=9C=E6=88=90=E3=81=97=E3=81=9F=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E6=84=8F=E5=91=B3=20-=20Oddly=20enough=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E5=A5=87=E5=A6=99=E3=81=AA=E3=81=93=E3=81=A8=E3=81=A0?= =?UTF-8?q?=E3=81=8C=E3=80=8D=20-=20you=20have=20...=20=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E3=81=93=E3=82=8C=E3=81=BE=E3=81=A7=E3=81=AE=E4=BD=9C=E6=A5=AD?= =?UTF-8?q?=E3=81=AE=E7=B5=90=E6=9E=9C=E3=81=A8=E3=81=97=E3=81=A6=E6=89=8B?= =?UTF-8?q?=E5=85=83=E3=81=AB=E3=81=A7=E3=81=8D=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E6=84=8F=E5=91=B3=20-=20=E3=80=8C=E3=82=82?= =?UTF-8?q?=E3=81=97=E3=82=82=E3=80=8D=E3=81=A8=E3=80=8C=E3=80=9C=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=80=8D=E3=81=AF=E6=84=8F=E5=91=B3=E3=81=8C?= =?UTF-8?q?=E9=87=8D=E8=A4=87=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E3=80=8C=E3=82=82=E3=81=97=E3=82=82=E3=80=8D=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index bfedd9c0..0ad2fc6a 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -411,7 +411,8 @@ $ echo 'third commit' | git commit-tree 3c4e9c -p cac0cab Each of the three commit objects points to one of the three snapshot trees you created. Oddly enough, you have a real Git history now that you can view with the `git log` command, if you run it on the last commit SHA-1: ////////////////////////// -三つのコミットオブジェクトは、それぞれ、あなたが作成した三つのスナップショットのツリーのひとつを指し示しています。面白いことに、あなたは本物のGitヒストリーを持っており、`git log` コマンドによってログをみることができます。もしも最後のコミットの SHA-1ハッシュを指定して実行すると、 +三つのコミットオブジェクトは、それぞれ、これまでに作成した三つのスナップショットのツリーのひとつを指しています。 +奇妙なことに、これで本物のGitヒストリーができており、`git log` コマンドによってログを表示できます。最後のコミットのSHA-1ハッシュを指定して実行すると、 [source,console] ---- From cf0e61d14c8b3cbd5511731ac23ca0a47b3e1556 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:31:55 +0900 Subject: [PATCH 34/43] =?UTF-8?q?-=20amazing=E3=81=AF=E3=80=8C=E9=A9=9A?= =?UTF-8?q?=E3=81=8F=E3=81=B9=E3=81=8D=E3=81=93=E3=81=A8=E3=81=A7=E3=81=99?= =?UTF-8?q?=E3=80=8D=E3=81=A0=E3=81=A8=E7=A1=AC=E3=81=84=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E3=80=8C=E7=B4=A0=E6=99=B4=E3=82=89=E3=81=97=E3=81=84=E3=80=8D?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=20-=20low-level=E3=81=AF=E3=80=8C?= =?UTF-8?q?=E4=BD=8E=E3=83=AC=E3=83=99=E3=83=AB=E3=80=8D=E3=81=AB=E7=B5=B1?= =?UTF-8?q?=E4=B8=80=20-=20history=E3=81=AF=E3=80=8C=E6=AD=B4=E5=8F=B2?= =?UTF-8?q?=E3=80=8D=E3=81=AB=E7=B5=B1=E4=B8=80=20-=20build=20up=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E7=AF=89=E3=81=8D=E3=81=82=E3=81=92=E3=82=8B=E3=80=8D?= =?UTF-8?q?=E3=80=8C=E4=BD=9C=E3=82=8A=E4=B8=8A=E3=81=92=E3=82=8B=E3=80=8D?= =?UTF-8?q?=20-=20=E3=80=8C=E3=81=9F=E3=81=A0=E3=80=8D=E3=81=A8=E3=80=8C?= =?UTF-8?q?=E3=81=A0=E3=81=91=E3=81=A7=E3=80=8D=E3=81=AF=E6=84=8F=E5=91=B3?= =?UTF-8?q?=E3=81=8C=E9=87=8D=E8=A4=87=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=8C=E3=81=9F=E3=81=A0=E3=80=8D=E3=81=AF?= =?UTF-8?q?=E5=89=8A=E9=99=A4=20-=20this=20is=20what=20...=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E3=80=9C=E3=81=A8=E5=90=8C=E3=81=98=E3=80=8D=20-=20in?= =?UTF-8?q?itially=E3=81=AF=E3=80=8C=E3=81=BE=E3=81=9A=E3=81=AF=E3=80=8D?= =?UTF-8?q?=EF=BC=88=E3=81=82=E3=81=A8=E3=81=A7=E5=9C=A7=E7=B8=AE=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 0ad2fc6a..9db5f800 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -453,7 +453,11 @@ This is essentially what Git does when you run the `git add` and `git commit` co These three main Git objects – the blob, the tree, and the commit – are initially stored as separate files in your `.git/objects` directory. Here are all the objects in the example directory now, commented with what they store: ////////////////////////// -驚くべきことです。あなたはフロントエンドのコマンドを利用せずに、ただ下位レベルのオペレーションを行っただけで Git ヒストリーを形成したのです。これは `git add` コマンドと `git commit` コマンドを実行するときに Git が行う本質的なことなのです。それは変更されたファイルに対応して、ブロブを格納し、インデックスを更新し、ツリーを書き出します。そして、トップレベルのツリーとそれらの直前に来たコミットを参照するコミットオブジェクトを書きます。これらの三つの主要な Git オブジェクト - ブロブとツリーとコミットは、`.git/object` ディレクトリに分割されたファイルとして最初に格納されます。こちらは、例のディレクトリに今あるすべてのオブジェクトであり、それらが何を格納しているのかコメントされています。 +素晴らしい。 +フロントエンドのコマンドを利用せずに、低レベルのオペレーションだけでGitの歴史を作り上げたのです。 +これは、本質的に `git add` コマンドと `git commit` コマンドを実行するときにGitが行っていることと同じです。変更されたファイルに対応するブロブを格納し、インデックスを更新し、ツリーを書き出し、トップレベルのツリーと、その直前のコミットを参照するコミットオブジェクトとを書き出しています。 +これらの三つの主要な Git オブジェクト – ブロブとツリーとコミット – は、まずは個別のファイルとして `.git/object` ディレクトリに格納されます。 +現在、サンプルのディレクトリにあるすべてのオブジェクトを以下に示します。コメントは、それぞれ何を格納しているのかを示します。 [source,console] ---- From fd4bc91a3864062cb4b022893085d311c2607cf3 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:32:44 +0900 Subject: [PATCH 35/43] =?UTF-8?q?-=20=E3=80=8C=E3=82=82=E3=81=97=E3=80=8D?= =?UTF-8?q?=E3=81=A8=E3=80=8C=E3=82=86=E3=81=91=E3=81=B0=E3=80=8D=E3=81=AF?= =?UTF-8?q?=E6=84=8F=E5=91=B3=E3=81=8C=E9=87=8D=E8=A4=87=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=8C=E3=82=82=E3=81=97?= =?UTF-8?q?=E3=80=8D=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 9db5f800..a9de981e 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -477,7 +477,7 @@ $ find .git/objects -type f ////////////////////////// If you follow all the internal pointers, you get an object graph something like this: ////////////////////////// -もしすべての内部のポインタを辿ってゆけば、次のようなオブジェクトグラフを得られます。 +すべての内部のポインタを辿ってゆけば、次のようなオブジェクトグラフが得られます。 ////////////////////////// .All the objects in your Git directory. From 113e7d837a0702a0b4d8de349f3a883d2afa5454 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:37:33 +0900 Subject: [PATCH 36/43] =?UTF-8?q?-=20interactively=E3=81=AFstore=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=8Fsee=E3=81=AB=E3=81=8B=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index a9de981e..b74563b0 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -483,8 +483,8 @@ If you follow all the internal pointers, you get an object graph something like .All the objects in your Git directory. image::images/data-model-3.png[All the objects in your Git directory.] ////////////////////////// -.Gitレポジトリ内のすべてのオブジェクト -image::images/data-model-3.png[Gitレポジトリ内のすべてのオブジェクト] +.Gitリポジトリ内のすべてのオブジェクト +image::images/data-model-3.png[Gitリポジトリ内のすべてのオブジェクト] ////////////////////////// ==== Object Storage @@ -496,7 +496,9 @@ We mentioned earlier that a header is stored with the content. Let's take a minute to look at how Git stores its objects. You'll see how to store a blob object – in this case, the string ``what is up, doc?'' – interactively in the Ruby scripting language. ////////////////////////// -ヘッダはコンテンツと一緒に格納されることを、以前に述べました。少し時間を割いて、Git がどのようにしてオブジェクトを格納するのかを見ていきましょう。あなたはブロブオブジェクトがどのように格納されるのかを見ることになるでしょう。このケースでは ``what is up, doc?'' という文字列が Rubyスクリプト言語の中で対話的に格納されます。 +ヘッダはコンテンツと一緒に格納されることを、以前に述べました。 +ここでは少し時間を割いて、Gitがどのようにオブジェクトを格納するのかを見ていきましょう。 +以降では、ブロブオブジェクト – ここでは ``what is up, doc?'' という文字列 – がどのように格納されるのかを、Ruby言語を使って対話的に見ていきます。 ////////////////////////// You can start up interactive Ruby mode with the `irb` command: From 5611758fb72c154b8ea39346bdf661b1f460abe1 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:46:25 +0900 Subject: [PATCH 37/43] =?UTF-8?q?-=20=E3=80=8C=E5=AF=BE=E8=A9=B1=E7=9A=84?= =?UTF-8?q?=E3=81=AARuby=E3=83=A2=E3=83=BC=E3=83=89=E3=80=8D=E3=81=A0?= =?UTF-8?q?=E3=81=A8=E6=84=8F=E5=91=B3=E3=81=8C=E9=80=9A=E3=81=98=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index b74563b0..36c25e7c 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -503,7 +503,7 @@ You'll see how to store a blob object – in this case, the string ``what is up, ////////////////////////// You can start up interactive Ruby mode with the `irb` command: ////////////////////////// -`irb` コマンドを使って対話的な Rubyモードを開始します。 +`irb` コマンドで、対話モードでRubyを起動します。 [source,console] ---- From 216f26db533e01e0efb53bad06fd092f0d34f9f2 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:48:59 +0900 Subject: [PATCH 38/43] =?UTF-8?q?-=20start=20with=20=E3=80=9C=E3=81=AF?= =?UTF-8?q?=E3=81=93=E3=81=93=E3=81=A7=E3=81=AF=E3=80=8C=E6=9C=80=E5=88=9D?= =?UTF-8?q?=E3=81=AB=E3=80=9C=E3=81=8C=E6=9D=A5=E3=82=8B=E3=80=8D=20-=20ty?= =?UTF-8?q?pe=20of=20the=20object=E3=81=AF=E3=80=8C=E3=82=AA=E3=83=96?= =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=82=BF=E3=82=A4=E3=83=97?= =?UTF-8?q?=E3=80=8D=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E3=82=AA?= =?UTF-8?q?=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=97=E3=80=8D=20-=20followed=20by=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E3=80=9C=E3=81=AB=E5=BE=93=E3=81=A3=E3=81=A6=E3=80=8D?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E3=80=9C=E3=81=AB?= =?UTF-8?q?=E7=B6=9A=E3=81=84=E3=81=A6=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 36c25e7c..cae29a64 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -516,7 +516,8 @@ $ irb Git constructs a header that starts with the type of the object, in this case a blob. Then, it adds a space followed by the size of the content and finally a null byte: ////////////////////////// -Git はオブジェクトタイプで開始するヘッダを構成します。このケースではブロブのタイプです。そして、コンテンツのサイズに従ってスペースを追加して、最後にヌルバイトを追加します。 +Gitがヘッダを構築する際には、まず初めにオブジェクトのタイプを表す文字列が来ます。この場合はblobです。 +次に、スペースに続いてコンテンツのサイズ、最後にヌルバイトが追加されます。 [source,console] ---- From f91f43833078d47a246fc31fd9e3a17f4be44780 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:51:09 +0900 Subject: [PATCH 39/43] =?UTF-8?q?-=20=E3=81=93=E3=81=93=E3=81=A7=E3=81=AFo?= =?UTF-8?q?riginal=E3=81=AF=E3=80=8C=E5=85=83=E3=80=85=E3=81=AE=E3=80=8D?= =?UTF-8?q?=E3=81=A8=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=81=AB=E7=9B=B4=E3=81=9B?= =?UTF-8?q?=E3=82=8B=20-=20=E3=80=8C=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?UTF-8?q?=E3=83=88=E5=86=85=E3=81=AB=E3=80=8D=E3=81=A8=E3=81=84=E3=81=86?= =?UTF-8?q?=E8=AA=9E=E3=81=AF=E5=8E=9F=E6=96=87=E3=81=AB=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4=20-=20=E3=80=8C=E3=80=9C?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=80=8D=E3=81=AF=E3=80=8C=E3=80=9C=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=80=8D=E3=81=AB=E7=9F=AD=E7=B8=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index cae29a64..7f8b7f3f 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -529,7 +529,8 @@ Gitがヘッダを構築する際には、まず初めにオブジェクトの Git concatenates the header and the original content and then calculates the SHA-1 checksum of that new content. You can calculate the SHA-1 value of a string in Ruby by including the SHA1 digest library with the `require` command and then calling `Digest::SHA1.hexdigest()` with the string: ////////////////////////// -Git はヘッダとオリジナルのコンテンツとを結合して、その新しいコンテンツの SHA-1チェックサムを計算します。Rubyスクリプト内に書かれた文字列のSHA-1のハッシュ値は、`require` を使用して SHA1ダイジェストライブラリをインクルードし、文字列を引数にして `Digest::SHA1.hexdigest()` 関数を呼ぶことで求めることができます。 +Gitはこのヘッダと元々のコンテンツとを結合して、その新しいコンテンツのSHA-1チェックサムを計算します。 +Rubyでは、文字列のSHA-1のハッシュ値は、`require` を使用してSHA1ダイジェストライブラリをインクルードし、文字列を引数にして `Digest::SHA1.hexdigest()` 関数を呼ぶことで求められます。 [source,console] ---- From d200bb205528eb4d0019f7020be744cae2bd0ef2 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:52:21 +0900 Subject: [PATCH 40/43] =?UTF-8?q?-=20which=20you=20can=20do=E3=81=AF?= =?UTF-8?q?=E3=80=8C=E5=90=8C=E3=81=98=E3=81=93=E3=81=A8=E3=81=AF=E3=80=9C?= =?UTF-8?q?=E3=81=A7=E3=81=A7=E3=81=8D=E3=82=8B=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 7f8b7f3f..cf648630 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -546,7 +546,8 @@ Rubyでは、文字列のSHA-1のハッシュ値は、`require` を使用してS Git compresses the new content with zlib, which you can do in Ruby with the zlib library. First, you need to require the library and then run `Zlib::Deflate.deflate()` on the content: ////////////////////////// -Gitは zlib を用いて新しいコンテンツを圧縮します。Rubyにある zlibライブラリをインクルードして使用します。まず、require を使用して zlib ライブラリをインクルードし、コンテンツに対して `Zlib::Deflate.deflate()` を実行します。 +Gitはzlibを用いてこの新しいコンテンツを圧縮します。Rubyではzlibライブラリをインクルードすれば同じことが行えます。 +まず、requireを使用してzlibライブラリをインクルードし、コンテンツに対して `Zlib::Deflate.deflate()` を実行します。 [source,console] ---- From 85886b02d5c6cb9358fc9afc8f68381406a7a35a Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:54:05 +0900 Subject: [PATCH 41/43] =?UTF-8?q?-=20zlib-deflated=E3=81=AF=E3=80=8Czlib?= =?UTF-8?q?=E3=81=A7deflate=E5=9C=A7=E7=B8=AE=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index cf648630..f98c38f0 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -563,7 +563,10 @@ You'll determine the path of the object you want to write out (the first two cha In Ruby, you can use the `FileUtils.mkdir_p()` function to create the subdirectory if it doesn't exist. Then, open the file with `File.open()` and write out the previously zlib-compressed content to the file with a `write()` call on the resulting file handle: ////////////////////////// -最後に、zlibで圧縮された(zlib-deflated)コンテンツをディスク上のオブジェクトに書き込みます。オブジェクトの書き込み先のパスを決定します(SHA-1ハッシュ値の最初の2文字はサブディレクトリの名前で、残りの38文字はそのディレクトリ内のファイル名になります)。Rubyでは、`FileUtils.mkdir_p()` 関数を使用して(存在しない場合に)サブディレクトリを作成することができます。そして、`File.open()` によってファイルを開いて、前に zlib で圧縮された(zlib-compressed)コンテンツをファイルに書き出します。ファイルへの書き出しは、開いたファイルのハンドルに対して `write()` を呼ぶことで行います。 +最後に、zlibでdeflate圧縮されたコンテンツをディスク上のオブジェクトに書き込みます。 +まず、オブジェクトを書き出す先のパスを決定します(SHA-1ハッシュ値の最初の2文字はサブディレクトリの名前で、残りの38文字はそのディレクトリ内のファイル名になります)。 +Rubyでは、サブディレクトリが存在しない場合、 `FileUtils.mkdir_p()` 関数で作成できます。 +そして、`File.open()` によってファイルを開いて、前にzlibで圧縮したコンテンツをファイルに書き出します。ファイルへの書き出しは、開いたファイルのハンドルに対して `write()` を呼ぶことで行います。 [source,console] ---- From bdd48595fbf72120ffa72b5ab3a826cc0775b3ec Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Fri, 9 Oct 2015 01:58:46 +0900 Subject: [PATCH 42/43] =?UTF-8?q?-=20that's=20it=E3=82=92=E3=80=8C?= =?UTF-8?q?=E3=81=93=E3=82=8C=E3=81=A7=E7=B5=82=E3=82=8F=E3=82=8A=E3=81=A7?= =?UTF-8?q?=E3=81=99=E3=80=8D=E3=81=A8=E3=81=99=E3=82=8B=E3=81=A8=E5=85=A8?= =?UTF-8?q?=E4=BD=93=E3=81=AE=E3=81=BE=E3=81=A8=E3=82=81=E3=81=8C=E5=A7=8B?= =?UTF-8?q?=E3=81=BE=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E8=AA=AD=E3=82=81?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3=20-=20valid?= =?UTF-8?q?=E3=81=AFXML=E7=AD=89=E3=81=A0=E3=81=A8=E3=80=8C=E5=A6=A5?= =?UTF-8?q?=E5=BD=93=E3=81=AA=E3=80=8D=E3=81=A0=E3=81=8C=E3=81=93=E3=81=93?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=80=8C=E6=AD=A3=E5=BD=93=E3=81=AA=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E6=96=B9=E3=81=8C=E6=96=87=E8=84=88=E3=81=AB=E3=81=82?= =?UTF-8?q?=E3=81=86=20-=20different=20types=E3=81=AF=E3=80=8C=E7=95=B0?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=82=BF=E3=82=A4=E3=83=97=E3=80=8D=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E3=81=84=E3=82=8D=E3=81=84?= =?UTF-8?q?=E3=82=8D=E3=81=AA=E3=82=BF=E3=82=A4=E3=83=97=E3=80=8D=20-=20st?= =?UTF-8?q?ring=20blob=E3=81=AF=E3=80=8C=E3=83=96=E3=83=AD=E3=83=96?= =?UTF-8?q?=E3=81=AE=E6=96=87=E5=AD=97=E5=88=97=E3=80=8D=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=80=8Cblob=E3=81=A8=E3=81=84=E3=81=86?= =?UTF-8?q?=E6=96=87=E5=AD=97=E5=88=97=E3=80=8D=20-=20specifically?= =?UTF-8?q?=E3=81=AF=E3=80=8C=E7=89=B9=E5=AE=9A=E7=9A=84=E3=81=AB=E3=80=8D?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=80=8C=E5=8E=B3=E5=AF=86?= =?UTF-8?q?=E3=81=AB=E3=80=8D=E3=81=AE=E6=96=B9=E3=81=8C=E6=97=A5=E6=9C=AC?= =?UTF-8?q?=E8=AA=9E=E3=82=89=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index f98c38f0..35a226b0 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -585,4 +585,6 @@ That's it – you've created a valid Git blob object. All Git objects are stored the same way, just with different types – instead of the string blob, the header will begin with commit or tree. Also, although the blob content can be nearly anything, the commit and tree content are very specifically formatted. ////////////////////////// -これで終わりです。あなたは妥当な Git ブロブオブジェクトを作りました。ただタイプが異なるだけで、Git オブジェクトはすべて同じ方法で格納されます。ブロブの文字列ではない場合には、ヘッダはコミットまたはツリーから始まります。また、ブロブのコンテンツはほぼ何にでもなれるのに対して、コミットとツリーのコンテンツはかなり特定的に形式付けられています。 +これだけです。これで、正当なGitブロブオブジェクトが出来上がりました。 +Gitオブジェクトはすべて同じ方法で格納されますが、オブジェクトのタイプだけは様々で、blobという文字列の代わりに、commitやtreeといった内容で始まります。 +また、オブジェクトタイプがブロブの場合、コンテンツはほぼ何でもよいですが、コミットとツリーの場合、コンテンツは非常に厳密に形式が定められています。 From 1ae1e950ec2c37476feb4cc5ddece4d1ca22a582 Mon Sep 17 00:00:00 2001 From: Yusuke SATO Date: Tue, 20 Oct 2015 02:28:22 +0900 Subject: [PATCH 43/43] =?UTF-8?q?-=20=E3=83=97=E3=83=AB=E3=83=AA=E3=82=AF?= =?UTF-8?q?=E3=82=A8=E3=82=B9=E3=83=88=E3=81=AE=E6=8C=87=E6=91=98=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E3=81=99=E3=82=8B=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/10-git-internals/sections/objects.asc | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 35a226b0..c7aaef24 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -19,7 +19,7 @@ Git は内容アドレスファイルシステムです。 それは、Gitのコアの部分はシンプルなキー・バリュー型データストアである、という意味です。 ここにはどんな種類のコンテンツでも格納でき、それに対応するキーが返されます。キーを使えば格納したコンテンツをいつでも取り出せます。 これは `hash-object` という配管コマンドを使えば実際に確認できます。このコマンドはデータを受け取り、それを `.git` ディレクトリに格納し、そのデータを格納しているキーを返します。 -まずは、初期化された新しいGitリポジトリには `objects` ディレクトリが存在しないことを確認します。 +まずは、新しいGitリポジトリを初期化し、 `objects` ディレクトリ配下に何もないことを確認してみましょう。 [source,console] ---- @@ -122,7 +122,7 @@ $ git hash-object -w test.txt ////////////////////////// Your database contains the two new versions of the file as well as the first content you stored there: ////////////////////////// -データベースには、最初に格納したコンテンツに加えて、上記のファイルのバージョン二つが新規に追加されています。 +データベースには、最初に格納したコンテンツに加えて、上記のファイルのバージョン2つが新規に追加されています。 [source,console] ---- @@ -147,7 +147,7 @@ version 1 ////////////////////////// or the second version: ////////////////////////// -また、二つ目のバージョンにもできます。 +また、2つ目のバージョンにもできます。 [source,console] ---- @@ -161,7 +161,7 @@ But remembering the SHA-1 key for each version of your file isn't practical; plu This object type is called a blob. You can have Git tell you the object type of any object in Git, given its SHA-1 key, with `cat-file -t`: ////////////////////////// -しかし、それぞれのファイルのバージョンのSHA-1キーを覚えておくのは実用的ではありません。加えて、ファイル名はシステムに格納されておらず、ファイルの内容のみが格納されています。 +しかし、それぞれのファイルのバージョンのSHA-1キーを覚えておくのは実用的ではありません。加えて、システムにはファイル名は格納されておらず、ファイルの内容のみが格納されています。 このオブジェクトタイプはブロブ(blob)と呼ばれます。 `cat-file -t` コマンドに SHA-1キーを渡すことで、あなたは Git 内にあるあらゆるオブジェクトのタイプを問い合わせることができます。 @@ -254,7 +254,7 @@ The mode is taken from normal UNIX modes but is much less flexible – these thr ////////////////////////// この例では、`100644` のモードを指定しています。これは、それが通常のファイルであることを意味します。 他に指定できるモードとしては、実行可能ファイルであることを意味する `100755` や、シンボリックリンクであることを示す `120000` があります。 -このモードは通常の UNIX モードから取り入れた概念ですが、それほど柔軟性はありません。Git中のファイル(ブロブ)に対しては、上記三つのモードのみが有効です(ディレクトリとサブモジュールに対しては他のモードも使用できます)。 +このモードは通常の UNIX モードから取り入れた概念ですが、それほどの柔軟性はありません。Git中のファイル(ブロブ)に対しては、上記3つのモードのみが有効です(ディレクトリとサブモジュールに対しては他のモードも使用できます)。 ////////////////////////// Now, you can use the `write-tree` command to write the staging area out to a tree object. @@ -285,7 +285,7 @@ tree ////////////////////////// You'll now create a new tree with the second version of test.txt and a new file as well: ////////////////////////// -今度は、二つめのバージョンのtest.txtと、新規作成したファイルから、新しくツリーを作ります。 +今度は、2つめのバージョンのtest.txtと、新規作成したファイルから、新しくツリーを作ります。 [source,console] ---- @@ -298,8 +298,8 @@ $ git update-index --add new.txt Your staging area now has the new version of test.txt as well as the new file new.txt. Write out that tree (recording the state of the staging area or index to a tree object) and see what it looks like: ////////////////////////// -これでステージングエリアには、新しいバージョンのtest.txtに加えて、new.txtという新しいファイルが登録されました。 -このツリー(ステージングエリアまたはインデックスの状態をツリーオブジェクトとして記録しているツリー)を書き出して、どのようになったか見てみましょう。 +これでステージングエリアには、new.txtという新しいファイルに加えて、新しいバージョンのtest.txtも登録されました。 +このツリーを書き出して(ステージングエリアまたはインデックスの状態をツリーオブジェクトとして記録して)、どのようになったか見てみましょう。 [source,console] ---- @@ -336,15 +336,15 @@ $ git cat-file -p 3c4e9cd789d88d8d89c1073707c3585e41b0e614 If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the test.txt file. You can think of the data that Git contains for these structures as being like this: ////////////////////////// -先ほど書き込んだ新しいツリーから作業ディレクトリを作っていれば、作業ディレクトリの直下にファイルが二つと、最初のバージョンのtest.txtファイルが含まれている `bak` という名前のサブディレクトリが入ります。 -このような構造に対し、Gitが格納するデータのイメージは次のようになります。 +先ほど書き込んだ新しいツリーから作業ディレクトリを作っていれば、作業ディレクトリの直下にファイルが2つと、最初のバージョンのtest.txtファイルが含まれている `bak` という名前のサブディレクトリが入ります。 +このような構成に対し、Gitが格納するデータのイメージは次のようになります。 ////////////////////////// .The content structure of your current Git data. image::images/data-model-2.png[The content structure of your current Git data.] ////////////////////////// -.現在のGitデータの内容の構造 -image::images/data-model-2.png[現在のGitデータの内容の構造] +.現在のGitデータの内容の構成 +image::images/data-model-2.png[現在のGitデータの内容の構成] [[_git_commit_objects]] ////////////////////////// @@ -357,7 +357,7 @@ You have three trees that specify the different snapshots of your project that y You also don't have any information about who saved the snapshots, when they were saved, or why they were saved. This is the basic information that the commit object stores for you. ////////////////////////// -追跡したいプロジェクトに対し、それぞれ異なる内容のスナップショットを示すツリー三つができました。ですが、各スナップショットを呼び戻すには3つのSHA-1の値すべてを覚えておかなければならない、という以前からの問題は残ったままです。 +追跡したいプロジェクトに対し、それぞれ異なる内容のスナップショットを示すツリー3つができました。ですが、各スナップショットを呼び戻すには3つのSHA-1の値すべてを覚えておかなければならない、という以前からの問題は残ったままです。 さらに、そのスナップショットを誰が、いつ、どのような理由で保存したのかについての情報が一切ありません。 これはコミットオブジェクトに保存される基本的な情報です。 @@ -365,7 +365,7 @@ This is the basic information that the commit object stores for you. To create a commit object, you call `commit-tree` and specify a single tree SHA-1 and which commit objects, if any, directly preceded it. Start with the first tree you wrote: ////////////////////////// -コミットオブジェクトを作成するには、ツリーのSHA-1を一つと、もしそれの直前に来るコミットオブジェクトがあれば、それらを指定して `commit-tree` を呼びます。 +コミットオブジェクトを作成するには、ツリーのSHA-1を1つと、もしそれの直前に来るコミットオブジェクトがあれば、それらを指定して `commit-tree` を呼びます。 最初に書き込んだツリーから始めましょう。 [source,console] @@ -392,12 +392,12 @@ first commit ////////////////////////// The format for a commit object is simple: it specifies the top-level tree for the snapshot of the project at that point; the author/committer information (which uses your `user.name` and `user.email` configuration settings and a timestamp); a blank line, and then the commit message. ////////////////////////// -コミットオブジェクトの形式はシンプルです。その内容は、プロジェクトのある時点でのスナップショットのトップレベルのツリー、作者とコミッターの情報(`user.name` および `user.email` の設定と現在のタイムスタンプを使用します)、空行、そしてコミットメッセージとなっています。 +コミットオブジェクトの形式はシンプルです。その内容は、コミットが作成された時点のスナップショットのトップレベルのツリー、作者とコミッターの情報(`user.name` および `user.email` の設定と現在のタイムスタンプを使用します)、空行、そしてコミットメッセージとなっています。 ////////////////////////// Next, you'll write the other two commit objects, each referencing the commit that came directly before it: ////////////////////////// -次に、コミットオブジェクトを新たに二つ書き込みます。各コミットオブジェクトはその直前のコミットを参照しています。 +次に、コミットオブジェクトを新たに2つ書き込みます。各コミットオブジェクトはその直前のコミットを参照しています。 [source,console] ---- @@ -411,8 +411,8 @@ $ echo 'third commit' | git commit-tree 3c4e9c -p cac0cab Each of the three commit objects points to one of the three snapshot trees you created. Oddly enough, you have a real Git history now that you can view with the `git log` command, if you run it on the last commit SHA-1: ////////////////////////// -三つのコミットオブジェクトは、それぞれ、これまでに作成した三つのスナップショットのツリーのひとつを指しています。 -奇妙なことに、これで本物のGitヒストリーができており、`git log` コマンドによってログを表示できます。最後のコミットのSHA-1ハッシュを指定して実行すると、 +3つのコミットオブジェクトは、それぞれ、これまでに作成した3つのスナップショットのツリーのひとつを指しています。 +奇妙なことに、これで本物のGitヒストリーができており、`git log` コマンドによってログを表示できます。最後のコミットのSHA-1ハッシュを指定して実行すると…… [source,console] ---- @@ -456,7 +456,7 @@ Here are all the objects in the example directory now, commented with what they 素晴らしい。 フロントエンドのコマンドを利用せずに、低レベルのオペレーションだけでGitの歴史を作り上げたのです。 これは、本質的に `git add` コマンドと `git commit` コマンドを実行するときにGitが行っていることと同じです。変更されたファイルに対応するブロブを格納し、インデックスを更新し、ツリーを書き出し、トップレベルのツリーと、その直前のコミットを参照するコミットオブジェクトとを書き出しています。 -これらの三つの主要な Git オブジェクト – ブロブとツリーとコミット – は、まずは個別のファイルとして `.git/object` ディレクトリに格納されます。 +これらの3つの主要な Git オブジェクト – ブロブとツリーとコミット – は、まずは個別のファイルとして `.git/object` ディレクトリに格納されます。 現在、サンプルのディレクトリにあるすべてのオブジェクトを以下に示します。コメントは、それぞれ何を格納しているのかを示します。 [source,console] @@ -498,7 +498,7 @@ You'll see how to store a blob object – in this case, the string ``what is up, ////////////////////////// ヘッダはコンテンツと一緒に格納されることを、以前に述べました。 ここでは少し時間を割いて、Gitがどのようにオブジェクトを格納するのかを見ていきましょう。 -以降では、ブロブオブジェクト – ここでは ``what is up, doc?'' という文字列 – がどのように格納されるのかを、Ruby言語を使って対話的に見ていきます。 +以降では、ブロブオブジェクト – ここでは ``what is up, doc?'' という文字列 – をRuby言語を使って対話的に格納する方法を説明します。 ////////////////////////// You can start up interactive Ruby mode with the `irb` command: @@ -586,5 +586,5 @@ All Git objects are stored the same way, just with different types – instead o Also, although the blob content can be nearly anything, the commit and tree content are very specifically formatted. ////////////////////////// これだけです。これで、正当なGitブロブオブジェクトが出来上がりました。 -Gitオブジェクトはすべて同じ方法で格納されますが、オブジェクトのタイプだけは様々で、blobという文字列の代わりに、commitやtreeといった内容で始まります。 +Gitオブジェクトはすべて同じ方法で格納されますが、オブジェクトのタイプだけは様々で、ヘッダーが blobという文字列ではなく、commitやtreeという文字列で始まることもあります。 また、オブジェクトタイプがブロブの場合、コンテンツはほぼ何でもよいですが、コミットとツリーの場合、コンテンツは非常に厳密に形式が定められています。