all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Automatically commenting changes
@ 2011-01-25  9:40 Gary
  2011-01-25  9:46 ` Deniz Dogan
  0 siblings, 1 reply; 12+ messages in thread
From: Gary @ 2011-01-25  9:40 UTC (permalink / raw)
  To: help-gnu-emacs

An editor I used long long ago had the ability to tag lines you changed
with your name (or some other customisable character sequence). For
example if I changed the line
  int i = 0;
the editor would automatically generate a comment on the end:
  int i = 1; /*gary*/

Does anything like this exist for emacs? Apart from me remembering to do
it manually, of course...

-- 
Gary        Please do NOT send me 'courtesy' replies off-list.
GNU Emacs 23.2.1
emacsclient 23.2




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

* Re: Automatically commenting changes
  2011-01-25  9:40 Gary
@ 2011-01-25  9:46 ` Deniz Dogan
  2011-01-25 10:48   ` Gary
  0 siblings, 1 reply; 12+ messages in thread
From: Deniz Dogan @ 2011-01-25  9:46 UTC (permalink / raw)
  To: help-gnu-emacs

2011/1/25 Gary <help-gnu-emacs@garydjones.name>:
> An editor I used long long ago had the ability to tag lines you changed
> with your name (or some other customisable character sequence). For
> example if I changed the line
>  int i = 0;
> the editor would automatically generate a comment on the end:
>  int i = 1; /*gary*/
>
> Does anything like this exist for emacs? Apart from me remembering to do
> it manually, of course...
>

Are you sure you want the code riddled with comments all over the
place? This sounds like a job for e.g. "bzr blame".

Sorry, I don't think such a thing exists for Emacs.

-- 
Deniz Dogan



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

* Re: Automatically commenting changes
       [not found] <mailman.1.1295948439.29299.help-gnu-emacs@gnu.org>
@ 2011-01-25 10:09 ` Pascal J. Bourguignon
  2011-01-26  3:32 ` Stefan Monnier
  1 sibling, 0 replies; 12+ messages in thread
From: Pascal J. Bourguignon @ 2011-01-25 10:09 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> An editor I used long long ago had the ability to tag lines you changed
> with your name (or some other customisable character sequence). For
> example if I changed the line
>   int i = 0;
> the editor would automatically generate a comment on the end:
>   int i = 1; /*gary*/
>
> Does anything like this exist for emacs? Apart from me remembering to do
> it manually, of course...

M-x vc-annotate RET


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


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

* Re: Automatically commenting changes
  2011-01-25  9:46 ` Deniz Dogan
@ 2011-01-25 10:48   ` Gary
  2011-01-25 18:38     ` Thierry Volpiatto
  0 siblings, 1 reply; 12+ messages in thread
From: Gary @ 2011-01-25 10:48 UTC (permalink / raw)
  To: help-gnu-emacs

Deniz Dogan wrote:
> 2011/1/25 Gary :
>> An editor I used long long ago had the ability to tag lines you
> changed
>> with your name (or some other customisable character sequence).
..
>> Does anything like this exist for emacs?

> Are you sure you want the code riddled with comments all over the
> place?

