git and (p9p) acme

183 views
Skip to first unread message

Mathieu Lonjaret

unread,
Apr 19, 2012, 7:51:40 AM4/19/12
to Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
Hello,

Is anyone using git with p9p acme set as the editor?
Most things here work fine (as long as the pager is set to cat or
something like that), but I've been having problems with 'git commit
--amend'. If I use B as the $EDITOR, git considers the log file edited
as soon as it is opened in acme (and does not wait for a Put), and if
I use E instead (which I thought was meant for that), git does not
"notice" when I Put the file, so it just hangs there.
Am I missing something? is there a simple solution to that?

Cheers,
Mathieu

sqweek

unread,
Apr 20, 2012, 12:04:53 PM4/20/12
to mathieu....@gmail.com, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
On 19 April 2012 19:51, Mathieu Lonjaret <mathieu....@gmail.com> wrote:
> Is anyone using git with p9p acme set as the editor?
<snip>

> I use E instead (which I thought was meant for that), git does not
> "notice" when I Put the file, so it just hangs there.

I never tried using EDITOR=E, instead wrote my own little script. I'm
a little compulsive when it comes to hitting Put, so my script
actually waits until you delete the acme window. Also you can hit
"Cancel" to have the script exit non-zero. Anyway this is what I use
for $EDITOR/$VISUAL:

http://sqweek.net/plan9/acmeedit

Also, sup! It's been awhile. You still rock climbing? :)
-sqweek

Mathieu Lonjaret

unread,
Apr 20, 2012, 1:07:57 PM4/20/12
to sqweek, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
Thanks Dexen and Aram for the explanation.

On Fri, Apr 20, 2012 at 6:04 PM, sqweek <sqw...@gmail.com> wrote:
> On 19 April 2012 19:51, Mathieu Lonjaret <mathieu....@gmail.com> wrote:
>> Is anyone using git with p9p acme set as the editor?
> <snip>
>> I use E instead (which I thought was meant for that), git does not
>> "notice" when I Put the file, so it just hangs there.
>
>  I never tried using EDITOR=E, instead wrote my own little script. I'm
> a little compulsive when it comes to hitting Put, so my script
> actually waits until you delete the acme window. Also you can hit
> "Cancel" to have the script exit non-zero. Anyway this is what I use
> for $EDITOR/$VISUAL:
>
> http://sqweek.net/plan9/acmeedit

Nice, it almost works out of the box.
I got a 9p error message when using it:
9p: write error: ill-formed control message
but it actually does the job anyway.
Thanks!

I'll investigate later on to see which part fails exactly.

Mark van Atten

unread,
Apr 20, 2012, 3:39:34 PM4/20/12
to mathieu....@gmail.com, sqweek, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
Mathieu Lonjaret <mathieu....@gmail.com> a écrit :

>> http://sqweek.net/plan9/acmeedit
>
> Nice, it almost works out of the box.
> I got a 9p error message when using it:
> 9p: write error: ill-formed control message

In /lib/acme.rc, there is

fn newwindow {
winctl=`{9p read acme/new/ctl}
winid=$winctl(1)
winctl noscroll
}

I think the noscroll no longer functions; I commented it out, and then
acmeedit no longer produces the error message.

Best wishes,
Mark.

--
Directeur de recherches, CNRS
IHPST, 13 rue du Four, 75006 Paris, France
tel ++ 33 (0)1 43 54 60 36, fax ++ 33 (0)1 43 25 29 48
http://www-ihpst.univ-paris1.fr/en/6,mark_van_atten.html


--
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

Mathieu Lonjaret

unread,
Apr 20, 2012, 4:48:03 PM4/20/12
to mark.v...@univ-paris1.fr, sqweek, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
Indeed.

Russ Cox

unread,
Apr 25, 2012, 4:21:01 PM4/25/12
to mathieu....@gmail.com, mark.v...@univ-paris1.fr, sqweek, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
I guess it depends on what you expect to break.
I like using the E script because (once you learn not
to click Put, which doesn't take too long) after I click
Put the window is still there with my work in it in case
the tool I just sent it to chooses to blow up and
discard my efforts.

Russ

Mathieu Lonjaret

unread,
Apr 25, 2012, 5:35:59 PM4/25/12
to Russ Cox, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
So, are you saying E just works out of the box for you as the $EDITOR
for git/hg?
Or did you have to tweak a few things like what Aram and Dexen describe?

I wouldn't mind using E as it is, with Put being the trigger to the
tool (git in that case), but it does not seem to be working here.

Mathieu Lonjaret

unread,
Apr 25, 2012, 6:35:55 PM4/25/12
to Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
Indeed, it seems like awd was all that was needed.
Thanks!

On Wed, Apr 25, 2012 at 11:49 PM, Aram Hăvărneanu <ara...@mgk.ro> wrote:
>> I guess all you need to run up awd in your cd alias. I think I stole
>> my cd function from Russ.
>
> Actually, the way one does this is documented in label(1). Beware that
> this requires X, hence the $DISPLAY check in my profile.
>
> --
> Aram Hăvărneanu
>

Russ Cox

unread,
Apr 25, 2012, 11:32:48 PM4/25/12
to Mathieu Lonjaret, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
On Wed, Apr 25, 2012 at 5:35 PM, Mathieu Lonjaret
<mathieu....@gmail.com> wrote:
> So, are you saying E just works out of the box for you as the $EDITOR
> for git/hg?

Yes. Note that E waits for the file to change by running
ls -l on the file in a loop. If for some reason doing the Put
does not change the ls -l output (date+size, primarily) then
E will not exit. If you are having trouble I would suggest
putting some echo statements in the script or just doing
'set -e' at the top so that it echoes each statement as it
executes (including the all-important comparison).

I cannot imagine why using awd would change the behavior
of the E script.

Russ

Mathieu Lonjaret

unread,
Apr 26, 2012, 6:20:49 PM4/26/12
to Russ Cox, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
I've just retried on the machine where I had the problem and it now
just works. No need even for awd indeed.
I'll try and reproduce the behavior, but I just don't see what I may
have done different the previous times...

thanks,
Mathieu

Mathieu Lonjaret

unread,
Jun 14, 2012, 8:51:54 AM6/14/12
to Russ Cox, Fans of the OS Plan 9 from Bell Labs, plan9p...@googlegroups.com
It happened again. and I've just realized it's simply what you had
warned about: since it was an --amend and I didn't change anything in
the message there was no change to the ls -l output, hence E did
nothing when I Put.
Reply all
Reply to author
Forward
0 new messages