CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 23 Jul 2025 17:19:08 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090104063617
location: https://web.archive.org/web/20090104063617/https://github.com/github/grit/tree
server-timing: captures_list;dur=0.727931, exclusion.robots;dur=0.027929, exclusion.robots.policy;dur=0.011666, esindex;dur=0.014713, cdx.remote;dur=51.317997, LoadShardBlock;dur=384.156255, PetaboxLoader3.datanode;dur=109.903468, PetaboxLoader3.resolve;dur=117.720827
x-app-server: wwwb-app220
x-ts: 302
x-tr: 472
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app220; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Wed, 23 Jul 2025 17:19:09 GMT
content-type: text/html; charset=utf-8
content-length: 107
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sun, 04 Jan 2009 06:36:15 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7BzoOcmV0dXJuX3RvIhgvd2VibWF0emUvZm9sbG93ZXJzIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--60b5c072f1acd170a77f7eb77ff0b614a47c974a; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090104063617/https://github.com/github/grit/tree/master
x-archive-orig-x-runtime: 100ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 107
cache-control: max-age=1800
memento-datetime: Sun, 04 Jan 2009 06:36:17 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 09 Jul 2008 02:15:55 GMT", ; rel="prev memento"; datetime="Wed, 09 Jul 2008 02:15:55 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 06:36:17 GMT", ; rel="next memento"; datetime="Fri, 06 Mar 2009 18:11:43 GMT", ; rel="last memento"; datetime="Fri, 06 Mar 2009 18:11:43 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090104033323_crawl108-c/52_7_20090104063512_crawl103.arc.gz
server-timing: captures_list;dur=0.792272, exclusion.robots;dur=0.058146, exclusion.robots.policy;dur=0.015996, esindex;dur=0.013981, cdx.remote;dur=68.674907, LoadShardBlock;dur=708.804538, PetaboxLoader3.resolve;dur=462.904215, PetaboxLoader3.datanode;dur=344.677348, load_resource;dur=302.308697
x-app-server: wwwb-app220
x-ts: 301
x-tr: 1117
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 23 Jul 2025 17:19:11 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sun, 04 Jan 2009 06:36:17 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoOcmV0dXJuX3RvIhgvd2VibWF0emUvZm9sbG93ZXJz--31ae0c22918eddfb36aeadbaaa90e9fc06ff3fd4; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 1371ms
x-archive-orig-etag: "ac7a1b3d245e937344a26207a94228ac"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 22862
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 04 Jan 2009 06:36:17 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 06 Oct 2008 08:14:01 GMT", ; rel="prev memento"; datetime="Mon, 06 Oct 2008 08:14:01 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 06:36:17 GMT", ; rel="next memento"; datetime="Mon, 05 Jan 2009 08:15:02 GMT", ; rel="last memento"; datetime="Mon, 05 Feb 2024 01:13:48 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090104033323_crawl108-c/52_7_20090104063512_crawl103.arc.gz
server-timing: captures_list;dur=0.596534, exclusion.robots;dur=0.024313, exclusion.robots.policy;dur=0.011640, esindex;dur=0.011973, cdx.remote;dur=44.183003, LoadShardBlock;dur=673.492469, PetaboxLoader3.datanode;dur=267.212395, PetaboxLoader3.resolve;dur=517.454090, load_resource;dur=249.951892
x-app-server: wwwb-app220
x-ts: 200
x-tr: 1019
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
github's grit at master — GitHub
We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Run the following if you haven't already:
gem sources -a https://gems.github.com
Install the gem(s):
sudo gem install github-grit
Fork of mojombo/grit | |
Description: | Grit is a Ruby library for extracting information from a git repository in an object oriented manner. |
Homepage: | https://grit.rubyforge.org/ |
Clone URL: |
git://github.com/github/grit.git
Give this clone URL to anyone.
git clone git://github.com/github/grit.git
|
grit /
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Thu Apr 24 12:19:23 -0700 2008 | up to 0.8.0 and add gemspec [mojombo] |
![]() |
History.txt | Thu Apr 24 12:23:15 -0700 2008 | fix gemspec [mojombo] |
![]() |
Manifest.txt | Fri Apr 25 15:25:49 -0700 2008 | Updated manifest.txt to include new ref & r... [dysinger] |
![]() |
README.txt | Thu Apr 24 17:42:58 -0700 2008 | grit gems are now exclusively available via gem... [mojombo] |
![]() |
Rakefile | Thu Apr 24 16:17:49 -0700 2008 | gemification updates [mojombo] |
![]() |
grit.gemspec | Thu Apr 24 17:54:07 -0700 2008 | up to 0.8.1 [mojombo] |
![]() |
lib/ | Wed Apr 30 22:03:18 -0700 2008 | proof of concept for commits to a bare repo [mojombo] |
![]() |
test/ | Wed Apr 30 22:03:18 -0700 2008 | proof of concept for commits to a bare repo [mojombo] |
README.txt
grit by Tom Preston-Werner, Chris Wanstrath https://github.com/mojombo/grit == DESCRIPTION: Grit is a Ruby library for extracting information from a git repository in and object oriented manner. == REQUIREMENTS: * git (https://git.or.cz) tested with 1.5.3.4 == INSTALL: $ gem sources -a https://gems.github.com/ (you only need to do this once) $ gem install mojombo-grit == SOURCE: Grit's git repo is available on GitHub, which can be browsed at: https://github.com/mojombo/grit and cloned from: git://github.com/mojombo/grit.git == USAGE: Grit gives you object model access to your git repository. Once you have created a repository object, you can traverse it to find parent commit(s), trees, blobs, etc. = Initialize a Repo object The first step is to create a Grit::Repo object to represent your repo. I include the Grit module so reduce typing. require 'mojombo-grit' include Grit repo = Repo.new("/Users/tom/dev/grit") In the above example, the directory /Users/tom/dev/grit is my working repo and contains the .git directory. You can also initialize Grit with a bare repo. repo = Repo.new("/var/git/grit.git") = Getting a list of commits From the Repo object, you can get a list of commits as an array of Commit objects. repo.commits # => [#<Grit::Commit "e80bbd2ce67651aa18e57fb0b43618ad4baf7750">, #<Grit::Commit "91169e1f5fa4de2eaea3f176461f5dc784796769">, #<Grit::Commit "038af8c329ef7c1bae4568b98bd5c58510465493">, #<Grit::Commit "40d3057d09a7a4d61059bca9dca5ae698de58cbe">, #<Grit::Commit "4ea50f4754937bf19461af58ce3b3d24c77311d9">] Called without arguments, Repo#commits returns a list of up to ten commits reachable by the master branch (starting at the latest commit). You can ask for commits beginning at a different branch, commit, tag, etc. repo.commits('mybranch') repo.commits('40d3057d09a7a4d61059bca9dca5ae698de58cbe') repo.commits('v0.1') You can specify the maximum number of commits to return. repo.commits('master', 100) If you need paging, you can specify a number of commits to skip. repo.commits('master', 10, 20) The above will return commits 21-30 from the commit list. = The Commit object Commit objects contain information about that commit. head = repo.commits.first head.id # => "e80bbd2ce67651aa18e57fb0b43618ad4baf7750" head.parents # => [#<Grit::Commit "91169e1f5fa4de2eaea3f176461f5dc784796769">] head.tree # => #<Grit::Tree "3536eb9abac69c3e4db583ad38f3d30f8db4771f"> head.author # => #<Grit::Actor "Tom Preston-Werner <tom@mojombo.com>"> head.authored_date # => Wed Oct 24 22:02:31 -0700 2007 head.committer # => #<Grit::Actor "Tom Preston-Werner <tom@mojombo.com>"> head.committed_date # => Wed Oct 24 22:02:31 -0700 2007 head.message # => "add Actor inspect" You can traverse a commit's ancestry by chaining calls to #parents. repo.commits.first.parents[0].parents[0].parents[0] The above corresponds to master^^^ or master~3 in git parlance. = The Tree object A tree records pointers to the contents of a directory. Let's say you want the root tree of the latest commit on the master branch. tree = repo.commits.first.tree # => #<Grit::Tree "3536eb9abac69c3e4db583ad38f3d30f8db4771f"> tree.id # => "3536eb9abac69c3e4db583ad38f3d30f8db4771f" Once you have a tree, you can get the contents. contents = tree.contents # => [#<Grit::Blob "4ebc8aea50e0a67e000ba29a30809d0a7b9b2666">, #<Grit::Blob "81d2c27608b352814cbe979a6acd678d30219678">, #<Grit::Tree "c3d07b0083f01a6e1ac969a0f32b8d06f20c62e5">, #<Grit::Tree "4d00fe177a8407dbbc64a24dbfc564762c0922d8">] This tree contains two Blob objects and two Tree objects. The trees are subdirectories and the blobs are files. Trees below the root have additional attributes. contents.last.name # => "lib" contents.last.mode # => "040000" There is a convenience method that allows you to get a named sub-object from a tree. tree/"lib" # => #<Grit::Tree "e74893a3d8a25cbb1367cf241cc741bfd503c4b2"> You can also get a tree directly from the repo if you know its name. repo.tree # => #<Grit::Tree "master"> repo.tree("91169e1f5fa4de2eaea3f176461f5dc784796769") # => #<Grit::Tree "91169e1f5fa4de2eaea3f176461f5dc784796769"> = The Blob object A blob represents a file. Trees often contain blobs. blob = tree.contents.first # => #<Grit::Blob "4ebc8aea50e0a67e000ba29a30809d0a7b9b2666"> A blob has certain attributes. blob.id # => "4ebc8aea50e0a67e000ba29a30809d0a7b9b2666" blob.name # => "README.txt" blob.mode # => "100644" blob.size # => 7726 You can get the data of a blob as a string. blob.data # => "Grit is a library to ..." You can also get a blob directly from the repo if you know its name. repo.blob("4ebc8aea50e0a67e000ba29a30809d0a7b9b2666") # => #<Grit::Blob "4ebc8aea50e0a67e000ba29a30809d0a7b9b2666"> == LICENSE: (The MIT License) Copyright (c) 2007 Tom Preston-Werner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This feature is coming soon. Sit tight!