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

Re: [PATCH] Don't update unchanged merge entries

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 16, 2008, 21:10 UTC
Message-ID
<alpine.LNX.1.00.0803161700430.19665@iabervon.org>
In-Reply-To
<alpine.LFD.1.00.0803161338100.3020@woody.linux-foundation.org>
On Sun, 16 Mar 2008, Linus Torvalds wrote:
Show 13 quoted lines
> On Sun, 16 Mar 2008, Daniel Barkalow wrote:
> > 
> > While you're at it, you should at least fix the comment. I actually think 
> > it would be better to have update start out 0 and be set to CE_UPDATE 
> > after verify_uptodate() and verify_absent(), since those checks are what 
> > verifies that using CE_UPDATE is okay.
> 
> Well, I just made it match the old behavior. It used to be that the 
> copy_cache_entry() would clear the CE_UPDATE bit in the target 'merge' 
> entry, so I just cleared "update" there, the way we used to do it.
> 
> So now we actually *do* match the comment again - the bug was that we 
> didn't match it before due to it all being a bit too subtle.

Well, the top part of the comment suggests that this is just an optimization (don't bother to write out a file that you know is unchanged), when it's actually necessary for correctness (since we don't know if the working tree matches the old index).

	-Daniel
*This .sig left intentionally blank*
Previous: Linus TorvaldsNext: Linus Torvalds
Message 9 of 11 in “"git pull" throws away dirty state”
  1. Linus TorvaldsMar 16, 2008
  2. Linus TorvaldsMar 16, 2008
  3. Nicolas PitreMar 16, 2008
  4. Junio C HamanoMar 16, 2008
  5. Junio C HamanoMar 16, 2008
  6. Don't update unchanged merge entriesLinus Torvalds, Mar 16, 2008
  7. Daniel BarkalowMar 16, 2008
  8. Linus TorvaldsMar 16, 2008
  9. Daniel BarkalowMar 16, 2008
  10. Linus TorvaldsMar 16, 2008
  11. Junio C HamanoMar 16, 2008

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.