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:38 UTC
Message-ID
<42659678.9090605@tupshin.com>
In-Reply-To
<1113952916.29444.60.camel@orca.madrabbit.org>
Ray Lee wrote:
Show 5 quoted lines
>it allows regular expressions for the match and replace, which means
>multiple unique tokens could change atomically. (Does anyone actually
>*use* regexes? Sounds like a cannon that'd be hard to aim.)
>  
>
Yes, and replace patches need to be used very carefully.
Show 8 quoted lines
>Regardless, I only care about code, not free text. If it's in a language
>that doesn't do some use-'em-as-you-need-'em duck typing spiel
>(<cough>python</cough), then the context of your patch (namely, the
>file) already has those tokens somewhere in them. And I bet that if
>*you* looked at that file, you could tell if it was a replace or a mere
>textual diff. Am I wrong?
>  
>
Yes. See my hello world example from my last email.
>
>Unless I'm missing something, the darcs replace patch can already do the
>wrong thing. 
>

Yes, depending on how you define wrong. Darcs replace is fully predictable, and poorly chosen replaces can lead to incorrect results after future patches are applied.

Show 7 quoted lines
>If I do a replace patch on a variable introduced in a local
>tree, then do a darcs replace on it before committing it to a shared
>repository, and coder B introduces a variable of the same original name
>in my copy, then there's a chance that the replace patch will
>incorrectly apply upon his newly introduced variable. No?
>  
>

Absolutely correct, and the exact reason why replace patches need to be used *very* selectively.

Show 11 quoted lines
>  
>
>>It's provable that you can not.
>>    
>>
>
>I'm still not seeing the problem, at least when it comes to ANSI C.
>
>Ray
>  
>

See hello world example in my other email. You can argue that it is an existing problem in darcs, but really, it just points out the fact that a computer is *incapable* of knowing whether it is safe to use a replace patch based on a diff because replace patches are dangerous if not used intelligently.

-Tupshin
Previous: Ray LeeNext: Kevin Smith
Message 10 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.