all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* vc-region-history: HG?
@ 2018-01-16 14:27 Uwe Brauer
  2018-01-16 17:15 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Uwe Brauer @ 2018-01-16 14:27 UTC (permalink / raw)
  To: emacs-devel

Hi

I just found out about vc-region-history which looks very 
interesting.

However it does not seem to support mercurial, but it does support 
git.

What are the technical hurdles to include mercurial?
Thanks

Uwe Brauer 




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

* Re: vc-region-history: HG?
  2018-01-16 14:27 vc-region-history: HG? Uwe Brauer
@ 2018-01-16 17:15 ` Eli Zaretskii
  2018-01-16 18:08   ` Uwe Brauer
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2018-01-16 17:15 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-devel

> From: Uwe Brauer <oub@mat.ucm.es>
> Date: Tue, 16 Jan 2018 15:27:38 +0100
> 
> I just found out about vc-region-history which looks very 
> interesting.
> 
> However it does not seem to support mercurial, but it does support 
> git.
> 
> What are the technical hurdles to include mercurial?

Someone needs to write the vc-hg.el backend for this command.



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

* Re: vc-region-history: HG?
  2018-01-16 17:15 ` Eli Zaretskii
@ 2018-01-16 18:08   ` Uwe Brauer
  2018-01-16 18:41     ` Óscar Fuentes
  0 siblings, 1 reply; 12+ messages in thread
From: Uwe Brauer @ 2018-01-16 18:08 UTC (permalink / raw)
  To: emacs-devel

>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes: 
 
>> From: Uwe Brauer <oub@mat.ucm.es> Date: Tue, 16 Jan 2018 
>> 15:27:38 +0100  I just found out about vc-region-history which 
>> looks very  interesting.   However it does not seem to support 
>> mercurial, but it does support  git.   What are the technical 
>> hurdles to include mercurial? 
 
> Someone needs to write the vc-hg.el backend for this command. 

Yes, right.

But, what is the underlying git command? I tried to debug the 
function and couldn't figure it out.







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

* Re: vc-region-history: HG?
  2018-01-16 18:08   ` Uwe Brauer
@ 2018-01-16 18:41     ` Óscar Fuentes
  2018-01-16 19:08       ` Richard Copley
  0 siblings, 1 reply; 12+ messages in thread
From: Óscar Fuentes @ 2018-01-16 18:41 UTC (permalink / raw)
  To: emacs-devel

Uwe Brauer <oub@mat.ucm.es> writes:

> But, what is the underlying git command? I tried to debug the function
> and couldn't figure it out.

From vc-git-region-history:

(vc-git-command buffer 'async nil "log" "-p" ;"--follow" ;FIXME: not supported?
                (format "-L%d,%d:%s" lfrom lto (file-relative-name file)))


lfrom and lto are line numbers.




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

* Re: vc-region-history: HG?
  2018-01-16 18:41     ` Óscar Fuentes
@ 2018-01-16 19:08       ` Richard Copley
  2018-01-16 19:09         ` Richard Copley
                           ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Richard Copley @ 2018-01-16 19:08 UTC (permalink / raw)
  To: oub; +Cc: Emacs Development

On 16 January 2018 at 18:41, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Uwe Brauer <oub@mat.ucm.es> writes:
>
>> But, what is the underlying git command? I tried to debug the function
>> and couldn't figure it out.

Uwe,

To see the backend command, set 'vc-command-messages' to t
before issuing a VC command in Emacs.

For vc-command history the messages logged are:

Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in
in foreground...
Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in...OK = 0
Running git --no-pager log -p -L... . in background... done

In this case I'm not sure that tells the whole story and I expect Emacs does
some of the work. I didn't put much effort into understanding the output but
perhaps it will give you a useful hint.

> From vc-git-region-history:
>
> (vc-git-command buffer 'async nil "log" "-p" ;"--follow" ;FIXME: not supported?
>                 (format "-L%d,%d:%s" lfrom lto (file-relative-name file)))
>
>
> lfrom and lto are line numbers.



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

* Re: vc-region-history: HG?
  2018-01-16 19:08       ` Richard Copley
