git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: sha1 of the repo excluding history ?

From
Junio C Hamano <junkio@cox.net>
Date
Apr 13, 2007, 00:24 UTC
Message-ID
<7v7ishi0k0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<f36b08ee0704121626i6a27dcecp8b0b10e0f7db2ef7@mail.gmail.com>
"Yakov Lerner" <iler.ml@gmail.com> writes:
Show 11 quoted lines
>    Can I obtain from git the sha1 of the total last state of the
> repo excluding history ? This is a state that covers contents and
> names of all files and dirs, and x perm of files;
> but excludes history, timestamps, ownerhisp, and inode numbers.
>
> That would be approximately like the slow method:
>          'find | egrep -v '/\.git(/|$)' | sort | Xcpio -o | sha1sum -'
> (imagining Xcpio that does not archive any ownership, timestamps,
> and inode numbers). Can I obtain this result immediately from git ?
>
> Yakov

I think you are talking about tree object name. git-cat-file commit HEAD and look at "tree xxx" line.

You can use "git tar-tree $tree_object_name" to tar it up, and "git ls-tree -r $tree_object_name" to list all the blob object names with their perms.

Previous: Shawn O. Pearce
Message 3 of 3 in “sha1 of the repo excluding history ?”
  1. Yakov LernerApr 12, 2007
  2. Shawn O. PearceApr 12, 2007
  3. Junio C HamanoApr 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.