Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-model
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Renaud Boyer
swh-model
Commits
bd5494f9
Commit
bd5494f9
authored
9 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
Add README-dev.md which explicits the sha1 computations
parent
d84035a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README-dev.md
+66
-0
66 additions, 0 deletions
README-dev.md
with
66 additions
and
0 deletions
README-dev.md
0 → 100644
+
66
−
0
View file @
bd5494f9
Git sha1 computation
--------------------
Document to describe how the git sha1 computation takes place.
### commit/revision
sha1 git commit/revision computation:
commit `size`\0
tree `sha1-git-tree-and-subtree-in-plain-hex-string`
([parent `commit-parent-n`])
author `name` <`email`> `date-ts` `date-offset`
committer `name` <`email`> `date-ts` `date-offset`
([extra-header-key-n extra-header-value-n])
`commit-message`
(inline-gpg-signature)
Notes:
-
[] denotes list of entries (one per line)
-
() denotes optional entry. For example, the parent entry is optional.
-
empty line at the end of the commit message
-
timestamp example: 1444054085
-
date offset for example: +0200, -0100
sources:
-
commit_tree_extended: https://github.com/git/git/blob/8d530c4d64ffcc853889f7b385f554d53db375ed/commit.c#L1522
-
commit_tree: https://github.com/git/git/blob/8d530c4d64ffcc853889f7b385f554d53db375ed/commit.c#L1392
### directory/tree
sha1 git directory/tree computation:
tree `tree-size`\0
<file-perm> <file-name>\0<file-sha1-in-20-bytes-string>...<dir-perm> <dir-name>\0<dir-sha1-in-20-bytes-string>...
Notes:
-
no newline separator between tree entries
-
no empty newline at the end of the tree entries
-
tree content header size is the length of the content
-
The tree entries are ordered according to bytes in their
<name>
properties.
Note: Tree entries referencing trees are sorted as if their name have a trailing /
at their end.
Possible permissions are:
-
100644 - file
-
40000 - directory
-
100755 - executable file
-
120000 - symbolink link
-
160000 - git link (relative to submodule)
### content/file
sha1 git content computation:
blob `blob-size`\0
`blob-content`
Notes:
-
no newline at the end of the blob content
Compress with DEFLATE and compute sha1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment