From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 From: Paul Lalonde Date: Wed, 15 Feb 2017 13:05:06 +0000 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a113a62960aabf5054891551f Subject: [9fans] Acme and Git Topicbox-Message-UUID: b3d35104-ead9-11e9-9d60-3106f5b1d025 --001a113a62960aabf5054891551f Content-Type: text/plain; charset=UTF-8 I know I'm not the only acme user who uses Git extensively :-) Is there some way to tell if a file is changed on disk that is open in an editor window? I frequently change branches and I often find myself editing stale versions. I notice when comes time to Put, but that's a bit late. Any tips to share? Paul --001a113a62960aabf5054891551f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I know I'm not the only acme user who uses Git extensi= vely :-)
Is there some way to tell if a file is changed on disk that is= open in an editor window?=C2=A0 I frequently change branches and I often f= ind myself editing stale versions.=C2=A0 I notice when comes time to Put, b= ut that's a bit late.

Any tips to share?=C2=A0=

Paul
--001a113a62960aabf5054891551f-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3c2b8baff1adc468257d85f31b697a5c@quintile.net> From: "Steve Simon" Date: Wed, 15 Feb 2017 14:34:30 +0000 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b3d87f76-ead9-11e9-9d60-3106f5b1d025 Hi, I am a sam user who uses subversion (via a substandard OS). when I do an update I always do 'X/./e' to re-read all files - bit of a sledgehammer but at least it stops me getting quite so angry at svn. -Steve From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3c2b8baff1adc468257d85f31b697a5c@quintile.net> References: <3c2b8baff1adc468257d85f31b697a5c@quintile.net> From: =?UTF-8?Q?Sigrid_Haflinad=C3=B3ttir?= Date: Wed, 15 Feb 2017 15:41:11 +0100 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a11354be203e679054892ac0d Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b3e0a52a-ead9-11e9-9d60-3106f5b1d025 --001a11354be203e679054892ac0d Content-Type: text/plain; charset=UTF-8 "X e" works just as well for me. On Wed, Feb 15, 2017 at 3:34 PM, Steve Simon wrote: > Hi, > > I am a sam user who uses subversion (via a substandard OS). > > when I do an update I always do 'X/./e' to re-read all files - bit of a > sledgehammer > but at least it stops me getting quite so angry at svn. > > -Steve > > --001a11354be203e679054892ac0d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
"X e" works just as well for me.

On Wed, Feb 15, 2017 at 3:3= 4 PM, Steve Simon <steve@quintile.net> wrote:
Hi,

I am a sam user who uses subversion (via a substandard OS).

when I do an update I always do 'X/./e' to re-read all files - bit = of a sledgehammer
but at least it stops me getting quite so angry at svn.

-Steve


--001a11354be203e679054892ac0d-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bakul Shah Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Wed, 15 Feb 2017 09:21:36 -0800 Message-Id: References: In-Reply-To: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b3e65baa-ead9-11e9-9d60-3106f5b1d025 May be use Russ'es Watch command?=20 > On Feb 15, 2017, at 5:05 AM, Paul Lalonde wrote= : >=20 > I know I'm not the only acme user who uses Git extensively :-) > Is there some way to tell if a file is changed on disk that is open in an e= ditor window? I frequently change branches and I often find myself editing s= tale versions. I notice when comes time to Put, but that's a bit late. >=20 > Any tips to share?=20 >=20 > Paul From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: In-Reply-To: From: Paul Lalonde Date: Wed, 15 Feb 2017 19:32:10 +0000 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a114f7de44a70d7054896bd6c Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b3f541b0-ead9-11e9-9d60-3106f5b1d025 --001a114f7de44a70d7054896bd6c Content-Type: text/plain; charset=UTF-8 Do you have a pointer to Russ's Watch? I quick dig shows I have poor Google-fu. Paul On Wed, Feb 15, 2017 at 12:23 PM Bakul Shah wrote: > May be use Russ'es Watch command? > > > On Feb 15, 2017, at 5:05 AM, Paul Lalonde > wrote: > > > > I know I'm not the only acme user who uses Git extensively :-) > > Is there some way to tell if a file is changed on disk that is open in > an editor window? I frequently change branches and I often find myself > editing stale versions. I notice when comes time to Put, but that's a bit > late. > > > > Any tips to share? > > > > Paul > > > --001a114f7de44a70d7054896bd6c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Do you have a pointer to Russ's Watch?=C2=A0 I quick d= ig shows I have poor Google-fu.
Paul

On Wed, Feb 15, 2017 at 12:23 PM Bakul Shah <bakul@bitblocks.com> wrote:
=
May be use Russ'es Watch command?<= br class=3D"gmail_msg">
> On Feb 15, 2017, at 5:05 AM, Paul Lalonde <paul.a.lalonde@gm= ail.com> wrote:
>
> I know I'm not the only acme user who uses Git extensively :-)
> Is there some way to tell if a file is changed on disk that is open in= an editor window?=C2=A0 I frequently change branches and I often find myse= lf editing stale versions.=C2=A0 I notice when comes time to Put, but that&= #39;s a bit late.
>
> Any tips to share?
>
> Paul


--001a114f7de44a70d7054896bd6c-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: From: Micah Stetson Date: Wed, 15 Feb 2017 14:29:05 -0700 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a1146f9b0d0443d0548985e4e Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b3fb5ef6-ead9-11e9-9d60-3106f5b1d025 --001a1146f9b0d0443d0548985e4e Content-Type: text/plain; charset=UTF-8 In plan9port, this script will re-load any clean window that differs from an existing file with the same name: ``` #!/usr/local/plan9/bin/rc cleanIDs = `{9p read acme/index | awk '$4 == 0 && $5 == 0 { print $1 }'} for (id in $cleanIDs) { nm = `{9p read acme/$id/tag | sed 's/ .*//'} if (test -f $nm && ! cmp -s $nm <{9p read acme/$id/body}) { echo get | 9p write acme/$id/ctl } } ``` If you make it deal gracefully with acme not running, you could probably have git call it automatically whenever you check out a different revision. Caveats: this does nothing for directory windows, doesn't help with files that exist in one branch and not another, won't touch a dirty window, and has been tested very little. By the way, Russ's Watch is here: https://github.com/rsc/rsc/tree/master/cmd/Watch Micah On Wed, Feb 15, 2017 at 12:32 PM, Paul Lalonde wrote: > Do you have a pointer to Russ's Watch? I quick dig shows I have poor > Google-fu. > Paul > > On Wed, Feb 15, 2017 at 12:23 PM Bakul Shah wrote: > >> May be use Russ'es Watch command? >> >> > On Feb 15, 2017, at 5:05 AM, Paul Lalonde >> wrote: >> > >> > I know I'm not the only acme user who uses Git extensively :-) >> > Is there some way to tell if a file is changed on disk that is open in >> an editor window? I frequently change branches and I often find myself >> editing stale versions. I notice when comes time to Put, but that's a bit >> late. >> > >> > Any tips to share? >> > >> > Paul >> >> >> --001a1146f9b0d0443d0548985e4e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In plan9port, this script will re-load any clean wind= ow that differs from an existing file with the same name:

```
#!/usr/local/plan9/bin/rc

cleanIDs =3D `{9p read acme/index | awk '$4 =3D=3D 0 && $5 = =3D=3D 0 { print $1 }'}
for (id in $cleanIDs) {
nm =3D = `{9p read acme/$id/tag | sed 's/ .*//'}
if (test -f $nm &= & ! cmp -s $nm <{9p read acme/$id/body}) {
echo get | 9p writ= e acme/$id/ctl
}
}
```

=
If you make it deal gracefully with acme not running, you could probab= ly have git call it automatically whenever you check out a different revisi= on. Caveats: this does nothing for directory windows, doesn't help with= files that exist in one branch and not another, won't touch a dirty wi= ndow, and has been tested very little.

By the way,= Russ's Watch is here:=C2=A0https://github.com/rsc/rsc/tree/master/cmd/Watch

Micah


On Wed, Feb 15, 2017 at 12:32 PM, Paul = Lalonde <paul.a.lalonde@gmail.com> wrote:
Do you have a pointer to Russ's= Watch?=C2=A0 I quick dig shows I have poor Google-fu.
Paul

O= n Wed, Feb 15, 2017 at 12:23 PM Bakul Shah <bakul@bitblocks.com> wrote:
May be use Russ'es Watch command?

> On Feb 15, 2017, at 5:05 AM, Paul Lalonde <paul.a.lalonde@gmail.com> wrote:
>
> I know I'm not the only acme user who uses Git extensively :-)
> Is there some way to tell if a file is changed on disk that is open in= an editor window?=C2=A0 I frequently change branches and I often find myse= lf editing stale versions.=C2=A0 I notice when comes time to Put, but that&= #39;s a bit late.
>
> Any tips to share?
>
> Paul



--001a1146f9b0d0443d0548985e4e-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bakul Shah Content-Type: multipart/alternative; boundary="Apple-Mail=_451ED993-A48F-4915-B2B1-01CB98B10B4B" Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Date: Wed, 15 Feb 2017 14:09:14 -0800 References: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: Message-Id: <357D1DAA-CC66-417F-BB78-354EAD66BE4C@bitblocks.com> Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b4016274-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail=_451ED993-A48F-4915-B2B1-01CB98B10B4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 go get 9fans.net/go/acme/Watch It watches the current dir and runs a given command if any file in this = dir changes. Actually think of Watch more as inspiration! You may be better off relying on git =E2=80=94 watch .git/HEAD (changes = when you switch branches) and watch what it is pointing to (changes when = there is a commit or pull etc.), figure out what changed, which acme = windows are relevant and update their body. There is still the issue of = what to do if a file that changed has been edited. Or the file has been = deleted or renamed. And there is a potential race =E2=80=94 you may be = editing a window when window body gets switched underneath! It may be = better to print commands to do all this and leave it upto the user. May be add a reload command that reads a window's tag and reload its = body from the opened file. > On Feb 15, 2017, at 11:32 AM, Paul Lalonde = wrote: >=20 > Do you have a pointer to Russ's Watch? I quick dig shows I have poor = Google-fu. > Paul >=20 > On Wed, Feb 15, 2017 at 12:23 PM Bakul Shah > wrote: > May be use Russ'es Watch command? >=20 > > On Feb 15, 2017, at 5:05 AM, Paul Lalonde > wrote: > > > > I know I'm not the only acme user who uses Git extensively :-) > > Is there some way to tell if a file is changed on disk that is open = in an editor window? I frequently change branches and I often find = myself editing stale versions. I notice when comes time to Put, but = that's a bit late. > > > > Any tips to share? > > > > Paul >=20 >=20 --Apple-Mail=_451ED993-A48F-4915-B2B1-01CB98B10B4B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

It watches the current dir and runs a = given command if any file in this dir changes. Actually think of Watch = more as inspiration!

You may be better off relying on git =E2=80=94 watch = .git/HEAD (changes when you switch branches) and watch what it is = pointing to (changes when there is a commit or pull etc.), figure out = what changed, which acme windows are relevant and update their body. = There is still the issue of what to do if a file that changed has been = edited. Or the file has been deleted or renamed. And there is a = potential race =E2=80=94 you may be editing a window when window body = gets switched underneath! It may be better to print commands to do all = this and leave it upto the user.

May be add a reload command that reads = a window's tag and reload its body from the opened file.

On Feb 15, 2017, at 11:32 AM, = Paul Lalonde <paul.a.lalonde@gmail.com> wrote:

Do you have a pointer to Russ's Watch?  I quick dig = shows I have poor Google-fu.
Paul

On = Wed, Feb 15, 2017 at 12:23 PM Bakul Shah <bakul@bitblocks.com>= wrote:
May be use Russ'es Watch command?

