git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* emacs and git...
@ 2007-03-22 14:53 Francis Moreau
  2007-03-22 15:50 ` Matthieu Moy
  2007-03-22 15:57 ` Randal L. Schwartz
  0 siblings, 2 replies; 17+ messages in thread
From: Francis Moreau @ 2007-03-22 14:53 UTC (permalink / raw)
  To: git

Hi,

I guess it's a dumb...

I know that some of you work within emacs. I tried to use git iniside
a emacs shell (M-x shell) and had a weid behaviour:

$ git diff
WARNING: terminal is not fully functional
-  (press RETURN)
diff --git a/.lde/bin/cmd-version b/.lde/bin/cmd-version^[[m
index a6ce3f8..687112d 100755^[[m
--- a/.lde/bin/cmd-version^[[m
+++ b/.lde/bin/cmd-version^[[m
@@ -54,7 +54,7 @@ gdb_version () {^[[m
[snip]

I'm not using diff color option.

Can anybody shed some light ?

thanks
-- 
Francis

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

* Re: emacs and git...
  2007-03-22 14:53 emacs and git Francis Moreau
@ 2007-03-22 15:50 ` Matthieu Moy
  2007-03-22 15:57 ` Randal L. Schwartz
  1 sibling, 0 replies; 17+ messages in thread
From: Matthieu Moy @ 2007-03-22 15:50 UTC (permalink / raw)
  To: git

"Francis Moreau" <francis.moro@gmail.com> writes:

> Hi,
>
> I guess it's a dumb...
>
> I know that some of you work within emacs. I tried to use git iniside
> a emacs shell (M-x shell) and had a weid behaviour:

DVC has an embryo of a git mode (development not active at the
moment).

  http://download.gna.org/dvc/

There's also a git.el which I didn't try yet.

-- 
Matthieu

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

* Re: emacs and git...
  2007-03-22 14:53 emacs and git Francis Moreau
  2007-03-22 15:50 ` Matthieu Moy
@ 2007-03-22 15:57 ` Randal L. Schwartz
  2007-03-22 17:19   ` Bernt Hansen
  2007-03-23  7:29   ` Francis Moreau
  1 sibling, 2 replies; 17+ messages in thread
From: Randal L. Schwartz @ 2007-03-22 15:57 UTC (permalink / raw)
  To: Francis Moreau; +Cc: git

>>>>> "Francis" == Francis Moreau <francis.moro@gmail.com> writes:

Francis> Hi,
Francis> I guess it's a dumb...

Francis> I know that some of you work within emacs. I tried to use git iniside
Francis> a emacs shell (M-x shell) and had a weid behaviour:

Francis> $ git diff
Francis> WARNING: terminal is not fully functional
Francis> -  (press RETURN)
Francis> diff --git a/.lde/bin/cmd-version b/.lde/bin/cmd-version.[m
Francis> index a6ce3f8..687112d 100755.[m
Francis> --- a/.lde/bin/cmd-version.[m
Francis> +++ b/.lde/bin/cmd-version.[m
Francis> @@ -54,7 +54,7 @@ gdb_version () {.[m
Francis> [snip]

Francis> I'm not using diff color option.

Francis> Can anybody shed some light ?

I use M-x shell on a regular basis, and have learned to add the following
three items to my .emacs wherever I'm at:

  (setenv "PAGER" "/bin/cat")
  (setenv "EDITOR" "/opt/emacs/bin/emacsclient") ; `which emacsclient`
  (server-start)

Unless you do the first line, programs that like to push things through "less"
or "more" do some pretty nasty things.  And those last two are nice, because
you can use "git-commit" directly in the shell window, and it'll pop up an
emacs buffer.  Read up on emacs-server mode or you won't know how to get out
of it though. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: emacs and git...
  2007-03-22 15:57 ` Randal L. Schwartz
@ 2007-03-22 17:19   ` Bernt Hansen
  2007-03-23  7:26     ` Francis Moreau
  2007-03-23  7:29   ` Francis Moreau
  1 sibling, 1 reply; 17+ messages in thread
From: Bernt Hansen @ 2007-03-22 17:19 UTC (permalink / raw)
  To: git

I use M-x term instead of shell mode to interact with git.  That works
fine for me.

C-c C-j and C-c C-k switches between line and character mode so the
regular emacs control sequences are not sent directly to the term
session.
 
-Bernt

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

* Re: emacs and git...
  2007-03-22 17:19   ` Bernt Hansen
@ 2007-03-23  7:26     ` Francis Moreau
  0 siblings, 0 replies; 17+ messages in thread
From: Francis Moreau @ 2007-03-23  7:26 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: git

On 3/22/07, Bernt Hansen <bernt@norang.ca> wrote:
> I use M-x term instead of shell mode to interact with git.  That works
> fine for me.
>

yes that works for me too but I'm wondering why it doesn't for shell mode...

thanks
-- 
Francis

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

* Re: emacs and git...
  2007-03-22 15:57 ` Randal L. Schwartz
  2007-03-22 17:19   ` Bernt Hansen
@ 2007-03-23  7:29   ` Francis Moreau
  2007-03-23  7:30     ` Randal L. Schwartz
  1 sibling, 1 reply; 17+ messages in thread
From: Francis Moreau @ 2007-03-23  7:29 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

On 3/22/07, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>
> I use M-x shell on a regular basis, and have learned to add the following
> three items to my .emacs wherever I'm at:
>
>   (setenv "PAGER" "/bin/cat")
>   (setenv "EDITOR" "/opt/emacs/bin/emacsclient") ; `which emacsclient`
>   (server-start)
>
> Unless you do the first line, programs that like to push things through "less"
> or "more" do some pretty nasty things.

the funny thing is that the following command in emacs' shell actually
do nothing.

$ PAGE=cat git diff HEAD^
$

>  And those last two are nice, because
> you can use "git-commit" directly in the shell window, and it'll pop up an
> emacs buffer.  Read up on emacs-server mode or you won't know how to get out
> of it though. :)
>

yep I already do that.

-- 
Francis

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

* Re: emacs and git...
  2007-03-23  7:29   ` Francis Moreau
@ 2007-03-23  7:30     ` Randal L. Schwartz
  2007-03-23  8:32       ` Francis Moreau
  0 siblings, 1 reply; 17+ messages in thread
From: Randal L. Schwartz @ 2007-03-23  7:30 UTC (permalink / raw)
  To: Francis Moreau; +Cc: git

>>>>> "Francis" == Francis Moreau <francis.moro@gmail.com> writes:

Francis> $ PAGE=cat git diff HEAD^

PAGE?  or PAGER?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

* Re: emacs and git...
  2007-03-23  7:30     ` Randal L. Schwartz
@ 2007-03-23  8:32       ` Francis Moreau
  2007-03-23  9:07         ` Junio C Hamano
  0 siblings, 1 reply; 17+ messages in thread
From: Francis Moreau @ 2007-03-23  8:32 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: git

On 3/23/07, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "Francis" == Francis Moreau <francis.moro@gmail.com> writes:
>
> Francis> $ PAGE=cat git diff HEAD^
>
> PAGE?  or PAGER?
>

PAGER

But I actually know it doesn't print anything, because I put 'HEAD'
instead of 'HEAD^', sorry for the wrong alert.

Can't git make 'cat' the default pager when run on a dumb terminal ?

thanks
-- 
Francis

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

* Re: emacs and git...
  2007-03-23  8:32       ` Francis Moreau
@ 2007-03-23  9:07         ` Junio C Hamano
  2007-03-23  9:54           ` Francis Moreau
  2007-03-23  9:56           ` Francis Moreau
  0 siblings, 2 replies; 17+ messages in thread
From: Junio C Hamano @ 2007-03-23  9:07 UTC (permalink / raw)
  To: Francis Moreau; +Cc: Randal L. Schwartz, git

"Francis Moreau" <francis.moro@gmail.com> writes:

> Can't git make 'cat' the default pager when run on a dumb terminal ?

IIRC, `more` works on a dumb terminal.

But using PAGER=cat is a longstanding and widely used trick
among Emacs old timers, predating the EDITOR=emacsclient, which
is even nicer.  I would highly recommend it.  These two
environment variables make running *everything* in compilation
mode (or shell buffer) so much nicer than otherwise.

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

* Re: emacs and git...
  2007-03-23  9:07         ` Junio C Hamano
@ 2007-03-23  9:54           ` Francis Moreau
  2007-03-23 10:10             ` Junio C Hamano
  2007-03-23  9:56           ` Francis Moreau
  1 sibling, 1 reply; 17+ messages in thread
From: Francis Moreau @ 2007-03-23  9:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Randal L. Schwartz, git

On 3/23/07, Junio C Hamano <junkio@cox.net> wrote:
> "Francis Moreau" <francis.moro@gmail.com> writes:
>
> > Can't git make 'cat' the default pager when run on a dumb terminal ?
>
> IIRC, `more` works on a dumb terminal.
>

yes it does although the behaviour is a bit weird. Not all screen is used.

> But using PAGER=cat is a longstanding and widely used trick
> among Emacs old timers, predating the EDITOR=emacsclient, which
> is even nicer.  I would highly recommend it.  These two
> environment variables make running *everything* in compilation
> mode (or shell buffer) so much nicer than otherwise.
>

I think I'm going to give a try PAGER=more and EDITOR=emacsclient
config with shell buffer and see if it can fit well my git usage.

I tried to use term mode but it's pretty annoying to switch between
'line' and 'char' mode all the time.

BTW Junio, just out of curiosity, do you use shell or term mode ?
-- 
Francis

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

* Re: emacs and git...
  2007-03-23  9:07         ` Junio C Hamano
  2007-03-23  9:54           ` Francis Moreau
@ 2007-03-23  9:56           ` Francis Moreau
  2007-03-24  9:56             ` Junio C Hamano
  1 sibling, 1 reply; 17+ messages in thread
From: Francis Moreau @ 2007-03-23  9:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Randal L. Schwartz, git

On 3/23/07, Junio C Hamano <junkio@cox.net> wrote:
> "Francis Moreau" <francis.moro@gmail.com> writes:
>
> > Can't git make 'cat' the default pager when run on a dumb terminal ?
>
> IIRC, `more` works on a dumb terminal.
>

BTW why not making 'more' the default on a dumb term instead of 'less' ?
-- 
Francis

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

* Re: emacs and git...
  2007-03-23  9:54           ` Francis Moreau
@ 2007-03-23 10:10             ` Junio C Hamano
  2007-03-23 17:29               ` Francis Moreau
  0 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2007-03-23 10:10 UTC (permalink / raw)
  To: Francis Moreau; +Cc: Junio C Hamano, Randal L. Schwartz, git

"Francis Moreau" <francis.moro@gmail.com> writes:

> BTW Junio, just out of curiosity, do you use shell or term mode ?

Neither.  Almost all of my external command session inside Emacs
is done in compilation mode.  I even bind "C-x c" to "compile".

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

* Re: emacs and git...
  2007-03-23 10:10             ` Junio C Hamano
@ 2007-03-23 17:29               ` Francis Moreau
  2007-03-24  9:55                 ` Junio C Hamano
  0 siblings, 1 reply; 17+ messages in thread
From: Francis Moreau @ 2007-03-23 17:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Randal L. Schwartz, git

On 3/23/07, Junio C Hamano <junkio@cox.net> wrote:
> "Francis Moreau" <francis.moro@gmail.com> writes:
>
> > BTW Junio, just out of curiosity, do you use shell or term mode ?
>
> Neither.  Almost all of my external command session inside Emacs
> is done in compilation mode.  I even bind "C-x c" to "compile".
>

hm do you also run all git commands in this mode ??
-- 
Francis

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

* Re: emacs and git...
  2007-03-23 17:29               ` Francis Moreau
@ 2007-03-24  9:55                 ` Junio C Hamano
  2007-03-24 15:10                   ` Francis Moreau
  0 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2007-03-24  9:55 UTC (permalink / raw)
  To: Francis Moreau; +Cc: Junio C Hamano, Randal L. Schwartz, git

"Francis Moreau" <francis.moro@gmail.com> writes:

> On 3/23/07, Junio C Hamano <junkio@cox.net> wrote:
>> "Francis Moreau" <francis.moro@gmail.com> writes:
>>
>> > BTW Junio, just out of curiosity, do you use shell or term mode ?
>>
>> Neither.  Almost all of my external command session inside Emacs
>> is done in compilation mode.  I even bind "C-x c" to "compile".
>>
>
> hm do you also run all git commands in this mode ??

Which ones do you specifically have in mind to have trouble
with?

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

* Re: emacs and git...
  2007-03-23  9:56           ` Francis Moreau
@ 2007-03-24  9:56             ` Junio C Hamano
  2007-03-24 15:12               ` Francis Moreau
  0 siblings, 1 reply; 17+ messages in thread
From: Junio C Hamano @ 2007-03-24  9:56 UTC (permalink / raw)
  To: Francis Moreau; +Cc: Junio C Hamano, Randal L. Schwartz, git

"Francis Moreau" <francis.moro@gmail.com> writes:

> On 3/23/07, Junio C Hamano <junkio@cox.net> wrote:
>> "Francis Moreau" <francis.moro@gmail.com> writes:
>>
>> > Can't git make 'cat' the default pager when run on a dumb terminal ?
>>
>> IIRC, `more` works on a dumb terminal.
>
> BTW why not making 'more' the default on a dumb term instead of 'less' ?

Isn't that so 80'ish?

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

* Re: emacs and git...
  2007-03-24  9:55                 ` Junio C Hamano
@ 2007-03-24 15:10                   ` Francis Moreau
  0 siblings, 0 replies; 17+ messages in thread
From: Francis Moreau @ 2007-03-24 15:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Randal L. Schwartz, git

On 3/24/07, Junio C Hamano <junkio@cox.net> wrote:
> "Francis Moreau" <francis.moro@gmail.com> writes:
> > hm do you also run all git commands in this mode ??
>
> Which ones do you specifically have in mind to have trouble
> with?
>

well none in peculiar (since I now use PAGER=more), I'm just suprised
you're using compilation mode for all your commands.

thanks
-- 
Francis

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

* Re: emacs and git...
  2007-03-24  9:56             ` Junio C Hamano
@ 2007-03-24 15:12               ` Francis Moreau
  0 siblings, 0 replies; 17+ messages in thread
From: Francis Moreau @ 2007-03-24 15:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Randal L. Schwartz, git

On 3/24/07, Junio C Hamano <junkio@cox.net> wrote:
> "Francis Moreau" <francis.moro@gmail.com> writes:
>
> > On 3/23/07, Junio C Hamano <junkio@cox.net> wrote:
> >> "Francis Moreau" <francis.moro@gmail.com> writes:
> >>
> >> > Can't git make 'cat' the default pager when run on a dumb terminal ?
> >>
> >> IIRC, `more` works on a dumb terminal.
> >
> > BTW why not making 'more' the default on a dumb term instead of 'less' ?
>
> Isn't that so 80'ish?
>
>

It simply avoids this kind of output when running `git-diff` from
shell mode for example:

+^[[m
+Basic bisect commands: start, bad, good^[[m
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^[[m
 ^[[m
 The way you use it is:^[[m
 ^[[m
 ------------------------------------------------^[[m
 $ git bisect start^[[m
-$ git bisect bad                       # Current version is bad^[[m
-$ git bisect good v2.6.13-rc2          # v2.6.13-rc2 was the last version^[[m
-                                       # tested that was good^[[m
+$ git bisect bad                 # Current version is bad^[[m
+$ git bisect good v2.6.13-rc2    # v2.6.13-rc2 was the last version^[[m
+                                 # tested that was good^[[m
 ------------------------------------------------^[[m
 ^[[m
-When you give at least one bad and one good versions, it will^[[m
-bisect the revision tree and say something like:^[[m
+When you give at least one bad and one good versions, it will bisect^[[m
+the revision tree and say something like:^[[m
 ^[[m
-- 
Francis

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

end of thread, other threads:[~2007-03-24 15:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-22 14:53 emacs and git Francis Moreau
2007-03-22 15:50 ` Matthieu Moy
2007-03-22 15:57 ` Randal L. Schwartz
2007-03-22 17:19   ` Bernt Hansen
2007-03-23  7:26     ` Francis Moreau
2007-03-23  7:29   ` Francis Moreau
2007-03-23  7:30     ` Randal L. Schwartz
2007-03-23  8:32       ` Francis Moreau
2007-03-23  9:07         ` Junio C Hamano
2007-03-23  9:54           ` Francis Moreau
2007-03-23 10:10             ` Junio C Hamano
2007-03-23 17:29               ` Francis Moreau
2007-03-24  9:55                 ` Junio C Hamano
2007-03-24 15:10                   ` Francis Moreau
2007-03-23  9:56           ` Francis Moreau
2007-03-24  9:56             ` Junio C Hamano
2007-03-24 15:12               ` Francis Moreau

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 NNTP newsgroup(s).