all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ChangeLog and Version Control
@ 2002-09-26  6:59 Richard V. Molen
  2002-09-26  8:24 ` Kai Großjohann
  0 siblings, 1 reply; 8+ messages in thread
From: Richard V. Molen @ 2002-09-26  6:59 UTC (permalink / raw)



When using version control C-x C-q to check in (commit) a file into a
CVS repository, a buffer is presented in which to enter comments about
that change.  C-c C-c then does the actual checkin and then presents
the ChangeLog with an entry automatically filled in.  So far so good.

However, a C-x C-q on the ChangeLog pops up a the log buffer and C-c C-c
presents the re-revised ChangeLog again...

So, how do I keep the ChangeLog under CVS control and avoid this cyclic
behavior?

Perhaps there's a better method.  I wonder how others maintain version
histories.

-- 
Richard V. Molen

Warning!!
Signature under construction, safety glasses required.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-26  6:59 ChangeLog and Version Control Richard V. Molen
@ 2002-09-26  8:24 ` Kai Großjohann
  2002-09-26  8:39   ` Aman S Kohli
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2002-09-26  8:24 UTC (permalink / raw)


rmolen@socal.rr.com (Richard V. Molen) writes:

> When using version control C-x C-q to check in (commit) a file into a
> CVS repository, a buffer is presented in which to enter comments about
> that change.  C-c C-c then does the actual checkin and then presents
> the ChangeLog with an entry automatically filled in.  So far so good.

I think this is not the default behavior.  The default behavior is
that the ChangeLog file is not changed after doing C-c C-c.

So something in your config must be doing it.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-26  8:24 ` Kai Großjohann
@ 2002-09-26  8:39   ` Aman S Kohli
  2002-09-26 14:29     ` Kai Großjohann
  0 siblings, 1 reply; 8+ messages in thread
From: Aman S Kohli @ 2002-09-26  8:39 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> rmolen@socal.rr.com (Richard V. Molen) writes:
> 
> I think this is not the default behavior.  The default behavior is
> that the ChangeLog file is not changed after doing C-c C-c.
> 
> So something in your config must be doing it.

vc provides a function to use as part of the checkin hook.  I got this from

<URL http://www.ece.utexas.edu/projects/courses/spring_02/ee379k/bow-20020213/HACKING>

     (add-hook 'vc-checkin-hook 'vc-checkin-add-log)
     ;;; Insert the file's new log entries in ChangeLog.
     (defun vc-checkin-add-log ()
       (let ((log (find-change-log)))
         (and log
     	 (y-or-n-p (format "Update %s for %s changes? "
     			   (file-relative-name log)
     			   (file-relative-name buffer-file-name)))
     	 (vc-comment-to-change-log nil log))))


Aman

> kai
> -- 
> ~/.signature is: umop ap!sdn    (Frank Nobis)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-26  8:39   ` Aman S Kohli
@ 2002-09-26 14:29     ` Kai Großjohann
  2002-09-26 17:19       ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2002-09-26 14:29 UTC (permalink / raw)


Aman S Kohli <akohli@iona.com> writes:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
>
>> rmolen@socal.rr.com (Richard V. Molen) writes:
>> 
>> I think this is not the default behavior.  The default behavior is
>> that the ChangeLog file is not changed after doing C-c C-c.
>> 
>> So something in your config must be doing it.
>
> vc provides a function to use as part of the checkin hook.  I got this from
>
> <URL http://www.ece.utexas.edu/projects/courses/spring_02/ee379k/bow-20020213/HACKING>
>
>      (add-hook 'vc-checkin-hook 'vc-checkin-add-log)
>      ;;; Insert the file's new log entries in ChangeLog.
>      (defun vc-checkin-add-log ()
>        (let ((log (find-change-log)))
>          (and log
>      	 (y-or-n-p (format "Update %s for %s changes? "
>      			   (file-relative-name log)
>      			   (file-relative-name buffer-file-name)))
>      	 (vc-comment-to-change-log nil log))))

Aha.  So one idea would be to redefine this function to do nothing
for ChangeLog files.