@ 2018-01-16 19:09         ` Richard Copley
  2018-01-16 21:04         ` Óscar Fuentes
  2018-01-16 21:25         ` Uwe Brauer
  2 siblings, 0 replies; 12+ messages in thread
From: Richard Copley @ 2018-01-16 19:09 UTC (permalink / raw)
  To: oub; +Cc: Emacs Development

On 16 January 2018 at 19:08, Richard Copley <rcopley@gmail.com> wrote:
> To see the backend command, set 'vc-command-messages' to t
> before issuing a VC command in Emacs.
>
> For vc-command history the messages logged are:

vc-region-history, sorry.

> Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in
> in foreground...
> Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in...OK = 0
> Running git --no-pager log -p -L... . in background... done
>
> In this case I'm not sure that tells the whole story and I expect Emacs does
> some of the work. I didn't put much effort into understanding the output but
> perhaps it will give you a useful hint.



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

* Re: vc-region-history: HG?
  2018-01-16 19:08       ` Richard Copley
  2018-01-16 19:09         ` Richard Copley
@ 2018-01-16 21:04         ` Óscar Fuentes
  2018-01-16 21:09           ` Richard Copley
                             ` (3 more replies)
  2018-01-16 21:25         ` Uwe Brauer
  2 siblings, 4 replies; 12+ messages in thread
From: Óscar Fuentes @ 2018-01-16 21:04 UTC (permalink / raw)
  To: emacs-devel

Richard Copley <rcopley@gmail.com> writes:

> On 16 January 2018 at 18:41, Óscar Fuentes <ofv@wanadoo.es> wrote:
>> Uwe Brauer <oub@mat.ucm.es> writes:
>>
>>> But, what is the underlying git command? I tried to debug the function
>>> and couldn't figure it out.
>
> Uwe,
>
> To see the backend command, set 'vc-command-messages' to t
> before issuing a VC command in Emacs.
>
> For vc-command history the messages logged are:
>
> Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in
> in foreground...
> Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in...OK = 0
> Running git --no-pager log -p -L... . in background... done
>
> In this case I'm not sure that tells the whole story and I expect Emacs does
> some of the work. I didn't put much effort into understanding the output but
> perhaps it will give you a useful hint.
>
>> From vc-git-region-history:
>>
>> (vc-git-command buffer 'async nil "log" "-p" ;"--follow" ;FIXME: not supported?
>>                 (format "-L%d,%d:%s" lfrom lto (file-relative-name file)))
>>
>>
>> lfrom and lto are line numbers.

In case it is not clear, the command is

git log -p -L10,20:foo.c

for printing the history of lines 10 to 20 of file foo.c




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

* Re: vc-region-history: HG?
  2018-01-16 21:04         ` Óscar Fuentes
@ 2018-01-16 21:09           ` Richard Copley
  2018-01-16 21:15           ` Stefan Monnier
                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Richard Copley @ 2018-01-16 21:09 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: Emacs Development

On 16 January 2018 at 21:04, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Richard Copley <rcopley@gmail.com> writes:
>
>> On 16 January 2018 at 18:41, Óscar Fuentes <ofv@wanadoo.es> wrote:
>>> Uwe Brauer <oub@mat.ucm.es> writes:
>>>
>>>> But, what is the underlying git command? I tried to debug the function
>>>> and couldn't figure it out.
>>
>> Uwe,
>>
>> To see the backend command, set 'vc-command-messages' to t
>> before issuing a VC command in Emacs.
>>
>> For vc-command history the messages logged are:
>>
>> Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in
>> in foreground...
>> Running git --no-pager diff-index --exit-code -p HEAD  -- Makefile.in...OK = 0
>> Running git --no-pager log -p -L... . in background... done
>>
>> In this case I'm not sure that tells the whole story and I expect Emacs does
>> some of the work. I didn't put much effort into understanding the output but
>> perhaps it will give you a useful hint.
>>
>>> From vc-git-region-history:
>>>
>>> (vc-git-command buffer 'async nil "log" "-p" ;"--follow" ;FIXME: not supported?
>>>                 (format "-L%d,%d:%s" lfrom lto (file-relative-name file)))
>>>
>>>
>>> lfrom and lto are line numbers.
>
> In case it is not clear, the command is
>
> git log -p -L10,20:foo.c
>
> for printing the history of lines 10 to 20 of file foo.c

Oh. I think it's a shame that vc-command-messages doesn't tell the whole ... .



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

* Re: vc-region-history: HG?
  2018-01-16 21:04         ` Óscar Fuentes
  2018-01-16 21:09           ` Richard Copley
