GNU logs - #7675, boring messages


Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7675: 24.0.50; vc-checkin should prompt if the fileset changes
Resent-From: Bob Rogers <rogers-emacs@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 18 Dec 2010 21:24:02 +0000
Resent-Message-ID: <handler.7675.B.129270743922452 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 7675
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 7675 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.129270743922452
          (code B ref -1); Sat, 18 Dec 2010 21:24:02 +0000
Received: (at submit) by debbugs.gnu.org; 18 Dec 2010 21:23:59 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PU4Fy-0005q5-Ij
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:23:59 -0500
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PU4Fv-0005ps-4d
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:23:56 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PU4M6-0004gb-Id
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:30:20 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00
	autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:46727)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PU4M6-0004gV-Av
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:30:18 -0500
Received: from [140.186.70.92] (port=40961 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1PU4M4-00038A-Ff
	for bug-gnu-emacs@HIDDEN; Sat, 18 Dec 2010 16:30:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PU4M2-0004fS-IY
	for bug-gnu-emacs@HIDDEN; Sat, 18 Dec 2010 16:30:16 -0500
Received: from rgrjr.com ([216.146.47.5]:35197)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PU4M2-0004fA-9M
	for bug-gnu-emacs@HIDDEN; Sat, 18 Dec 2010 16:30:14 -0500
Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net
	[66.30.196.77])
	by rgrjr.com (Postfix on CentOS) with ESMTP id 905981601CA
	for <bug-gnu-emacs@HIDDEN>; Sat, 18 Dec 2010 21:30:12 +0000 (UTC)
Received: (qmail 27398 invoked by uid 89); 18 Dec 2010 21:30:12 -0000
Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1)
	by home with SMTP; 18 Dec 2010 21:30:12 -0000
Received: by rgr.rgrjr.com (Postfix, from userid 500)
	id C2301A4E6E; Sat, 18 Dec 2010 16:30:11 -0500 (EST)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="MyecuAFNpv"
Content-Transfer-Encoding: 7bit
Message-ID: <19725.10211.399667.389809@HIDDEN>
Date: Sat, 18 Dec 2010 16:30:11 -0500
From: Bob Rogers <rogers-emacs@HIDDEN>
X-Mailer: VM 7.19 under Emacs 24.0.50.1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Spam-Score: -6.2 (------)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)


--MyecuAFNpv
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

   If you start a multifile commit from *vc-dir* and then change the
selected fileset, log-edit-done (C-c C-c) commits the original fileset
without comment.  The attached patch fixes this by recomputing the
fileset, and prompting the user if anything changed.  First, the user is
offered a chance to use the new fileset (since that is probably what was
intended), then to continue the commit with the original fileset.  If
both choices are refused, then the commit is aborted.  Most of the patch
factors vc-deduce-fileset-internal out of vc-deduce-fileset and
vc-filter-files-to-commit out of vc-next-action in order to avoid code
duplication.

   For symmetry, C-x v v ought to make the equivalent check when reusing
an existing log buffer.  It currently overwrites the changeset for any
commit in progress.  If that change is acceptable, I will submit a
separate patch.

   Along the way, I've also changed the name of the "observer" parameter
of vc-deduce-fileset to "nonviolent-p", and documented it as such, since
this seems to be what was intended:  This is passed non-nil only from
places that do not change VC state, such as vc-diff and vc-log.

					-- Bob Rogers
					   http://www.rgrjr.com/


--MyecuAFNpv
Content-Type: text/plain
Content-Description: 
Content-Disposition: inline;
	filename="vc-log-prompt-if-fileset-changed.patch"
Content-Transfer-Encoding: 7bit

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 40f91b7..d55bf48 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -941,33 +941,42 @@ Within directories, only files already under version control are noticed."
 (declare-function vc-dir-current-file "vc-dir" ())
 (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files))
 
-(defun vc-deduce-fileset (&optional observer allow-unregistered
-				    state-model-only-files)
-  "Deduce a set of files and a backend to which to apply an operation.
+(defun log-edit-deduce-fileset (state-model-only-files)
+  ;; Attempt to reconstruct the original fileset from the log-edit
+  ;; buffer.  [We ought to be able to do a better job.  Better still,
+  ;; we ought to be able to return the fileset used to create the
+  ;; buffer.  At least we don't need state-model-only-files, since
+  ;; that has already been taken care of.  -- rgr, 27-Nov-10.]
+  (let ((backend
+	  (and vc-parent-buffer
+	       (with-current-buffer vc-parent-buffer
+		 (if (derived-mode-p 'vc-dir-mode)
+		     vc-dir-backend
+		     (vc-responsible-backend
+		       (or buffer-file-name default-directory)))))))
+    (and backend
+	 (list backend vc-log-fileset))))
+
+(defun vc-deduce-fileset-internal (&optional nonviolent-p state-model-only-files)
+  "Deduce a set of registered files and a backend for an operation.
 
 Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL).
-If we're in VC-dir mode, the fileset is the list of marked files.
-Otherwise, if we're looking at a buffer visiting a version-controlled file,
-the fileset is a singleton containing this file.
-If none of these conditions is met, but ALLOW_UNREGISTERED is on and the
-visited file is not registered, return a singleton fileset containing it.
-Otherwise, throw an error.
+See vc-deduce-fileset for details; we do just the first part of the search,
+looking for registered files, returning nil if nothing found.
 
-STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs
-the FILESET-ONLY-FILES STATE and MODEL info.  Otherwise, that
-part may be skipped.
-BEWARE: this function may change the
-current buffer."
-  ;; FIXME: OBSERVER is unused.  The name is not intuitive and is not
-  ;; documented.  It's set to t when called from diff and print-log.
+BEWARE: this function may change the current buffer."
   (let (backend)
     (cond
      ((derived-mode-p 'vc-dir-mode)
       (vc-dir-deduce-fileset state-model-only-files))
      ((derived-mode-p 'dired-mode)
-      (if observer
+      (if nonviolent-p
 	  (vc-dired-deduce-fileset)
 	(error "State changing VC operations not supported in `dired-mode'")))
+     ((derived-mode-p 'log-edit-mode)
+      ;; This has a vc-parent-buffer, but that might result in a
+      ;; different fileset.
+      (log-edit-deduce-fileset state-model-only-files))
      ((setq backend (vc-backend buffer-file-name))
       (if state-model-only-files
 	(list backend (list buffer-file-name)
@@ -978,11 +987,37 @@ current buffer."
      ((and (buffer-live-p vc-parent-buffer)
            ;; FIXME: Why this test?  --Stef
            (or (buffer-file-name vc-parent-buffer)
-				(with-current-buffer vc-parent-buffer
-				  (derived-mode-p 'vc-dir-mode))))
+	       (with-current-buffer vc-parent-buffer
+		 (derived-mode-p 'vc-dir-mode))))
+      ;; Note that vc-parent-buffer must be registered.
       (progn                  ;FIXME: Why not `with-current-buffer'? --Stef.
 	(set-buffer vc-parent-buffer)
-	(vc-deduce-fileset observer allow-unregistered state-model-only-files)))
+	(vc-deduce-fileset-internal nonviolent-p state-model-only-files))))))
+
+(defun vc-deduce-fileset (&optional nonviolent-p allow-unregistered
+				    state-model-only-files)
+  "Deduce a set of files and a backend to which to apply an operation.
+
+Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL).
+If we're in VC-dir mode, the fileset is the list of marked files.
+Otherwise, if we're in dired-mode, use current/marked files.
+Otherwise, if we're looking at a buffer visiting a version-controlled file,
+the fileset is a singleton containing this file.
+Otherwise, if we're in a VC buffer that has a parent, try again in the parent.
+If none of these conditions is met, but ALLOW-UNREGISTERED is true and the
+visited file is not registered, return a singleton fileset containing it.
+Otherwise, throw an error.
+
+NONVIOLENT-P means that the fileset will be used for a non-state-changing
+operation, such as vc-log or vc-diff.
+
+STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs
+the FILESET-ONLY-FILES STATE and MODEL info.  Otherwise, that
+part may be skipped.
+BEWARE: this function may change the
+current buffer."
+  (cond
+     ((vc-deduce-fileset-internal nonviolent-p state-model-only-files))
      ((not buffer-file-name)
        (error "Buffer %s is not associated with a file" (buffer-name)))
      ((and allow-unregistered (not (vc-registered buffer-file-name)))
@@ -994,7 +1029,7 @@ current buffer."
 		nil)
 	(list (vc-backend-for-registration (buffer-file-name))
 	      (list buffer-file-name))))
-     (t (error "No fileset is available here")))))
+     (t (error "No fileset is available here"))))
 
 (defun vc-dired-deduce-fileset ()
   (let ((backend (vc-responsible-backend default-directory)))
@@ -1036,6 +1071,42 @@ current buffer."
    (eq p q)
    (and (member p '(edited added removed)) (member q '(edited added removed)))))
 
+(defun vc-filter-files-to-commit (fileset)
+  ;; Given a fileset, return those that are ready to commit.
+  (let* ((files (nth 1 fileset))
+	 (model (nth 4 fileset))
+	 (ready-for-commit files))
+    ;; If files are edited but read-only, give user a chance to correct
+    (dolist (file files)
+      (unless (file-writable-p file)
+	;; Make the file+buffer read-write.
+	(unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue?" file))
+	  (error "Aborted"))
+	(set-file-modes file (logior (file-modes file) 128))
+	(let ((visited (get-file-buffer file)))
+	  (when visited
+	    (with-current-buffer visited
+	      (toggle-read-only -1))))))
+    ;; Allow user to revert files with no changes.
+    ;; [shouldn't we factor (not (eq model 'implicit)) out of the loop?
+    ;; -- rgr, 26-Nov-10.]
+    (save-excursion
+      (dolist (file files)
+	(let ((visited (get-file-buffer file)))
+	  ;; For files with locking, if the file does not contain
+	  ;; any changes, just let go of the lock, i.e. revert.
+	  (when (and (not (eq model 'implicit))
+		     (vc-workfile-unchanged-p file)
+		     ;; If buffer is modified, that means the user just
+		     ;; said no to saving it; in that case, don't revert,
+		     ;; because the user might intend to save after
+		     ;; finishing the log entry and committing.
+		     (not (and visited (buffer-modified-p))))
+	    (vc-revert-file file)
+	    (setq ready-for-commit (delete file ready-for-commit))))))
+    ;; Remaining files need to be committed
+    ready-for-commit))
+
 ;; Here's the major entry point.
 
 ;;;###autoload
@@ -1112,34 +1183,7 @@ merge in the changes into your working copy."
         (message "Fileset is up-to-date"))))
      ;; Files have local changes
      ((vc-compatible-state state 'edited)
-      (let ((ready-for-commit files))
-	;; If files are edited but read-only, give user a chance to correct
-	(dolist (file files)
-	  (unless (file-writable-p file)
-	    ;; Make the file+buffer read-write.
-	    (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue?" file))
-	      (error "Aborted"))
-	    (set-file-modes file (logior (file-modes file) 128))
-	    (let ((visited (get-file-buffer file)))
-	      (when visited
-		(with-current-buffer visited
-		  (toggle-read-only -1))))))
-	;; Allow user to revert files with no changes
-	(save-excursion
-          (dolist (file files)
-            (let ((visited (get-file-buffer file)))
-              ;; For files with locking, if the file does not contain
-              ;; any changes, just let go of the lock, i.e. revert.
-              (when (and (not (eq model 'implicit))
-			 (vc-workfile-unchanged-p file)
-			 ;; If buffer is modified, that means the user just
-			 ;; said no to saving it; in that case, don't revert,
-			 ;; because the user might intend to save after
-			 ;; finishing the log entry and committing.
-			 (not (and visited (buffer-modified-p))))
-		(vc-revert-file file)
-		(setq ready-for-commit (delete file ready-for-commit))))))
-	;; Remaining files need to be committed
+      (let ((ready-for-commit (vc-filter-files-to-commit vc-fileset)))
 	(if (not ready-for-commit)
 	    (message "No files remain to be committed")
 	  (if (not verbose)
@@ -1387,6 +1431,39 @@ Type \\[vc-next-action] to check in changes.")
      ".\n")
     (message "Please explain why you stole the lock.  Type C-c C-c when done.")))
 
+(defun vc-confirm-files-if-changed (old-files new-files)
+  ;; Given two lists of file names, return t if they are the same, the
+  ;; symbol confirmed if the user says to check in the new set, nil if
+  ;; the user says to use the old set, and throw an error otherwise.
+  (let ((removed-files nil)
+	(added-files nil))
+    ;; Compute the difference sets.
+    (dolist (old-file old-files)
+      (unless (member old-file new-files)
+	(push old-file removed-files)))
+    (dolist (new-file new-files)
+      (unless (member new-file old-files)
+	(push new-file added-files)))
+    (cond ((and (null removed-files) (null added-files))
+	    ;; No change.
+	    t)
+	  ((let ((added-line
+		   (if added-files
+		       (concat "\n  Added: " (vc-delistify added-files))
+		       ""))
+		 (removed-line
+		   (if removed-files
+		       (concat "\n  Removed:  " (vc-delistify removed-files))
+		       "")))
+	     (yes-or-no-p (concat "Fileset has changed:"
+				  added-line removed-line
+				  "\nUse the new fileset? ")))
+	    'confirmed)
+	  ((yes-or-no-p "Continue anyway? ")
+	    nil)
+	  (t
+	    (error "Checkin aborted.")))))
+
 (defun vc-checkin (files backend &optional rev comment initial-contents)
   "Check in FILES.
 The optional argument REV may be a string specifying the new revision
@@ -1411,6 +1488,12 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
       (vc-call-backend backend 'log-edit-mode))
     (lexical-let ((rev rev))
       (lambda (files comment)
+	;; Check to see if the fileset has changed.
+	(let ((new (vc-filter-files-to-commit (vc-deduce-fileset-internal))))
+	  (when (vc-confirm-files-if-changed files new)
+	    (setq files new)
+	    ;; Apparently, this is needed to update the right fileset.
+	    (setq vc-log-files new)))
         (message "Checking in %s..." (vc-delistify files))
         ;; "This log message intentionally left almost blank".
         ;; RCS 5.7 gripes about white-space-only comments too.

--MyecuAFNpv--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Bob Rogers <rogers-emacs@HIDDEN>
Subject: bug#7675: Acknowledgement (24.0.50; vc-checkin should prompt if
 the fileset changes)
Message-ID: <handler.7675.B.129270743922452.ack <at> debbugs.gnu.org>
References: <19725.10211.399667.389809@HIDDEN>
X-Gnu-PR-Message: ack 7675
X-Gnu-PR-Package: emacs
Reply-To: 7675 <at> debbugs.gnu.org
Date: Sat, 18 Dec 2010 21:24:02 +0000

Thank you for filing a new bug report with GNU.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 7675 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
7675: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7675
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 18 Dec 2010 21:28:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 18 16:28:49 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PU4Ke-0005xV-Gk
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:28:48 -0500
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rgm@HIDDEN>) id 1PU4Kc-0005xJ-Jd
	for control <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:28:46 -0500
Received: from localhost ([127.0.0.1]:58703)
	by fencepost.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rgm@HIDDEN>)
	id 1PU4Qm-0004zB-OL; Sat, 18 Dec 2010 16:35:08 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19725.10508.533679.761022@HIDDEN>
Date: Sat, 18 Dec 2010 16:35:08 -0500
From: Glenn Morris <rgm@HIDDEN>
To: control <control <at> debbugs.gnu.org>
Subject: emacs merge
X-Attribution: GM
X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs)
X-Hue: cyan
X-Ran: ExukQXO]qsi=P^#W,=`~:pBIGdF+oa=:jJa]$f{XLT?hI#d/tz%R(LIHBh\p|k12T\g_Is
X-Debbugs-No-Ack: yes
X-Spam-Score: -6.2 (------)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)

forcemerge 6399 7675
tags 6399 patch




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 18 Dec 2010 21:28:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 18 16:28:49 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PU4Ke-0005xV-Gk
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:28:48 -0500
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rgm@HIDDEN>) id 1PU4Kc-0005xJ-Jd
	for control <at> debbugs.gnu.org; Sat, 18 Dec 2010 16:28:46 -0500
Received: from localhost ([127.0.0.1]:58703)
	by fencepost.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rgm@HIDDEN>)
	id 1PU4Qm-0004zB-OL; Sat, 18 Dec 2010 16:35:08 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19725.10508.533679.761022@HIDDEN>
Date: Sat, 18 Dec 2010 16:35:08 -0500
From: Glenn Morris <rgm@HIDDEN>
To: control <control <at> debbugs.gnu.org>
Subject: emacs merge
X-Attribution: GM
X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs)
X-Hue: cyan
X-Ran: ExukQXO]qsi=P^#W,=`~:pBIGdF+oa=:jJa]$f{XLT?hI#d/tz%R(LIHBh\p|k12T\g_Is
X-Debbugs-No-Ack: yes
X-Spam-Score: -6.2 (------)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)

forcemerge 6399 7675
tags 6399 patch




Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7675: 24.0.50; vc-checkin should prompt if the fileset changes
Resent-From: Bob Rogers <rogers-emacs@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 19 Dec 2010 04:40:03 +0000
Resent-Message-ID: <handler.7675.B7675.129273355031189 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 7675
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 7675 <at> debbugs.gnu.org
Received: via spool by 7675-submit <at> debbugs.gnu.org id=B7675.129273355031189
          (code B ref 7675); Sun, 19 Dec 2010 04:40:03 +0000
Received: (at 7675) by debbugs.gnu.org; 19 Dec 2010 04:39:10 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PUB37-00086z-IN
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2010 23:39:09 -0500
Received: from rgrjr.com ([216.146.47.5])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PUB35-00086V-5F
	for 7675 <at> debbugs.gnu.org; Sat, 18 Dec 2010 23:39:07 -0500
Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net
	[66.30.196.77])
	by rgrjr.com (Postfix on CentOS) with ESMTP id 3AEE81600DE
	for <7675 <at> debbugs.gnu.org>; Sun, 19 Dec 2010 04:45:32 +0000 (UTC)
Received: (qmail 11379 invoked by uid 89); 19 Dec 2010 04:45:31 -0000
Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1)
	by home with SMTP; 19 Dec 2010 04:45:31 -0000
Received: by rgr.rgrjr.com (Postfix, from userid 500)
	id 027F2A4E6E; Sat, 18 Dec 2010 23:45:16 -0500 (EST)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19725.36316.354969.581382@HIDDEN>
Date: Sat, 18 Dec 2010 23:45:16 -0500
From: Bob Rogers <rogers-emacs@HIDDEN>
In-Reply-To: <handler.7675.B.129270743922452.ack <at> debbugs.gnu.org>
References: <19725.10211.399667.389809@HIDDEN>
	<handler.7675.B.129270743922452.ack <at> debbugs.gnu.org>
X-Mailer: VM 7.19 under Emacs 24.0.50.1
X-Spam-Score: -4.3 (----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

   Oops; please hold off on this.  It seems that this patch does the
wrong thing if the commit is not started from *vc-dir*, or started on a
single unmarked file.

					-- Bob




Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7675: 24.0.50; vc-checkin should prompt if the fileset changes
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 19 Dec 2010 13:51:02 +0000
Resent-Message-ID: <handler.7675.B7675.129276664215687 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 7675
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Bob Rogers <rogers-emacs@HIDDEN>
Cc: 7675 <at> debbugs.gnu.org
Received: via spool by 7675-submit <at> debbugs.gnu.org id=B7675.129276664215687
          (code B ref 7675); Sun, 19 Dec 2010 13:51:02 +0000
Received: (at 7675) by debbugs.gnu.org; 19 Dec 2010 13:50:42 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PUJen-00044n-4V
	for submit <at> debbugs.gnu.org; Sun, 19 Dec 2010 08:50:42 -0500
Received: from ironport2-out.teksavvy.com ([206.248.154.181]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1PUJek-00044Y-6d
	for 7675 <at> debbugs.gnu.org; Sun, 19 Dec 2010 08:50:34 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvsEADeeDU1Ld/KP/2dsb2JhbACkM3S6cIVKBIRljhI
X-IronPort-AV: E=Sophos;i="4.60,196,1291611600"; d="scan'208";a="85871610"
Received: from 75-119-242-143.dsl.teksavvy.com (HELO pastel.home)
	([75.119.242.143])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	19 Dec 2010 08:57:00 -0500
Received: by pastel.home (Postfix, from userid 20848)
	id 567EF58E99; Sun, 19 Dec 2010 08:57:00 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvzks1rhnl.fsf-monnier+emacs@HIDDEN>
References: <19725.10211.399667.389809@HIDDEN>
Date: Sun, 19 Dec 2010 08:57:00 -0500
In-Reply-To: <19725.10211.399667.389809@HIDDEN> (Bob Rogers's message
	of "Sat, 18 Dec 2010 16:30:11 -0500")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.0 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.0 (--)

Thanks for submitting a patch to try and fix this problem.
A quick obvious issue, tho:

> --- a/lisp/vc/vc.el
> +++ b/lisp/vc/vc.el
[...]
> +(defun log-edit-deduce-fileset (state-model-only-files)

If it's in vc.el it can't start with the "log-edit-" prefix.


        Stefan "who hasn't yet had time to look at the rest of the patch"




Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7675: 24.0.50; vc-checkin should prompt if the fileset changes
Resent-From: Bob Rogers <rogers-emacs@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 19 Dec 2010 20:40:03 +0000
Resent-Message-ID: <handler.7675.B7675.129279114518882 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 7675
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 7675 <at> debbugs.gnu.org
Received: via spool by 7675-submit <at> debbugs.gnu.org id=B7675.129279114518882
          (code B ref 7675); Sun, 19 Dec 2010 20:40:03 +0000
Received: (at 7675) by debbugs.gnu.org; 19 Dec 2010 20:39:05 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PUQ24-0004uU-4D
	for submit <at> debbugs.gnu.org; Sun, 19 Dec 2010 15:39:04 -0500
Received: from rgrjr.com ([216.146.47.5])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PUQ22-0004u1-7X
	for 7675 <at> debbugs.gnu.org; Sun, 19 Dec 2010 15:39:03 -0500
Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net
	[66.30.196.77])
	by rgrjr.com (Postfix on CentOS) with ESMTP id 0BC861601AD
	for <7675 <at> debbugs.gnu.org>; Sun, 19 Dec 2010 20:45:29 +0000 (UTC)
Received: (qmail 10121 invoked by uid 89); 19 Dec 2010 20:45:28 -0000
Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1)
	by home with SMTP; 19 Dec 2010 20:45:28 -0000
Received: by rgr.rgrjr.com (Postfix, from userid 500)
	id 1ABFAA4E90; Sun, 19 Dec 2010 15:45:25 -0500 (EST)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19726.28388.786955.19167@HIDDEN>
Date: Sun, 19 Dec 2010 15:45:24 -0500
From: Bob Rogers <rogers-emacs@HIDDEN>
In-Reply-To: <jwvzks1rhnl.fsf-monnier+emacs@HIDDEN>
References: <19725.10211.399667.389809@HIDDEN>
	<jwvzks1rhnl.fsf-monnier+emacs@HIDDEN>
X-Mailer: VM 7.19 under Emacs 24.0.50.1
X-Spam-Score: -4.1 (----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.0 (----)

   From: Stefan Monnier <monnier@HIDDEN>
   Date: Sun, 19 Dec 2010 08:57:00 -0500

   Thanks for submitting a patch to try and fix this problem.
   A quick obvious issue, tho:

   > --- a/lisp/vc/vc.el
   > +++ b/lisp/vc/vc.el
   [...]
   > +(defun log-edit-deduce-fileset (state-model-only-files)

   If it's in vc.el it can't start with the "log-edit-" prefix.

Yes, I was wondering about that.  I had thought about putting it in
log-edit.el, but it seems closer to VC internals than log-edit
internals.  Which would you prefer:  Rename it, or move it?  If
"rename", would "vc-log-edit-deduce-fileset" suffice?

	   Stefan "who hasn't yet had time to look at the rest of the patch"

Just as well, considering that the patch fails for single-file commits.
I am thinking that vc-commit only ever needs to re-examine the fileset
if the commit was (a) started in *vc-dir* and (b) with marked files.
Otherwise, the fileset is determined by the way C-x v v is invoked, and
there's no way to change it later.  True?

   And while I'm thinking of it, a VC fileset really ought to be
represented by a struct, since all this car-ing and cdr-ing is really
messy.  But filesets are passed to backends, so testing such a change
would be a pain.  What are your thoughts?  It is worth it?

					-- Bob




Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7675: 24.0.50; vc-checkin should prompt if the fileset changes
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Dec 2010 02:44:02 +0000
Resent-Message-ID: <handler.7675.B7675.129281301816832 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 7675
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Bob Rogers <rogers-emacs@HIDDEN>
Cc: 7675 <at> debbugs.gnu.org
Received: via spool by 7675-submit <at> debbugs.gnu.org id=B7675.129281301816832
          (code B ref 7675); Mon, 20 Dec 2010 02:44:02 +0000
Received: (at 7675) by debbugs.gnu.org; 20 Dec 2010 02:43:38 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PUVir-0004NR-EY
	for submit <at> debbugs.gnu.org; Sun, 19 Dec 2010 21:43:37 -0500
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1PUVip-0004NG-Sh
	for 7675 <at> debbugs.gnu.org; Sun, 19 Dec 2010 21:43:36 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvsEAOpSDk1Ld/KP/2dsb2JhbACkLnS8CYVKBIRljhI
X-IronPort-AV: E=Sophos;i="4.60,199,1291611600"; d="scan'208";a="85904688"
Received: from 75-119-242-143.dsl.teksavvy.com (HELO ceviche.home)
	([75.119.242.143])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	19 Dec 2010 21:50:03 -0500
Received: by ceviche.home (Postfix, from userid 20848)
	id 38EDC66112; Sun, 19 Dec 2010 21:50:03 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvmxo1tbdt.fsf-monnier+emacs@HIDDEN>
References: <19725.10211.399667.389809@HIDDEN>
	<jwvzks1rhnl.fsf-monnier+emacs@HIDDEN>
	<19726.28388.786955.19167@HIDDEN>
Date: Sun, 19 Dec 2010 21:50:03 -0500
In-Reply-To: <19726.28388.786955.19167@HIDDEN> (Bob Rogers's message of
	"Sun, 19 Dec 2010 15:45:24 -0500")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.0 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.0 (--)

>    Thanks for submitting a patch to try and fix this problem.
>    A quick obvious issue, tho:

>> --- a/lisp/vc/vc.el
>> +++ b/lisp/vc/vc.el
>    [...]
>> +(defun log-edit-deduce-fileset (state-model-only-files)

>    If it's in vc.el it can't start with the "log-edit-" prefix.

> Yes, I was wondering about that.  I had thought about putting it in
> log-edit.el, but it seems closer to VC internals than log-edit
> internals.

log-edit deals with editing the text buffer, so clearly this job is not
about log-edit but VC.

> Which would you prefer:  Rename it, or move it?  If
> "rename", would "vc-log-edit-deduce-fileset" suffice?

I guess so, tho I don't understand why you need this function.  IIUC you
should switch to vc-parent before calling vc-deduce-fileset, so that
function never needs to handle log-edit buffers.

>    And while I'm thinking of it, a VC fileset really ought to be
> represented by a struct, since all this car-ing and cdr-ing is really
> messy.  But filesets are passed to backends, so testing such a change
> would be a pain.  What are your thoughts?  It is worth it?

It doesn't seem complex enough to warrant such a change.
Maybe another approach is to use pcase.
E.g. instead of

   (let ((backend (car fs))
         (files (cdr fs)))
     ..)

or something like that, you'd write

   (pcase-let ((`(,backend . ,files) fileset))
     ...)

Experience with ML-style languages tends to indicate that such pattern
matching tends to reduce the need for named fields, tho obviously type
checking (and inference) is also an important part of it since it
catches incorrect patterns.


        Stefan




Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7675: 24.0.50; vc-checkin should prompt if the fileset changes
Resent-From: Bob Rogers <rogers-emacs@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Dec 2010 04:12:02 +0000
Resent-Message-ID: <handler.7675.B7675.129281829325052 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 7675
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 7675 <at> debbugs.gnu.org
Received: via spool by 7675-submit <at> debbugs.gnu.org id=B7675.129281829325052
          (code B ref 7675); Mon, 20 Dec 2010 04:12:02 +0000
Received: (at 7675) by debbugs.gnu.org; 20 Dec 2010 04:11:33 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PUX5w-0006W1-Rm
	for submit <at> debbugs.gnu.org; Sun, 19 Dec 2010 23:11:33 -0500
Received: from rgrjr.com ([216.146.47.5])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rogers-emacs@HIDDEN>) id 1PUX5u-0006Vo-U9
	for 7675 <at> debbugs.gnu.org; Sun, 19 Dec 2010 23:11:31 -0500
Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net
	[66.30.196.77])
	by rgrjr.com (Postfix on CentOS) with ESMTP id 92FBB160205
	for <7675 <at> debbugs.gnu.org>; Mon, 20 Dec 2010 04:17:58 +0000 (UTC)
Received: (qmail 26652 invoked by uid 89); 20 Dec 2010 04:17:58 -0000
Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1)
	by home with SMTP; 20 Dec 2010 04:17:58 -0000
Received: by rgr.rgrjr.com (Postfix, from userid 500)
	id 30FC4A4E90; Sun, 19 Dec 2010 23:17:42 -0500 (EST)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19726.55525.580236.307665@HIDDEN>
Date: Sun, 19 Dec 2010 23:17:41 -0500
From: Bob Rogers <rogers-emacs@HIDDEN>
In-Reply-To: <jwvmxo1tbdt.fsf-monnier+emacs@HIDDEN>
References: <19725.10211.399667.389809@HIDDEN>
	<jwvzks1rhnl.fsf-monnier+emacs@HIDDEN>
	<19726.28388.786955.19167@HIDDEN>
	<jwvmxo1tbdt.fsf-monnier+emacs@HIDDEN>
X-Mailer: VM 7.19 under Emacs 24.0.50.1
X-Spam-Score: -3.9 (---)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.9 (---)

   From: Stefan Monnier <monnier@HIDDEN>
   Date: Sun, 19 Dec 2010 21:50:03 -0500

   >    Thanks for submitting a patch to try and fix this problem.
   >    A quick obvious issue, tho:

   >> --- a/lisp/vc/vc.el
   >> +++ b/lisp/vc/vc.el
   >    [...]
   >> +(defun log-edit-deduce-fileset (state-model-only-files)

   >    If it's in vc.el it can't start with the "log-edit-" prefix.

   > Yes, I was wondering about that.  I had thought about putting it in
   > log-edit.el, but it seems closer to VC internals than log-edit
   > internals.

   log-edit deals with editing the text buffer, so clearly this job is not
   about log-edit but VC.

Fair enough.

   > Which would you prefer:  Rename it, or move it?  If
   > "rename", would "vc-log-edit-deduce-fileset" suffice?

   I guess so, tho I don't understand why you need this function.  IIUC you
   should switch to vc-parent before calling vc-deduce-fileset, so that
   function never needs to handle log-edit buffers.

Ah, that's a good question.  That is what the existing vc-deduce-fileset
does (as I'm sure you know), which means that if you change the *vc-dir*
fileset after starting a commit, C-x v = in the log buffer will diff the
new fileset, but C-c C-c will still commit the old one; this is also a
bug in the pretest [1], and probably back to 23.1.

   ISTM that if we want to detect when the *VC-log* buffer and the
*vc-dir* buffer have different filesets, then it makes sense to consider
that the *VC-log* buffer implies a fileset is independent of its parent.
That is the model to which I was coding.

   Another way to fix the problem would be to define the existing
vc-deduce-fileset behavior as correct, and fix vc-commit always to
commit the most current fileset.  Then you would need a different patch
entirely.  I am not crazy about this idea, because it would make it
harder to perform multiple commits in parallel.

   A third way to fix it would be to put vc-deduce-fileset in charge of
detecting when the *vc-dir* fileset has changed.  In other words, not
only would C-c C-c ask you what was up, C-x v = would as well.  This
ISTM would make parallel commits even harder.

   >    And while I'm thinking of it, a VC fileset really ought to be
   > represented by a struct, since all this car-ing and cdr-ing is really
   > messy.  But filesets are passed to backends, so testing such a change
   > would be a pain.  What are your thoughts?  It is worth it?

   It doesn't seem complex enough to warrant such a change.
   Maybe another approach is to use pcase.
   E.g. instead of

      (let ((backend (car fs))
	    (files (cdr fs)))
	..)

   or something like that, you'd write

      (pcase-let ((`(,backend . ,files) fileset))
	...)

   Experience with ML-style languages tends to indicate that such pattern
   matching tends to reduce the need for named fields,

I was thinking more of abstraction.  This sort of destructuring means
you need to know that a fileset is represented as a list in which the
backend comes first and the files come second.  When I was trying to
find out how the various backends used the "state" element of that list,
for example, it would have been really nice to have been able to grep
for calls to something like "vc-fileset-state".

   tho obviously type checking (and inference) is also an important part
   of it since it catches incorrect patterns.

	   Stefan

Indeed.  In fact, the correct pattern for a fileset is more like
`(,backend ,files ,nondir-files ,state ,model) -- so thank you for
illustrating my point.  ;-}

   I think that is part of why I am less than keen on Haskell and
Erlang, the only two ML-style languages which which I have any
acquaintance.

					-- Bob

[1] I hadn't noticed this before because I have a hacked version of
    vc-deduce-fileset I wrote more than two years ago that fixes this,
    by doing almost the same thing for log buffers as the code in the
    patch.  Not sure why I didn't report this bug at the time.  In any
    case, I had forgotten about it completely.




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 18 Jul 2021 13:11:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 18 09:11:02 2021
Received: from localhost ([127.0.0.1]:55430 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m56ZR-00028B-QK
	for submit <at> debbugs.gnu.org; Sun, 18 Jul 2021 09:11:02 -0400
Received: from quimby.gnus.org ([95.216.78.240]:34042)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m56ZP-00027h-OR
 for control <at> debbugs.gnu.org; Sun, 18 Jul 2021 09:11:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc:
 MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=e1NnK9N2Bg+y1yCfqyxqb2Dcwhx94tacgXj/9cNTXmI=; b=qIm6GcM7oSNCOnzMlMFQOezNlu
 yMXD+e5e+O5U/S6F6hjkDz++41H2VMjJIkThZ8Q0q4YvBugJj1jQXmzoz6X4STxyZSpvM/GjCWCmZ
 ukYl1LBaHeUQ3Skjdt1kHKAX7Wb9iefkYJemvxr5lJokKwFoFs65CheXvaU69UfMZ7jU=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1m56ZI-0000pE-77
 for control <at> debbugs.gnu.org; Sun, 18 Jul 2021 15:10:54 +0200
Date: Sun, 18 Jul 2021 15:10:51 +0200
Message-Id: <87v957rcmc.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: control message for bug #6399
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  tags 6399 + moreinfo quit 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

tags 6399 + moreinfo
quit





Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 16 Aug 2021 12:15:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 16 08:15:26 2021
Received: from localhost ([127.0.0.1]:48801 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mFbWY-0003Xa-0R
	for submit <at> debbugs.gnu.org; Mon, 16 Aug 2021 08:15:26 -0400
Received: from quimby.gnus.org ([95.216.78.240]:43070)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mFbWW-0003R2-78
 for control <at> debbugs.gnu.org; Mon, 16 Aug 2021 08:15:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc:
 MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=R+jZrFZId7RcX+atilhnZYbQwNXZY78ZJ++jjZFxPek=; b=urHeqNgqyhtzgpi7E+ha8E+Fww
 PjEsXt797/W7Oo+abf7tgf+HRLCNYPm+PRF5KncXy00U0BIWOHvGkORW8UlODZXwP4pxXEKRzwhpm
 S4fIA9PUYT8BmgorfDDqvg82IHzhDxs3DdxTiE+XvNAfquBeIksXCyQxa+xoFIASrcsU=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1mFbWO-0004c6-Mc
 for control <at> debbugs.gnu.org; Mon, 16 Aug 2021 14:15:18 +0200
Date: Mon, 16 Aug 2021 14:15:16 +0200
Message-Id: <874kbpegbv.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: control message for bug #6399
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  tags 6399 - moreinfo quit 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

tags 6399 - moreinfo
quit






Last modified: Mon, 16 Aug 2021 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.