For three-way merges it was invaluable - if all my changes are tagged,
then it is much easier to see exactly what I have changed. Similarly
during the actual coding, I could find changes very quickly. Commit
those "tags", obviously, would be absurd - actually, I'm not convinced
that whatever editor it was didn't simply display them in the buffer,
but maintained them in a different file or files (I am talking about
something I used about 20 years ago, so can't remember the details).




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

* Re: Automatically commenting changes
  2011-01-25 10:48   ` Gary
@ 2011-01-25 18:38     ` Thierry Volpiatto
  0 siblings, 0 replies; 12+ messages in thread
From: Thierry Volpiatto @ 2011-01-25 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> Deniz Dogan wrote:
>> 2011/1/25 Gary :
>>> An editor I used long long ago had the ability to tag lines you
>> changed
>>> with your name (or some other customisable character sequence).
> ..
>>> Does anything like this exist for emacs?
>
>> Are you sure you want the code riddled with comments all over the
>> place?
>
> For three-way merges it was invaluable - if all my changes are tagged,
> then it is much easier to see exactly what I have changed. Similarly
> during the actual coding, I could find changes very quickly. Commit
> those "tags", obviously, would be absurd - actually, I'm not convinced
> that whatever editor it was didn't simply display them in the buffer,
> but maintained them in a different file or files (I am talking about
> something I used about 20 years ago, so can't remember the details).

Use RCS and add a line like this in the header of your source file:

;; $Log: your_source_file.el,v $

At each time you commit with vc (C-x v v), the changelog will be added
after this line:

;; Revision 1.20  2009/04/20 16:26:43 gary
;; some more changes

;; Revision 1.19  2009/04/18 10:10:53 gary
;; some changes

etc...

That say it is bad practice to add changelog in source files.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: Automatically commenting changes
       [not found] <mailman.1.1295948439.29299.help-gnu-emacs@gnu.org>
  2011-01-25 10:09 ` Automatically commenting changes Pascal J. Bourguignon
@ 2011-01-26  3:32 ` Stefan Monnier
  2011-01-26 13:21   ` Gary
       [not found]   ` <mailman.0.1296048116.12534.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 12+ messages in thread
From: Stefan Monnier @ 2011-01-26  3:32 UTC (permalink / raw)
  To: help-gnu-emacs

> An editor I used long long ago had the ability to tag lines you changed
> with your name (or some other customisable character sequence). For
> example if I changed the line
>   int i = 0;
> the editor would automatically generate a comment on the end:
>   int i = 1; /*gary*/

> Does anything like this exist for emacs? Apart from me remembering to do
> it manually, of course...

I think the way to attack such a problem nowadays is to keep your code
in a version control system (VCS), which then keeps track of all that
info for you.  Emacs and other tools can then use the VCS data to show
you to whom a line belongs.


        Stefan


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

* Re: Automatically commenting changes
  2011-01-26  3:32 ` Stefan Monnier
@ 2011-01-26 13:21   ` Gary
       [not found]   ` <mailman.0.1296048116.12534.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Gary @ 2011-01-26 13:21 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier wrote:

>> An editor I used long long ago had the ability to tag lines you
> changed
>> with your name (or some other customisable character sequence). For
>> example if I changed the line
>>   int i = 0;
>> the editor would automatically generate a comment on the end:
>>   int i = 1; /*gary*/

> I think the way to attack such a problem nowadays is to keep your code
> in a version control system (VCS), which then keeps track of all that
> info for you.

I do. But before I commit, or rather in the process of commiting, when
there is the original file I branched from to consider, plus my changes,
possibly plus changes from others who have commited since I branched,
things can get confusing.

For example, if I see as a difference the above "int i = 1" instead of
"0", I only know it is different to what it was - did I change it? Did
someone else? If I did, does it really make sense, or was it just
something I did in order to achieve some debugging purpose? If I can at
least easily see that it is one of my changes, I have a chance of
understanding why I did it.




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

* Re: Automatically commenting changes
       [not found]   ` <mailman.0.1296048116.12534.help-gnu-emacs@gnu.org>
@ 2011-01-26 13:57     ` Richard Riley
  2011-01-26 16:05       ` Gary
       [not found]       ` <mailman.2.1296057926.30134.help-gnu-emacs@gnu.org>
  2011-01-26 15:55     ` Stefan Monnier
  1 sibling, 2 replies; 12+ messages in thread
From: Richard Riley @ 2011-01-26 13:57 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> Stefan Monnier wrote:
>
>>> An editor I used long long ago had the ability to tag lines you
>> changed
>>> with your name (or some other customisable character sequence). For
>>> example if I changed the line
>>>   int i = 0;
>>> the editor would automatically generate a comment on the end:
>>>   int i = 1; /*gary*/
>
>> I think the way to attack such a problem nowadays is to keep your code
>> in a version control system (VCS), which then keeps track of all that
>> info for you.
>
> I do. But before I commit, or rather in the process of commiting, when
> there is the original file I branched from to consider, plus my changes,
> possibly plus changes from others who have commited since I branched,
> things can get confusing.
>
> For example, if I see as a difference the above "int i = 1" instead of
> "0", I only know it is different to what it was - did I change it? Did
> someone else? If I did, does it really make sense, or was it just
> something I did in order to achieve some debugging purpose? If I can at
> least easily see that it is one of my changes, I have a chance of
> understanding why I did it.
>


git-blame
magit



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

* Re: Automatically commenting changes
       [not found]   ` <mailman.0.1296048116.12534.help-gnu-emacs@gnu.org>
  2011-01-26 13:57     ` Richard Riley
@ 2011-01-26 15:55     ` Stefan Monnier
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2011-01-26 15:55 UTC (permalink / raw)
  To: help-gnu-emacs

> I do. But before I commit, or rather in the process of commiting, when
> there is the original file I branched from to consider, plus my changes,
> possibly plus changes from others who have commited since I branched,
> things can get confusing.

The VCS is keeping track of who modified which lines, so the information
is available.  Maybe the problem is that your VCS or Emacs's
presentation of it doesn't show you the info in a clear enough manner.
If you have a concrete case where the info displayed is not clear
enough, maybe we can figure out how to improve it.


        Stefan


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

* Re: Automatically commenting changes
  2011-01-26 13:57     ` Richard Riley
@ 2011-01-26 16:05       ` Gary
       [not found]       ` <mailman.2.1296057926.30134.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Gary @ 2011-01-26 16:05 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley wrote:
> Gary writes:
>> Stefan Monnier wrote:
>>
>>>> An editor I used long long ago had the ability to tag lines you
>>> changed
>>>> with your name (or some other customisable character sequence).

>>> I think the way to attack such a problem nowadays is to keep your
>>> code in a version control system (VCS), which then keeps track of
>>> all that info for you.
>>
>> I do. But before I commit, or rather in the process of commiting, when
>> there is the original file I branched from to consider, plus my
> changes,
>> possibly plus changes from others who have commited since I branched,
>> things can get confusing.

> git-blame
> magit

Actually I use svn. But still.

It doesn't help.

Sadly I am the only one using vcs (don't even get me *started* on that),
otherwise people just send cra^H^Hode around by email and one person
merges them into an "approved" version, similarly distributed via
email. I then maintain my "private" subversion repo, with the merges and
the changes that I make. Which means that 'svn blame' says I made all of
the changes...

(Okay, so kill me, I used the term "others who have commited" and it
wasn't 100% true.)




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

* Re: Automatically commenting changes
       [not found]       ` <mailman.2.1296057926.30134.help-gnu-emacs@gnu.org>
@ 2011-01-26 19:54         ` Tim X
  2011-01-27  2:16         ` Stefan Monnier
  1 sibling, 0 replies; 12+ messages in thread
From: Tim X @ 2011-01-26 19:54 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> Richard Riley wrote:
>> Gary writes:
>>> Stefan Monnier wrote:
>>>
>>>>> An editor I used long long ago had the ability to tag lines you
>>>> changed
>>>>> with your name (or some other customisable character sequence).
>
>>>> I think the way to attack such a problem nowadays is to keep your
>>>> code in a version control system (VCS), which then keeps track of
>>>> all that info for you.
>>>
>>> I do. But before I commit, or rather in the process of commiting, when
>>> there is the original file I branched from to consider, plus my
>> changes,
>>> possibly plus changes from others who have commited since I branched,
>>> things can get confusing.
>
>> git-blame
>> magit
>
> Actually I use svn. But still.
>
> It doesn't help.
>
> Sadly I am the only one using vcs (don't even get me *started* on that),
> otherwise people just send cra^H^Hode around by email and one person
> merges them into an "approved" version, similarly distributed via
> email. I then maintain my "private" subversion repo, with the merges and
> the changes that I make. Which means that 'svn blame' says I made all of
> the changes...
>
> (Okay, so kill me, I used the term "others who have commited" and it
> wasn't 100% true.)
>
Hi Gary,

If you are the one that commits everything to your private repository,
then the information on who did what is lost. As you point out, svn
blame/praise won't be able to tell you anything useful. At the same
time, since the information has essentially been lost, neither could any
sort of emacs mode help. 

However, there may be a solution, but it would involve changing your
workflow. 

I've had great success with using the git svn method. Essentially, you
can setup a git repository which will allow you to keep your own local
git based copy of the main/central svn repository. You get full
bi-directional interfaces i.e. you can pull down changes and push back
up changes (provided your allowed to write to the svn repository). This
will maintain commit information and has the added advantage, through
git support for rebasing, of keeping commits in a sane order. Git also
has support for handling patches povided via email and other very nice
features. 

While git can seem a bit daunting at first and has a few new conceptual
shifts, I find the benefits to be worth it - to some extent, it is
similar to the move from cvs to svn or from rcs to cvs - some learning
is required, but the final benefits are worth it. 

I use the blame/praise facilities using a git svn repository on a dialy
basis and have been doing so for the last 12 months. It works extremely
well. Merging and branching are much easier and git seems to be able to
handle more stuf that I previously had to handle manually with svn. At
first, I found git somewhat daunting, but soon found out that 80% of
what I needed to do was easy and straight-forward. The trick seems to be
to just focus on the functioanlity you need and don't try to digest the
full scope of options and features available in git all at once. 

Tim

-- 
tcross (at) rapttech dot com dot au


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

* Re: Automatically commenting changes
       [not found]       ` <mailman.2.1296057926.30134.help-gnu-emacs@gnu.org>
  2011-01-26 19:54         ` Tim X
@ 2011-01-27  2:16         ` Stefan Monnier
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2011-01-27  2:16 UTC (permalink / raw)
  To: help-gnu-emacs

> Sadly I am the only one using vcs (don't even get me *started* on that),
> otherwise people just send cra^H^Hode around by email and one person
> merges them into an "approved" version, similarly distributed via
> email. I then maintain my "private" subversion repo, with the merges and
> the changes that I make. Which means that 'svn blame' says I made all of
> the changes...

I see.  Many/most modern VCS can still handle such cases by
distinguishing the committer from the author.  I.e. when you commit you
can provide the name of the author of the code you're committing.
I'm not sure if "svn commit --username" can be used for that or even if
svn offers such functionality, tho it seems at least that you can
manipulate the "svn:author" property after the commit.


        Stefan


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

end of thread, other threads:[~2011-01-27  2:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1.1295948439.29299.help-gnu-emacs@gnu.org>
2011-01-25 10:09 ` Automatically commenting changes Pascal J. Bourguignon
2011-01-26  3:32 ` Stefan Monnier
2011-01-26 13:21   ` Gary
     [not found]   ` <mailman.0.1296048116.12534.help-gnu-emacs@gnu.org>
2011-01-26 13:57     ` Richard Riley
2011-01-26 16:05       ` Gary
     [not found]       ` <mailman.2.1296057926.30134.help-gnu-emacs@gnu.org>
2011-01-26 19:54         ` Tim X
2011-01-27  2:16         ` Stefan Monnier
2011-01-26 15:55     ` Stefan Monnier
2011-01-25  9:40 Gary
2011-01-25  9:46 ` Deniz Dogan
2011-01-25 10:48   ` Gary
2011-01-25 18:38     ` Thierry Volpiatto

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.