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--