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

Re: Darcs and git: plan of action

From
THTupshin Harper <tupshin@tupshin.com>
Date
Apr 19, 2005, 23:00 UTC
Message-ID
<42658D95.7020404@tupshin.com>
In-Reply-To
<1113950442.29444.31.camel@orca.madrabbit.org>
Ray Lee wrote:
>Here's where we disagree. If you checkpoint your tree before the
>replace, and immediately after, the only differences in the
>source-controlled files would be due to the replace.
>

This is assuming that you only have one replace and no other operations recorded in the patch. If you have multiple replaces or a replace and a traditional diff recorded in the same patch, then this is not true.

Show 8 quoted lines
> And since the
>language of the file is known (and thereby the tokenization -- it *is*
>well-defined), then a tokenizer that compares the before and after trees
>(for just the files that changed, obviously), can discover what you did,
>and promote the mere ASCII diff into a token-replace diff. (The same
>sort of idea could be done for reindention, I'd hope.)
>  
>

See above for one set of limitations on this. A more fundamental problem comes back to intent. If I have a file "foo" before: a1 a2 and after: b1 b2 is that a "replace [_a-zA-Z0-9] a b foo" patch, or is that a -a1 -a2 +b1 +b2 patch? Note that this comes down to heuristics, and no matter what you use, you will be wrong sometimes, *and* the choice that is made can substantively affect the contents of the repository after additional patches are applied.

>We agree on everything except that it's provable that one can discover a
>replace operation, given a before and after tree.
>  
>
It's provable that you can not.
-Tupshin
Previous: Ray LeeNext: Ray Lee
Message 8 of 18 in “Re: [darcs-devel] Darcs and git: plan of action”
  1. linux@horizon.comApr 18, 2005
  2. Ray LeeApr 19, 2005
  3. Kevin SmithApr 19, 2005
  4. Ray LeeApr 19, 2005
  5. Kevin SmithApr 19, 2005
  6. Patrick McFarlandApr 19, 2005
  7. Ray LeeApr 19, 2005
  8. Tupshin HarperApr 19, 2005
  9. Ray LeeApr 19, 2005
  10. Tupshin HarperApr 19, 2005
  11. Kevin SmithApr 19, 2005
  12. Ray LeeApr 19, 2005
  13. Tupshin HarperApr 19, 2005
  14. Ray LeeApr 20, 2005
  15. Juliusz ChroboczekApr 20, 2005
  16. David RoundyApr 20, 2005
  17. Ralph CorderoyApr 20, 2005
  18. David RoundyApr 19, 2005

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.