@ 2018-01-16 21:15           ` Stefan Monnier
  2018-01-16 21:26           ` Uwe Brauer
  2018-01-17 16:54           ` Uwe Brauer
  3 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2018-01-16 21:15 UTC (permalink / raw)
  To: emacs-devel

> In case it is not clear, the command is
>
> git log -p -L10,20:foo.c
>
> for printing the history of lines 10 to 20 of file foo.c

And FWIW, it should be possible to implement a "generic" fallback which
calls vc-annotate to get relevant revisions, then vc-print-log and
vc-diff to extract the corresponding data.  It would probably be
slowish, but I'd welcome such an addition.


        Stefan




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

* Re: vc-region-history: HG?
  2018-01-16 19:08       ` Richard Copley
  2018-01-16 19:09         ` Richard Copley
  2018-01-16 21:04         ` Óscar Fuentes
@ 2018-01-16 21:25         ` Uwe Brauer
  2 siblings, 0 replies; 12+ messages in thread
From: Uwe Brauer @ 2018-01-16 21:25 UTC (permalink / raw)
  To: emacs-devel

>>> "Richard" == Richard Copley <rcopley@gmail.com> writes: 
 
> On 16 January 2018 at 18:41, Óscar Fuentes <ofv@wanadoo.es> 
> wrote: 
>> Uwe Brauer <oub@mat.ucm.es> writes:  
>>> But, what is the underlying git command? I tried to debug the 
>>> function and couldn't figure it out. 
 
> Uwe, 
 
> To see the backend command, set 'vc-command-messages' to t 
> before issuing a VC command in Emacs. 
 
> For vc-command history the messages logged are: 
 
> Running git --no-pager diff-index --exit-code -p HEAD  -- 
> Makefile.in in foreground...  Running git --no-pager diff-index 
> --exit-code -p HEAD  -- Makefile.in...OK = 0 Running git 
> --no-pager log -p -L... . in background... done 
 
> In this case I'm not sure that tells the whole story and I 
> expect Emacs does some of the work. I didn't put much effort 
> into understanding the output but perhaps it will give you a 
> useful hint. 

Thanks this was indeed helpful. I have to see if there are HG 
equivalents.

Uwe 




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

* Re: vc-region-history: HG?
  2018-01-16 21:04         ` Óscar Fuentes
  2018-01-16 21:09           ` Richard Copley
  2018-01-16 21:15           ` Stefan Monnier
@ 2018-01-16 21:26           ` Uwe Brauer
  2018-01-17 16:54           ` Uwe Brauer
  3 siblings, 0 replies; 12+ messages in thread
From: Uwe Brauer @ 2018-01-16 21:26 UTC (permalink / raw)
  To: emacs-devel

 
   > Richard Copley <rcopley@gmail.com> writes: 
 
   > In case it is not clear, the command is 
 
   > git log -p -L10,20:foo.c 

Ok thanks.




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

* Re: vc-region-history: HG?
  2018-01-16 21:04         ` Óscar Fuentes
                             ` (2 preceding siblings ...)
  2018-01-16 21:26           ` Uwe Brauer
@ 2018-01-17 16:54           ` Uwe Brauer
  3 siblings, 0 replies; 12+ messages in thread
From: Uwe Brauer @ 2018-01-17 16:54 UTC (permalink / raw)
  To: emacs-devel

 
   > Richard Copley <rcopley@gmail.com> writes: 
 
   > In case it is not clear, the command is 
 
   > git log -p -L10,20:foo.c 
 
   > for printing the history of lines 10 to 20 of file foo.c 
 
I just checked with hg 4.4.1. The command

hg log -fp -L foo.c,10:20

Produces basically the same. I might try at the weekend to 
implement it, but if somebody more familiar with vc want to do it, 
please go ahead.








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

end of thread, other threads:[~2018-01-17 16:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16 14:27 vc-region-history: HG? Uwe Brauer
2018-01-16 17:15 ` Eli Zaretskii
2018-01-16 18:08   ` Uwe Brauer
2018-01-16 18:41     ` Óscar Fuentes
2018-01-16 19:08       ` Richard Copley
2018-01-16 19:09         ` Richard Copley
2018-01-16 21:04         ` Óscar Fuentes
2018-01-16 21:09           ` Richard Copley
2018-01-16 21:15           ` Stefan Monnier
2018-01-16 21:26           ` Uwe Brauer
2018-01-17 16:54           ` Uwe Brauer
2018-01-16 21:25         ` Uwe Brauer

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.