> On Feb 15, 2017, at 5:05 AM, Paul Lalonde <paul.a.lalonde@gmail.com> wrote:
>
> I know I'm not the only acme user who uses Git extensively :-)
> Is there some way to tell if a file is changed on disk that is open = in an editor window?  I frequently change branches and I often find = myself editing stale versions.  I notice when comes time to Put, = but that's a bit late.
>
> Any tips to share?
>
> Paul



= --Apple-Mail=_451ED993-A48F-4915-B2B1-01CB98B10B4B-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 15 Feb 2017 18:01:50 -0800 Message-ID: <33fbfcba-49eb-4797-92d1-c3c0c1fc1c11@email.android.com> In-Reply-To: From: Erik Quanstrom To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b4077326-ead9-11e9-9d60-3106f5b1d025 PGRpdiBkaXI9J2F1dG8nPnRyeSB3cml0aW5nIHRoZSBmaWxlPyAmbmJzcDvwn5iAPC9kaXY+PGRp diBjbGFzcz0iZ21haWxfZXh0cmEiPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRmVi IDE1LCAyMDE3IDU6MDUgQU0sIFBhdWwgTGFsb25kZSAmbHQ7cGF1bC5hLmxhbG9uZGVAZ21haWwu Y29tJmd0OyB3cm90ZTo8YnIgdHlwZT0iYXR0cmlidXRpb24iPjxibG9ja3F1b3RlIGNsYXNzPSJx dW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlk O3BhZGRpbmctbGVmdDoxZXgiPjxkaXYgZGlyPSJsdHIiPkkga25vdyBJJiMzOTttIG5vdCB0aGUg b25seSBhY21lIHVzZXIgd2hvIHVzZXMgR2l0IGV4dGVuc2l2ZWx5IDotKTxkaXY+SXMgdGhlcmUg c29tZSB3YXkgdG8gdGVsbCBpZiBhIGZpbGUgaXMgY2hhbmdlZCBvbiBkaXNrIHRoYXQgaXMgb3Bl biBpbiBhbiBlZGl0b3Igd2luZG93P8KgIEkgZnJlcXVlbnRseSBjaGFuZ2UgYnJhbmNoZXMgYW5k IEkgb2Z0ZW4gZmluZCBteXNlbGYgZWRpdGluZyBzdGFsZSB2ZXJzaW9ucy7CoCBJIG5vdGljZSB3 aGVuIGNvbWVzIHRpbWUgdG8gUHV0LCBidXQgdGhhdCYjMzk7cyBhIGJpdCBsYXRlLjwvZGl2Pjxk aXY+PGJyIC8+PC9kaXY+PGRpdj5BbnkgdGlwcyB0byBzaGFyZT/CoDwvZGl2PjxkaXY+PGJyIC8+ PC9kaXY+PGRpdj5QYXVsPC9kaXY+PC9kaXY+DQoNCjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9k aXY+ From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: <33fbfcba-49eb-4797-92d1-c3c0c1fc1c11@email.android.com> In-Reply-To: <33fbfcba-49eb-4797-92d1-c3c0c1fc1c11@email.android.com> From: Paul Lalonde Date: Thu, 16 Feb 2017 13:05:08 +0000 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a1145e71622c0930548a57359 Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b4129760-ead9-11e9-9d60-3106f5b1d025 --001a1145e71622c0930548a57359 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'll give Watch and a bit of scripting a shot. I couldn't find a git "HEAD changed" hook to tie to, so Watch is pretty much the right thing. Thanks! On Wed, Feb 15, 2017 at 9:04 PM Erik Quanstrom wrote: > try writing the file? =F0=9F=98=80 > > On Feb 15, 2017 5:05 AM, Paul Lalonde wrote: > > I know I'm not the only acme user who uses Git extensively :-) > Is there some way to tell if a file is changed on disk that is open in an > editor window? I frequently change branches and I often find myself > editing stale versions. I notice when comes time to Put, but that's a bi= t > late. > > Any tips to share? > > Paul > > > --001a1145e71622c0930548a57359 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'll give Watch and a bit of scripting a shot.=C2=A0 I= couldn't find a git "HEAD changed" hook to tie to, so Watch = is pretty much the right thing.