Another idea would be to do it the other way round: with C-x 4 a,
make some ChangeLog entries.  Then use PCL-CVS which parses the
ChangeLog file and offers those entries as commit entries.

I like this approach because C-x 4 a is so smart: based on the
position of the cursor, it already finds the right function name (or
section name, for LaTeX files).  Nifty.  (C-x 4 a also works in diff
buffers -- super-nifty.)

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-26 14:29     ` Kai Großjohann
@ 2002-09-26 17:19       ` Stefan Monnier <foo@acm.com>
  2002-09-26 21:34         ` Richard V. Molen
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-09-26 17:19 UTC (permalink / raw)


>>>>> "Kai" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:
> (C-x 4 a also works in diff buffers -- super-nifty.)

Like music to my ears,


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-26 17:19       ` Stefan Monnier <foo@acm.com>
@ 2002-09-26 21:34         ` Richard V. Molen
  2002-09-27  7:08           ` Aman S Kohli
  0 siblings, 1 reply; 8+ messages in thread
From: Richard V. Molen @ 2002-09-26 21:34 UTC (permalink / raw)



Thanks Aman, this was what I was looking for.  I hacked up an
alternative that doesn't prompt -- "if it's the ChangeLog, don't add
the comment." (see below). It's the "I'm not an ELisper" version, but
it seems to work.  Improvements are welcome.

It would be even nicer if I could keep the ChangeLog from 'popping up'
each time -- summary comments could be added explicitly w/ C-x 4 a.

Thank you Kai for your comments on C-x 4 a -- I'll have to try that 
approach.  It has more features than I realised.

******************************
;asks whether to automatically insert last Version control log entry into
;ChangeLog & allow ChangeLog editing.  Answer 'n' after C-x C-q...C-c C-c
;of ChangeLog to prevent adding its log entry to itself.
(defun vc-checkin-add-log-no-prompt ()
  (let ((log (find-change-log)))
  (and log
     (not (string-match
         (format "%s" (file-relative-name log))
         (format "%s" (file-relative-name buffer-file-name))))
     (vc-comment-to-change-log nil log))))

(add-hook 'vc-checkin-hook 'vc-checkin-add-log-no-prompt)

(setq vc-command-messages t   ;display version control backend messages?
      vc-initial-comment t    ;request initial log entry when adding a file.
 )
******************************

-- 
Richard V. Molen

Warning!!
Signature under construction, safety glasses required.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-26 21:34         ` Richard V. Molen
@ 2002-09-27  7:08           ` Aman S Kohli
  2002-09-27 15:42             ` Richard V. Molen
  0 siblings, 1 reply; 8+ messages in thread
From: Aman S Kohli @ 2002-09-27  7:08 UTC (permalink / raw)


rmolen@socal.rr.com (Richard V. Molen) writes:

> Thanks Aman, this was what I was looking for. 

hey, I just snarfed it from some website ;)

> Thank you Kai for your comments on C-x 4 a -- I'll have to try that 
> approach.  It has more features than I realised.

I too found them very useful and enlightening!

Aman


> -- 
> Richard V. Molen
> 
> Warning!!
> Signature under construction, safety glasses required.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ChangeLog and Version Control
  2002-09-27  7:08           ` Aman S Kohli
@ 2002-09-27 15:42             ` Richard V. Molen
  0 siblings, 0 replies; 8+ messages in thread
From: Richard V. Molen @ 2002-09-27 15:42 UTC (permalink / raw)



At the risk of getting thanktimonious, Thank you Stefan and others who
have made the ChangeLog feature so nice.  The
emacs-21.2/lisp/ChangeLog is a nice example of its usefulness.

-- 
Richard V. Molen

Warning!!
Signature under construction, safety glasses required.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-09-27 15:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-26  6:59 ChangeLog and Version Control Richard V. Molen
2002-09-26  8:24 ` Kai Großjohann
2002-09-26  8:39   ` Aman S Kohli
2002-09-26 14:29     ` Kai Großjohann
2002-09-26 17:19       ` Stefan Monnier <foo@acm.com>
2002-09-26 21:34         ` Richard V. Molen
2002-09-27  7:08           ` Aman S Kohli
2002-09-27 15:42             ` Richard V. Molen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.