emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Creating changelog with magit
@ 2014-04-01 21:42 Thorsten Jolitz
  2014-04-01 23:04 ` Richard Lawrence
  2014-04-03 15:51 ` Florian Beck
  0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-04-01 21:42 UTC (permalink / raw)
  To: emacs-orgmode


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

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

* Re: Creating changelog with magit
  2014-04-01 21:42 Creating changelog with magit Thorsten Jolitz
@ 2014-04-01 23:04 ` Richard Lawrence
  2014-04-03 15:51 ` Florian Beck
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Lawrence @ 2014-04-01 23:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi Thorsten,

Thorsten Jolitz <tjolitz@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

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

* Re: Creating changelog with magit
  2014-04-01 21:42 Creating changelog with magit Thorsten Jolitz
  2014-04-01 23:04 ` Richard Lawrence
@ 2014-04-03 15:51 ` Florian Beck
  2014-04-03 19:59   ` Thorsten Jolitz
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Beck @ 2014-04-03 15:51 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Thorsten Jolitz <tjolitz@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

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

* Re: Creating changelog with magit
  2014-04-03 15:51 ` Florian Beck
@ 2014-04-03 19:59   ` Thorsten Jolitz
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-04-03 19:59 UTC (permalink / raw)
  To: emacs-orgmode

Florian Beck <fb@miszellen.de> writes:

> Thorsten Jolitz <tjolitz@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

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

end of thread, other threads:[~2014-04-03 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-01 21:42 Creating changelog with magit Thorsten Jolitz
2014-04-01 23:04 ` Richard Lawrence
2014-04-03 15:51 ` Florian Beck
2014-04-03 19:59   ` Thorsten Jolitz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).