On Sun, Feb 08 2009, Stefan Reichör wrote:

>>         When using dvc with git, the log edit buffer sometimes is
>>  blank. At other times, It seems to be pre-filled (perhaps from the last
>>  commit).
>>
>>         Is the blank log entry buffer expected? Here is how I reproduce
>>  this.
>>
>>  a. Make a change in some source file in the project.
>>  b. Hit "C-x V =" to see the diffs (asks me whether or not I want to use
>>     the git index, say yes)
>>  c. Look at the diff, hit "m" on the files changed, and hit "a" to add
>>     them to the index.
>>  d. Hit "c" in the xgit-diff buffer to commit the changes
>>  e. The xgit-log-edit buffer is empty.
>>
>>         Should there be something in the buffer?  Shouldn't there be a
>>  separator (dvc-log-edit-file-list-marker) in this buffer? (I wanted to
>>  add a signed off by line using the dvc-log-edit-hook, and wanted to
>>  search forward to the separator, and add the signed off by just above)
>
> AFAIK only the tla log edit buffer had some information inside at
> startup. All others are just empty. Does git provide some useful
> information that could be placed in the log edit buffer?

        Here is what I get when I use git commit -s from the command
 line (I like to have the -s added optionally, currently I fake it using
 a hook):
--8<---------------cut here---------------start------------->8---

Signed-off-by: Manoj Srivastava <[email protected]>

# Please enter the commit message for your changes.
# (Comment lines starting with '#' will not be included)
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   ucf
#
--8<---------------cut here---------------end--------------->8---

        So there is some useful information in the file created by
 git. Could this be snarfed?

        Here is my off-the-cuff hook function, trying to replicate git
 commit's  -s option:
--8<---------------cut here---------------start------------->8---
(add-hook 'dvc-log-edit-mode-hook
          '(lambda ()
             (goto-char (point-max))
             (insert "\n\nSigned-Off-By: "  user-full-name " <"
                     (if debian-changelog-mailing-address
                         debian-changelog-mailing-address)
                     ">\n")
                ))
--8<---------------cut here---------------end--------------->8---

        manoj
-- 
A priest advised Voltaire on his death bed to renounce the devil.
Replied Voltaire, "This is no time to make new enemies."
Manoj Srivastava <[email protected]> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to