Re: [O] Creating changelog with magit

2014-04-03 Thread Richard Lawrence
Hi Thorsten,

Thorsten Jolitz tjol...@gmail.com writes:

 i.e. magit does not detect which files/definitions have changed and already
 offers the template for all changes of the current diff to HEAD.

 Am I doing something wrong or is this all there is?

As far as I am aware, this is all there is...at least on the version of
magit I'm running (1.1.1, which is old, but it's the current version in
Debian stable).  Maybe newer magit does something more useful?  Or maybe
there is some configuration incantation to make the default behavior of
C more useful for elisp files?  If someone knows, I would also like to
hear...

Best,
Richard




Re: [O] Creating changelog with magit

2014-04-03 Thread Florian Beck
Thorsten Jolitz tjol...@gmail.com writes:

 I get a meager

 ,---
 | 
 | * org.el: 
 | 
 | # comment text
 | 
 `---

You get this when you are on the file that has changed. Press TAB
(magit-toggle-section) and you see a diff. Move to the chunk you want to
comment on and press C: this should insert the defun/defvar/etc in the
commit buffer.

To automate this I have

  (defun fb/magit-commit-add-log ()
(interactive)
(let* ((ol (car (overlays-at (point
   (beg (overlay-start ol))
   (end (overlay-end ol))
   commit-buffer)
  (save-excursion
(goto-char beg)
(while (re-search-forward ^[+-] end t)
  (save-window-excursion
(magit-commit-add-log)
(setq commit-buffer (current-buffer)
  (display-buffer commit-buffer)))

... but I don't really use this, because it is very slow and, usually,
you want to arrange things differently.

-- 
Florian Beck



Re: [O] Creating changelog with magit

2014-04-03 Thread Thorsten Jolitz
Florian Beck f...@miszellen.de writes:

 Thorsten Jolitz tjol...@gmail.com writes:

 I get a meager

 ,---
 | 
 | * org.el: 
 | 
 | # comment text
 | 
 `---

 You get this when you are on the file that has changed. Press TAB
 (magit-toggle-section) and you see a diff. Move to the chunk you want to
 comment on and press C: this should insert the defun/defvar/etc in the
 commit buffer.

 To automate this I have

   (defun fb/magit-commit-add-log ()
 (interactive)
 (let* ((ol (car (overlays-at (point
(beg (overlay-start ol))
(end (overlay-end ol))
commit-buffer)
   (save-excursion
 (goto-char beg)
 (while (re-search-forward ^[+-] end t)
   (save-window-excursion
 (magit-commit-add-log)
 (setq commit-buffer (current-buffer)
   (display-buffer commit-buffer)))

 ... but I don't really use this, because it is very slow and, usually,
 you want to arrange things differently.


Thanks, I hoped there is more than just this minimal skeleton, and there
is, like so often with emacs/org-mode.

I will try TAB/C and your function next time I commit. 

-- 
cheers,
Thorsten




[O] Creating changelog with magit

2014-04-01 Thread Thorsten Jolitz

Hi List, 

reading this

,
| http://orgmode.org/worg/org-contribute.html
`

I find:

,---
| If you are using magit.el in Emacs, the ChangeLog for such entries
| are easily produced by pressing C in the diff listing.
`---

but when doing so with point on a staged changed in the magit-status
buffer, I get a meager

,---
| 
| * org.el: 
| 
| # comment text
| 
`---

instead of something more useful like this:

,---
| org.el: 
|
| * org.el(foo):
|   (bar):
| * ox.el(doo):
|   (daa):
|   (dee):
| 
| # comment text
| 
`---

i.e. magit does not detect which files/definitions have changed and already
offers the template for all changes of the current diff to HEAD.

Am I doing something wrong or is this all there is?

-- 
cheers,
Thorsten