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

Re: git-rerere observations and feature suggestions

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2008, 21:37 UTC
Message-ID
<7viqw99i2z.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080616204630.GA552@elte.hu>
Ingo Molnar <mingo@elte.hu> writes:
Show 14 quoted lines
> * Junio C Hamano <gitster@pobox.com> wrote:
>
>> Ingo Molnar <mingo@elte.hu> writes:
>> 
>> > right now that is simply not possible technically - it's even very 
>> > hard to share a .git/rr-cache with a co-maintainer whom i can trust 
>> > with my index file. (which is an otherwise unsafe private binary 
>> > cache that i'd not put into a public repository as it could in 
>> > theory contain lots of unrelated data and is not endian-safe, etc.)
>> 
>> Where did you get the idea that .git/index is involved in any way, I 
>> wonder...
>
> so it's only the rr-cache metadata that is involved?

The binary part of the index should be in network byte order and endian safe. But it is not necessary to share the index. Well, if you think about it, it would be mighty silly if index had any long term effect on the operation of rerere, which is all about "I've done many conflict resolutions in the past. My work tree state (including the index) came back to a state similar to the conflicted state I saw some time ago. Let's reuse the previous resolution if we can." You might have switched branches, ran "reset --hard" and did 47 thousands different things to your index since you resolved the conflict you are about to re-resolve ;-).

The replay and conflict recoding codepath of rerere goes like this:
 * read the index, list the paths that have conflicts;
 * inspect the conflicted blob to compute the conflict signature $sig and
   store the sig and path in MERGE_RR;
 * look into rr-cache/$sig; does it have already a conflict resolution
   recorded?
   - If so, modify the file in the working tree the same way to bring
     rr-cache/$sig/preimage to rr-cache/$sig/postimage by 3-way merge.
   - if not, record the file in the working tree as rr-cache/$sig/preimage
The resolution recording codepath goes like:
 * see if any paths listed in MERGE_RR is resolved in the index;
 * look into rr-cache/$sig for such resolved path.  Does it already record
   a resolution?
   - If not, we have a new resolution we can use.  Record it as
     rr-cache/$sig/postimage for later use.

So rerere _does_ look at the index to decide what entries in rr-cache are relevant and applicable. But other than that, it is not used. I do not think there is no reason copy index to be able to reuse rr-cache.

Previous: Ingo MolnarNext: Junio C Hamano
Message 13 of 45 in “git-rerere observations and feature suggestions”
  1. Ingo MolnarJun 16, 2008
  2. Mike HommeyJun 16, 2008
  3. Pierre HabouzitJun 16, 2008
  4. Pierre HabouzitJun 16, 2008
  5. Sverre RabbelierJun 16, 2008
  6. Karl HasselströmJun 17, 2008
  7. David KastrupJun 16, 2008
  8. Theodore TsoJun 16, 2008
  9. David KastrupJun 16, 2008
  10. Ingo MolnarJun 16, 2008
  11. Junio C HamanoJun 16, 2008
  12. Ingo MolnarJun 16, 2008
  13. Junio C HamanoJun 16, 2008
  14. Junio C HamanoJun 16, 2008
  15. Ingo MolnarJun 16, 2008
  16. Junio C HamanoJun 16, 2008
  17. 1/5 rerere: rerere_created_at() and has_resolution() abstractionJunio C Hamano, Jun 22, 2008
  18. 2/5 git-rerere: detect unparsable conflictsJunio C Hamano, Jun 22, 2008
  19. 3/5 rerere: remove dubious "tail_optimization"Junio C Hamano, Jun 22, 2008
  20. 4/5 t4200: fix rerere testJunio C Hamano, Jun 22, 2008
  21. 5/5 rerere.autoupdateJunio C Hamano, Jun 22, 2008
  22. Ingo MolnarJun 18, 2008
  23. Miklos VajnaJun 18, 2008
  24. Ingo MolnarJun 18, 2008
  25. Miklos VajnaJun 18, 2008
  26. Ingo MolnarJun 18, 2008
  27. Jakub NarebskiJun 18, 2008
  28. Miklos VajnaJun 18, 2008
  29. Karl HasselströmJun 19, 2008
  30. Miklos VajnaJun 19, 2008
  31. Junio C HamanoJun 19, 2008
  32. Karl HasselströmJun 19, 2008
  33. Miklos VajnaJun 19, 2008
  34. Karl HasselströmJun 19, 2008
  35. Miklos VajnaJun 19, 2008
  36. Karl HasselströmJun 19, 2008
  37. Junio C HamanoJun 16, 2008
  38. Ingo MolnarJun 16, 2008
  39. Ingo MolnarJun 23, 2008
  40. Peter ZijlstraJun 23, 2008
  41. Peter ZijlstraJun 23, 2008
  42. Jeff KingJun 23, 2008
  43. Ingo MolnarJun 23, 2008
  44. Jakub NarebskiJun 16, 2008
  45. Johannes SchindelinJun 17, 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.