Thanks!

On Wed, Feb 15, 2017 at 9:04 PM Erik Quan= strom <quanstro@quanstro.net> wrote:

On Feb 15, 2017 5:05 AM, Paul Lalonde <paul.a.lalonde@g= mail.com> wrote:
I know I'm not the only acme user who uses Git extensively = :-)
Is there some way to tell if a file is changed = on disk that is open in an editor window?=C2=A0 I frequently change branche= s and I often find myself editing stale versions.=C2=A0 I notice when comes= time to Put, but that's a bit late.

Any tips to share?=C2=A0=

Paul

--001a1145e71622c0930548a57359-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bakul Shah Content-Type: multipart/alternative; boundary=Apple-Mail-1CD37D83-A3EF-4BB7-80EE-6DB798C3EE68 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Date: Thu, 16 Feb 2017 07:33:54 -0800 Message-Id: References: <33fbfcba-49eb-4797-92d1-c3c0c1fc1c11@email.android.com> In-Reply-To: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] Acme and Git Topicbox-Message-UUID: b41c18f8-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail-1CD37D83-A3EF-4BB7-80EE-6DB798C3EE68 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable You can use a cross platform file system event notification package like fsn= otify/fsnotify or rjeczalik/notify, both on github. Instead of HEAD, may be j= ust watch .git/index and when it changes, do git ls-files and see what chang= ed. This will also catch local git add etc. though this probably doesn't mat= ter. > On Feb 16, 2017, at 5:05 AM, Paul Lalonde wrote= : >=20 > I'll give Watch and a bit of scripting a shot. I couldn't find a git "HEA= D changed" hook to tie to, so Watch is pretty much the right thing. >=20 > Thanks! >=20 >> On Wed, Feb 15, 2017 at 9:04 PM Erik Quanstrom wr= ote: >> try writing the file? =F0=9F=98=80 >>=20 >> On Feb 15, 2017 5:05 AM, Paul Lalonde wrote: >> I know I'm not the only acme user who uses Git extensively :-) >> Is there some way to tell if a file is changed on disk that is open in an= editor window? I frequently change branches and I often find myself editin= g stale versions. I notice when comes time to Put, but that's a bit late. >>=20 >> Any tips to share?=20 >>=20 >> Paul >>=20 --Apple-Mail-1CD37D83-A3EF-4BB7-80EE-6DB798C3EE68 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
You can use a cross platfor= m file system event notification package like fsnotify/fsnotify or rjeczalik/notif= y, both on github. Instead of HEAD, may be just watch .git/index and when it= changes, do git ls-files and see what changed. This will also catch local g= it add etc. though this probably doesn't matter.

On Feb 16, 20= 17, at 5:05 AM, Paul Lalonde <paul.a.lalonde@gmail.com> wrote:

I'll give Watch and a bit of scripting a shot.&nbs= p; I couldn't find a git "HEAD changed" hook to tie to, so Watch is pretty m= uch the right thing.

Thanks!

On Wed, Feb 15, 2017 at 9:04 PM Erik Quanstrom <quanstro@quanstro.net> wrote:
=
tr= y writing the file?  =F0=9F=98=80

On Feb 15,= 2017 5:05 AM, Paul Lalonde <paul.a.lalonde@gmail.com> wrote:=
I know I'm not= the only acme user who uses Git extensively :-)
Is t= here some way to tell if a file is changed on disk that is open in an editor= window?  I frequently change branches and I often find myself editing s= tale versions.  I notice when comes time to Put, but that's a bit late.=

Any tips to share? 

Paul

= --Apple-Mail-1CD37D83-A3EF-4BB7-80EE-6DB798C3EE68--