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

Re: Using Format/export-subst Howto.

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 14, 2012, 21:09 UTC
Message-ID
<1347656962.3998.140661128069097.6D9BE3C4@webmail.messagingengine.com>
In-Reply-To
<50534FC6.2040207@viscovery.net>
On Fri, Sep 14, 2012, at 05:39 PM, Johannes Sixt wrote:
Show 23 quoted lines
> Am 9/14/2012 17:27, schrieb Mestnik, Michael J - Eagan, MN - Contractor:
> > 
> >> -----Original Message----- From: Johannes Sixt
> >> If EOL conversion or a clean filter was applied during 'git add
> >> file', is the version in the worktree suddenly wrong? Of course,
> >> not.
> >> 
> >> I would place $Id$ treatment in the same ball park and declare it as
> >> a mistake of the editor that it did not remove the now "wrong" SHA1
> >> from $Id:$.
> > 
> > I think the difference here is that git does not *currently change the
> > OS's LEF.  In this case each commit alters the Id and git is the one
> > altering the Id.
> 
> Maybe you misunderstood $Id$? The value you get there is the blob's SHA1,
> not the commit's. That is, it does not change on every commit, but only
> when the file changes.
> 
> You are right that the value itself is something that is dictated by
> git's
> database model, but the change logically happens when the editor modifies
> the file.

Exactly, but the problem is that neither $Id$ nor $Id: deadbeef$ in the work-tree copy of the file are updated with $Id: abacbeef$ after the file's content has changed and has been committed, i.e. after the blob's sha1 has changed. What's worse, even a "git checkout file" does not correct this (because git sees that there's no change to the file compared to the index), you need to "rm file && git checkout file"). If the user has to update $Id$ to match the current sha1 (by remembering to do a more forceful checkout than checkout -f) then one half of that feature is useless.

> (My contribution to this thread should be regarded as food for thought.
> Personally, I don't mind whether or not and when $Id$ is updated.)
> 
> -- Hannes

I think at least we should do a commit.renormalize akin to merge.renormalize if we can't do more for hysterical raisins. But maybe the behavior even has changed during some stat/lstat related optimizations. I'll check next week if nobody beats me to it.

Cheers, Michael

Previous: Mestnik, Michael J - Eagan, MN - ContractorNext: Junio C Hamano
Message 7 of 18 in “Using Format/export-subst Howto.”
  1. Mestnik, Michael J - Eagan, MN - ContractorSep 14, 2012
  2. Michael J GruberSep 14, 2012
  3. Johannes SixtSep 14, 2012
  4. Mestnik, Michael J - Eagan, MN - ContractorSep 14, 2012
  5. Johannes SixtSep 14, 2012
  6. Mestnik, Michael J - Eagan, MN - ContractorSep 14, 2012
  7. Michael J GruberSep 14, 2012
  8. Junio C HamanoSep 14, 2012
  9. Junio C HamanoSep 14, 2012
  10. Michael J GruberSep 17, 2012
  11. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012
  12. Junio C HamanoSep 17, 2012
  13. Michael J GruberSep 18, 2012
  14. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012
  15. Michael J GruberSep 17, 2012
  16. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012
  17. Michael J GruberSep 17, 2012
  18. Mestnik, Michael J - Eagan, MN - ContractorSep 17, 2012

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.