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

Re: smudge/clean filters and SHA1 hashes

From
Junio C Hamano <gitster@pobox.com>
Date
May 2, 2014, 22:02 UTC
Message-ID
<xmqqeh0balgd.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CADsUFkQLtUDpoiSqj-UYeyz1a-WZPh9vN+RW4ti8ut=22QwL4g@mail.gmail.com>
Leo Razoumov <slonik.az@gmail.com> writes:
> In presence of smudge/clean filters which SHA1 hash
> (clean content or smudged content) gets stored in the repository?

You are cleaning cruft in the contents before the contents are hashed to compute the object name. The point is to keep clean objects in the object database, protected from dirty reality in the working tree (which you instanciate by applying the smudge filter to dirty the clean object in the ideal world).

The crlf conversion works exactly the same way. For portability, you keep a version terminated with LF in the object database and that is what is hashed to compute the blob object name, but we export with CRLF line endings for a working tree that wants files whose lines are terminated that way.

Previous: Shawn Pearce
Message 3 of 3 in “smudge/clean filters and SHA1 hashes”
  1. Leo RazoumovMay 2, 2014
  2. Shawn PearceMay 2, 2014
  3. Junio C HamanoMay 2, 2014

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.