Skip to content

Translate 10-git-internals objects #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Aug 7, 2015

Conversation

oldsharp
Copy link
Contributor

Please kindly have a review and consider merging these contribution. Thanks.

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。
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(自注)此处有待商榷。

This object type is called a blob.

从原文 a blob 来看,是在修饰 object,而非 type;所以,译为“上述类型的对象,我们称之为 blob 对象”似乎更妥。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上述类型的对象被称之为 blob 对象。

这样呢?

@networm networm changed the title Translate Chapter 10 Section 02 Translate 10-git-internals objects Jun 18, 2015
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 blob 对象。
所有的 Git 对象均以这种方式存储,区别仅在于类型标识——另两种对象类型的头部信息以字符串“commit”或“tree”开头,而不是“blob”,仅此而已。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(仅供参考)觉得去掉 “仅此而已” 可能好一些,前面已经有 “...区别仅在于...”,而且后一句接的是对象 “另外” 的区别。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“仅此而已”属于原文没有的翻译。
我初稿翻译完后,读到这里,感觉结束的比较突兀,所以加上去的。
现在再读,觉得去掉也没有问题。我暂时没法判断。
先保留着,看看其他 reviewer 对此的意见。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我认为要么前面改为 “区别在于” 要么去掉后面的 “,仅此而已”,这样才不会觉得重复。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把“仅此而已”去掉好了。

@leshiv
Copy link
Contributor

leshiv commented Jul 23, 2015

@oldsharp 审校完成

@networm networm mentioned this pull request Jul 29, 2015
95 tasks
@networm networm modified the milestone: v1.0.0 Jul 29, 2015
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, and the filename is the remaining 38 characters.
你可以在 `objects` 目录下看到一个文件。
这就是 Git 存储新内容的方式——一个文件对应一条内容,以该内容加上特定头部信息的 SHA-1 校验和为文件命名。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这就是 Git 存储新内容的方式

这就是开始时 Git 存储内容的方式
这个地方是不是与后面的打包文件存储做了对比,这是开始的时候用的,过一段文件多了用打包文件。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以该内容加上特定头部信息的 SHA-1 校验和为文件命名。

以该内容加上特定头部信息_一起_的 SHA-1 校验和为文件命名。

@oldsharp
Copy link
Contributor Author

@networm 谢谢!已确认上述建议,稍后会提交相应的修改。

oldsharp added 2 commits July 30, 2015 09:55
- "blob object" translated as "数据对象", according to progit#194 .
- Relevant adjustments.
@networm
Copy link
Member

networm commented Jul 30, 2015

@oldsharp 别急,我还没审校完!

@oldsharp
Copy link
Contributor Author

@networm ok, i see~

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 中存入内容,并知道如何将它们取回。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如何往 Git 中存入内容,并知道如何将它们取回。

如何向 Git 中存入内容,以及如何将它们取出。
存入 和 取出 这样感觉能对应上

@networm
Copy link
Member

networm commented Jul 30, 2015

@oldsharp 已审校。

@oldsharp
Copy link
Contributor Author

@networm 感谢,稍后会提交相应的修改。

oldsharp added a commit to oldsharp/progit2-zh that referenced this pull request Jul 30, 2015
这意味着,Git 的核心部分是一个简单的键值对数据库(key-value data store)。
你可以向该数据库插入任意类型的内容,它会返回一个键值,通过该键值可以在任意时刻再次检索(retrieve)该内容。
可以通过底层命令 `hash-object` 来演示上述效果——该命令可将任意数据保存于 `.git` 目录,并返回相应的键值。
首先需要初始化一个新的 Git 版本库,并确认 `objects` 目录为空:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

首先,你需要..

oldsharp added 18 commits August 5, 2015 07:56
- "往" -> "向".
- "取回" -> "取出".
- Relevant adjustments.
"stdin" translated as "标准输入".
"那条内容" -> "第一条内容".
All "mode" are translated as "模式".
"top level of the working directory" translated as
"工作目录的根目录".
Improve the translation of "Great.  What does that mean?",
for better reading experience.
Simplify the translation of "the object type of any object in Git".
"the last commit" translated as "最新的提交" for better reading
experience, in this context.
@oldsharp oldsharp force-pushed the prq-translate-chapter-10-section-02 branch from ae9c177 to 5c4ba4b Compare August 5, 2015 00:24
@oldsharp
Copy link
Contributor Author

oldsharp commented Aug 5, 2015

@OlingCat 针对你的大部分建议做了修订,请检查。

@networm
Copy link
Member

networm commented Aug 5, 2015

@OlingCat 请在检查完之后 @ 我一下,好进行合并。

networm added a commit that referenced this pull request Aug 7, 2015
@networm networm merged commit c9a2c5d into progit:master Aug 7, 2015
@oldsharp oldsharp deleted the prq-translate-chapter-10-section-02 branch August 9, 2015 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants