From c12d93daf599a3d39e2d06acfead935ba618d2ae Mon Sep 17 00:00:00 2001 From: Rafi Date: Sun, 4 Mar 2018 14:56:30 +0530 Subject: [PATCH 1/5] git cat-file -p master^{tree} in other shells usage of git cat-file -p master^{tree} command in other shells as specified in this answer https://stackoverflow.com/a/17121954/2445295 thanks to @Mellbourn --- book/10-git-internals/sections/objects.asc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 9600bf978..54dc9a9ba 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -139,6 +139,12 @@ $ 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: +**NOTE**: while using `master^{tree}` syntax if you have error try the following + +* On Windows, in PowerShell and cmd.exe, ^ is used for escaping. There, you can alternatively write git `cat-file -p master^^{tree}` +* In zsh `^` is a globbing character so use them with quotes `git cat-file -p "master^{tree}"` +* In bash the command works without quotes + [source,console] ---- $ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 From ecf144b8731ac79ae79fcc18f471e5ea64d32377 Mon Sep 17 00:00:00 2001 From: Rafi Date: Wed, 7 Mar 2018 07:13:59 +0530 Subject: [PATCH 2/5] NOTE style changed and its content rephrased NOTE heading style changed and its content rephrased --- book/10-git-internals/sections/objects.asc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 54dc9a9ba..85d3ca96e 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -139,11 +139,12 @@ $ 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: -**NOTE**: while using `master^{tree}` syntax if you have error try the following - -* On Windows, in PowerShell and cmd.exe, ^ is used for escaping. There, you can alternatively write git `cat-file -p master^^{tree}` -* In zsh `^` is a globbing character so use them with quotes `git cat-file -p "master^{tree}"` -* In bash the command works without quotes +[NOTE] +==== +* Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax +* In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}` +* If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` +==== [source,console] ---- From 3855532a6461320c8d504dfc5255bb4209d9c982 Mon Sep 17 00:00:00 2001 From: Rafi Date: Wed, 7 Mar 2018 22:36:47 +0530 Subject: [PATCH 3/5] list converted to single paragraph list converted to single paragraph --- book/10-git-internals/sections/objects.asc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 85d3ca96e..b608ad2a8 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -141,9 +141,7 @@ Notice that the `lib` subdirectory isn't a blob but a pointer to another tree: [NOTE] ==== -* Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax -* In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}` -* If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` +Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}`. If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` ==== [source,console] From e2fccb77f2f84a43bf884e41f2f50f62480d0cf5 Mon Sep 17 00:00:00 2001 From: Rafi Date: Sun, 11 Mar 2018 17:24:26 +0530 Subject: [PATCH 4/5] changed to one sentence on each source-code line changed to one sentence on each source-code line --- 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 b608ad2a8..25e82f9d8 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -141,7 +141,11 @@ Notice that the `lib` subdirectory isn't a blob but a pointer to another tree: [NOTE] ==== -Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}`. If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` +Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. + +In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}`. + +If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` ==== [source,console] From e229d1d0f51a5286bd48eceb82db825ae850abfc Mon Sep 17 00:00:00 2001 From: Rafi Date: Wed, 14 Mar 2018 08:41:11 +0530 Subject: [PATCH 5/5] note block moved below code block note block moved below code block --- book/10-git-internals/sections/objects.asc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 25e82f9d8..b786350cb 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -139,6 +139,12 @@ $ 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: +[source,console] +---- +$ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 +100644 blob 47c6340d6459e05787f644c2447d2595f5d3a54b simplegit.rb +---- + [NOTE] ==== Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. @@ -148,12 +154,6 @@ In PowerShell or CMD on Windows, the `^` character is used for escaping, so you If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` ==== -[source,console] ----- -$ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 -100644 blob 47c6340d6459e05787f644c2447d2595f5d3a54b simplegit.rb ----- - Conceptually, the data that Git is storing looks something like this: .Simple version of the Git data model.