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

Re: [darcs-devel] Darcs and git: plan of action

From
David Roundy <droundy@abridgegame.org>
Date
Apr 20, 2005, 11:55 UTC
Message-ID
<20050420115547.GI29945@abridgegame.org>
In-Reply-To
<1113959503.29444.91.camel@orca.madrabbit.org>
On Tue, Apr 19, 2005 at 06:11:43PM -0700, Ray Lee wrote:
Show 8 quoted lines
> > second patch:
> > replace ./hello.c [A-Za-z_0-9] world universe
> 
> Aha! Okay, I now see at least part of issue: we're using different
> definitions of 'token.' Yours is quite sensible, in that it matches the
> darcs syntax. However, I'm claiming a token is defined by the file's
> language, and that a replace patch on anything but a token as per those
> language standards is a silly thing.

The trouble is that a token based on language standards is also wrong, unless your file at all times is syntactically correct. It also means (for C in particular) that the result of the token replace isn't uniquely determined by the combination of the token replace patch and the file it applies to, since you need parse any header files in order to tokenize the C file. In the case of header files, it may not be possible to tokenize them uniquely, since they may tokenize differently depending on what other header files are included before them. And of course, none of this may be possible if you haven't run autoconf and configure, since you may not actually *have* the header files in the first place...

In a (reasonably) general-purpose tool like darcs, I think it's better to stick with a simpler definition of token that doesn't require a complete integrated development environment.

It's also true that often you want to modify headers and string contents simultaneously with the change of the code itself. When I replace get_pseudowavefunction with get_atomic_orbital, I also want to modify

// We call get_pseudowavefunction to get the atomic orbital...
and
printf("Error in get_pseudowavefunction!\n");
-- 
David Roundy
http://www.darcs.net
Previous: Juliusz ChroboczekNext: Ralph Corderoy
Message 16 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.