unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Lord <lord@emf.net>
Cc: emacs-devel@gnu.org, miles@gnu.org
Subject: Re: arch taglines for emacs
Date: Thu, 21 Aug 2003 07:56:49 -0700 (PDT)	[thread overview]
Message-ID: <200308211456.HAA16986@morrowfield.regexps.com> (raw)
In-Reply-To: <E19pq9q-00046x-6a@fencepost.gnu.org> (message from Richard Stallman on Thu, 21 Aug 2003 10:11:22 -0400)




    > From: Richard Stallman <rms@gnu.org>

    > 	> From: Miles Bader <miles@lsi.nec.co.jp>

    > 	> I think this behavior is dangerous because whitespace and comment
    > 	> delimiters can get changed inadvertently, whereas users are more likely
    > 	> to be careful about the actual tag string (which looks `magic').

    >     That's fine, although no problems have ever been reported in practice.

    > Could you tell me what is the issue here?  I have not received Miles'
    > message that you are replying to.  Was it sent to emacs-devel?


One of the cornerstones of arch are the tools `mkpatch' and `dopatch'
which are generalizations of `diff' and `patch'.    Rather than
comparing two versions of a single file or patching a single file,
`mkpatch' and `dopatch' work on an entire source tree.

Among the "differences" noted by `mkpatch' are names of files and
directories.   For example, if I have two versions of the hello world
program:

	version-1 tree:

		./Makefile
                ./hw.c


	version-2 tree:

		./Makefile
                ./hw.c.~1~
                ./hello.c	# used to be called hw.c

`mkpatch' will produce a changeset that says (in effect):

	hw.c has been renamed hello.c
	hello.c has been modified (here are the diffs....)

So arch needs _some_ mechanism to recognize that in the two trees,
"hw.c" and "hello.c" are the same logical file.

Two mechanisms are provided.  In one mechanism, extra files are
added to the tree (stored in subdirs named `.arch-ids') which describe
the logical identities of files.   In another mechanism, a specially 
formatted comment is added _inside_ of each file, and arch searches
for those.   (In practice a mixture of these is often used, since
though the special comments are more convenient, they can't be applied
to all types of files.)

The special comments method is usually the most convenient.   When
such comments are used, a user can rename a file in the usual way
(e.g., with `mv(1)') and arch recognizes what has happened.   When
external records are used, moving a file requires an extra step to
update the external record (e.g., the arch `move' command).

In the case of Emacs, where only a subset of the developers will be
using arch, the special comments method is arguably the best choice.
Developers not using arch can simply ignore these comments -- they
only have to remember not to change them.  (External files are still
desirable to assign logical names to directories, but because of the
way those files are stored, users do _not_ have to use the arch `move'
command when renaming a directory.)

The issue Miles is raising concerns the syntax of the special
comments.  Given a comment such as:


	/* arch-tag: this is the tag i chose for this file. */

arch forms a string which stands for the logical name of the file.
To form this string, it takes the entire contents of the string
following "arch-tag:", strips surrounding whitespace, and replaces
other non-graphical characters with "_".   So, the logical name of
that file is:

	this_is_the_tag_i_chose_for_this_file._*/

Miles is concerned that a seemingly harmless change, like adding extra
whitespace, will have the undesirable side effect of changing the
logical name of the file:

      modified comment:

	/* arch-tag: this is the tag i chose for this file.
         */

      new logical file name:

	this_is_the_tag_i_chose_for_this_file.


Such problems have not been observed in practice, but I agree with
Miles that it is a legitimate concern.  So he proposed a change to the
way logical names are formed and I've pointed out (on another list)
some design constraints that his first proposal doesn't satisfy.  (The
primary constraint is that any change in this area should be made in a
way that is 100% upward compatible will all already existing
mkpatch-generated changesets.  Miles' first proposal was based on a
solution that in theory might be incomatible with some changesets, but
that he guesses will be compatible with all of them in practice.)

Meanwhile, there is an easy convention to adopt that will make 
such problems unlikely to occur in the Emacs source and will 
make it easy to upgrade to a new syntax if we decide to add one to
arch.   The convention is to use tags which do not contain spaces:


	/* arch-tag: d41d8cd98f00b204e9800998ecf8427e
         */

or

	/* arch-tag: d41d8cd98f00b204e9800998ecf8427e
         * Do not Modify this comment.
         */

or similar.

-t

  reply	other threads:[~2003-08-21 14:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-19  3:55 arch taglines for emacs Miles Bader
2003-08-20  2:42 ` Richard Stallman
2003-08-20  2:54   ` Miles Bader
2003-08-20  3:03     ` Tom Lord
2003-08-21 14:11       ` Richard Stallman
2003-08-21 14:56         ` Tom Lord [this message]
2003-08-23  3:59     ` Richard Stallman
2003-08-23 14:02       ` Tom Lord
2003-08-24 18:00         ` Richard Stallman
2003-08-24 18:00         ` Richard Stallman
2003-08-24 18:59           ` Tom Lord
2003-08-24 19:38             ` Jonathan Walther
2003-08-24 19:44               ` [Gnu-arch-users] " Tom Lord
2003-08-25  1:59             ` Miles Bader
2003-08-25  2:08               ` Tom Lord
2003-08-26  1:38               ` Richard Stallman
     [not found] ` <87he4cfkhf.fsf@mail.jurta.org>
2003-08-21  4:36   ` Miles Bader
2003-08-22 20:54     ` Juri Linkov
2003-08-21 11:29 ` Florian Weimer
2003-08-22  1:47   ` Miles Bader
2003-08-22 12:07     ` Andreas Schwab
2003-08-22 20:55       ` Miles Bader
  -- strict thread matches above, loose matches on Subject: below --
2003-09-01 16:03 Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200308211456.HAA16986@morrowfield.regexps.com \
    --to=lord@emf.net \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).