bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preventing server from running editor on commit


From: Jonathan Kamens
Subject: Preventing server from running editor on commit
Date: Mon, 3 Jun 2002 21:42:51 +0000 (UTC)

You know this much already.... CVS 1.11.2 will launch an editor on the
server if the user specifies an empty log message.

Larry Jones partially fixed this half-way on May 7 in this change:

2002-05-07  Larry Jones  <lawrence.jones@eds.com>

        * commit.c (commit): Always send -m to the server, even if there's
        no message.

However, this is not a complete fix.  First of all, it deals with
client commits but doesn't deal with the same problem with client
imports.  Second, it fixes new clients to behave nicely with older
servers but does not fix new servers to behave nicely with older
clients.

The patch below fills in these gaps.

2002-06-03  Jonathan Kamens  <jik@kamens.brookline.ma.us>

        * commit.c (commit_fileproc, commit_direntproc): Don't try to call
        an editor to get the log message if running as a server.  Instead,
        just use an empty log message.
        * import.c (import): Ditto.

        * import.c (import): In client mode, always send a message to the
        server, even if it's empty (this parallels a change made by Larry
        Jones to commit.c on May 7).

Index: src/commit.c
===================================================================
RCS file: /cvsroot/ccvs/src/commit.c,v
retrieving revision 1.179
diff -u -r1.179 commit.c
--- src/commit.c        7 May 2002 19:16:32 -0000       1.179
+++ src/commit.c        3 Jun 2002 21:39:58 -0000
@@ -1221,9 +1221,11 @@
     if (!(got_message))
     {
        got_message = 1;
-       if (use_editor)
+       if (! server_active && use_editor)
            do_editor (finfo->update_dir, &saved_message,
                       finfo->repository, ulist);
+       else if (! saved_message)
+           saved_message = xstrdup ("");
        do_verify (&saved_message, finfo->repository);  
     }
 
@@ -1544,8 +1546,10 @@
     /* get commit message */
     real_repos = Name_Repository (dir, update_dir);
     got_message = 1;
-    if (use_editor)
+    if (! server_active && use_editor)
        do_editor (update_dir, &saved_message, real_repos, ulist);
+    else if (! saved_message)
+       saved_message = xstrdup ("");
     do_verify (&saved_message, real_repos);
     free (real_repos);
     return (R_PROCESS);
Index: src/import.c
===================================================================
RCS file: /cvsroot/ccvs/src/import.c,v
retrieving revision 1.130
diff -u -r1.130 import.c
--- src/import.c        9 Mar 2002 22:19:33 -0000       1.130
+++ src/import.c        3 Jun 2002 21:39:59 -0000
@@ -216,7 +216,7 @@
     }
 #endif
 
-    if (use_editor)
+    if (! server_active && use_editor)
     {
        do_editor ((char *) NULL, &message,
 #ifdef CLIENT_SUPPORT
@@ -225,6 +225,8 @@
                        repository,
                   (List *) NULL);
     }
+    else if (! message)
+       message = xstrdup ("");
     do_verify (&message, repository);
     msglen = message == NULL ? 0 : strlen (message);
     if (msglen == 0 || message[msglen - 1] != '\n')
@@ -247,8 +249,7 @@
 
        if (vbranch[0] != '\0')
            option_with_arg ("-b", vbranch);
-       if (message)
-           option_with_arg ("-m", message);
+       option_with_arg ("-m", message ? message : "");
        if (keyword_opt != NULL)
            option_with_arg ("-k", keyword_opt);
        /* The only ignore processing which takes place on the server side



reply via email to

[Prev in Thread] Current Thread [Next in Thread]