Hi Tomas, Thank you, again!
I'd actually gone off in a slightly different direction, i.e. I started to think about extending a TextMate bundle to handle this. Recently I added a menu option to the TextMate Julia prototype bundle (I think from Stefan) to source a .jl file into the active Terminal. Using selection I kept on deleting the selection in the editor by forgetting to force the keyboard focus to the Julia Terminal first. And even after I had fixed that, I found using selections disrupted my command history in the Julia Terminal. Contemplating your suggestion and possible additions to the TextMate bundle brought back many of the discussions I had with Simon Urbanek while I worked on sections of R.app. Stuff like, where does functionality really belong (Julia console, editor, etc.), how can we prevent too many different scripting languages (shell, Ruby, Julia, Perl, Awk, Sed, Apple/Osa-script,...), what is a safe working environment (e.g. in the early days of porting R.app from Carbon to Cocoa is was not too hard to crash R and modifications in files open in the built-in editor would be lost) and maybe above all keep the surface area of things one needs to know as small as possible (I love Julia and the new REPL features, but I just yesterday found out how to use ^R/^S recursively). Will think a bit more about your warning before making a decision! It is a pity there isn't yet a 'script' menu item in the Terminal app. Of course, like TextMate, an Apple-only solution. Regards, Rob J. Goedman goed...@icloud.com On Apr 21, 2014, at 4:49 PM, Tomas Lycken <tomas.lyc...@gmail.com> wrote: > You might be able to get the best of both worlds, by creating a couple of > scripts that switch the git remotes for you. Then you can be in "default > mode" most of the time, but when you want to run Pkg.publish() you first > switch the remotes of METADATA, and then you switch back when you're done. > The scripts could also run some git commands to make sure that your own > METADATA on github is up to date before you start pushing. Since you can run > shell scripts from the Julia REPL (switch to shell mode by typing a > semicolon) you might be able to streamline this to basically three > incantations: > > 1: Type ; to get into shell mode, and execute the script that switches to > your remote (and updates it) > 2: Pkg.publish(), which now pushes to your own METADATA on github, making it > a one-click operation on github.com to create a PR > 3. Type ; to get into shell mode again, and execute the script that switches > the remotes back to default mode (so Pkg.update() works as usual afterwards) > > If you go this way, be careful with paths: the git commands for updating > remotes in METADATA need to be run with METADATA as working dir, but you > might not want to change your working dir in the Julia REPL session. This can > all be handled within the shellscript without much problem, so it's not > really a problem, just something that's easy to forget about =) > > // T > > On Tuesday, April 22, 2014 12:27:38 AM UTC+2, Rob J Goedman wrote: > Thanks Tomas, I'll keep your suggestions handy and see how often I need this. > Pkg.update() I use very frequently, so it is definitely a trade-off. > > Regards, > Rob J. Goedman > goe...@icloud.com > > > > > On Apr 21, 2014, at 2:25 PM, Tomas Lycken <tomas....@gmail.com> wrote: > >> ...but I should add that if you are a package maintainer, you should of >> course file an isse with METADATA and ask for write access =) >> >> On Monday, April 21, 2014 11:24:48 PM UTC+2, Tomas Lycken wrote: >> It's possible that you could simplify that workflow, at least if you do it >> often, by doing the following: >> >> 1) Go into your ~/.julia/v0.3/METADATA repo >> 2) Remove the original remote pointing to JuliaLang/METADATA >> 3) Add your own fork on Github, and call it "origin" >> 4) Re-add a reference to JuliaLang/METADATA, but call it something else >> ("julialang", or whatever) >> >> Now when you do Pkg.publish(), you'll end up publishing to your own fork, >> rather than to METADATA, but that should let you submit a PR easy enough. >> However, you'll break Pkg.update() instead - if I'm not mistaken, it will >> just pull updates from your own fork instead, which of course won't >> automatically update when someone else pushes to JuliaLang/METADATA. >> However, it should be simple enough to update your fork to the latest master >> manually, and then run Pkg.update(). >> >> Depending on what you do most often, one or the other might be a lesser >> hassle for your most common workflow. >> >> // Tomas >> >> On Monday, April 21, 2014 10:49:19 PM UTC+2, Rob J Goedman wrote: >> Figured it out, I believe I now have a proper pull request in place. >> >> My guess is that until Pkg.publish() works for folks without write access to >> METADATA (automatically creating a pull request), this is a bit cumbersome. >> >> What I did (more maybe for my own benefit :-( in a few weeks): >> >> 1) Forked JuliaLang/METADATA.jl to goedman/METADATA.jl >> 2) Cloned goedman/METADATA.jl to my machine >> 3) Manually copied over my updated package info ( from >> .julia/v0.3/METADATA/HyperDualNumbers to directory with the cloned >> goedman/METADATA.jl ) >> 4) Committed goedman/METADATA.jl to github >> 5) Created a pull request on base JuliaLang/METADATA.jl (from head >> goedman/METADATA. >> >> >> Rob J. Goedman >> goe...@icloud.com >> >> >> >> On Apr 21, 2014, at 10:12 AM, Robert J Goedman <goe...@icloud.com> wrote: >> >>> Hi, >>> >>> In trying to update the registered package HyperDualNumbers (from v0.1.1 to >>> v0.1.2, a few very minor changes to the README.md), I think I got myself in >>> a pickle. >>> >>> I tried to follow the relevant doc section. I don't think I have write >>> access to METADATA. Details on what I did are attached below. >>> >>> Maybe I should not have worked in the .julia/v0.3 directory? But if I were >>> to clone HyperDualNumbers and/or METADATA.jl, how would Pkg.tag() find that? >>> Once I get METADATA updated, to generate a pull request (initially Jiahao >>> was so kind to add the initial version of the package for me), should I use >>> the GitHub tool? >>> >>> Any help would be appreciated! >>> >>> Regards, >>> Rob J. Goedman >>> goe...@icloud.com >>> >>> ------------------------------------------------------------------- >>> >>> I updated the HyperDualNumbers package in the ~/.julia/v0.3 directory and >>> committed the changes to the git repository and ran >>> Pkg.tag("HyperDualNumbers"): >>> >>> julia> Pkg.tag("HyperDualNumbers") >>> INFO: Tagging HyperDualNumbers v0.1.2 >>> INFO: Committing METADATA for HyperDualNumbers >>> >>> robs-15inch-2:HyperDualNumbers rob$ cd ~/.julia/v0.3/HyperDualNumbers && >>> git tag >>> v0.1.0 >>> v0.1.2 >>> robs-15inch-2:HyperDualNumbers rob$ cd ~/.julia/v0.3/HyperDualNumbers && >>> git show --stat >>> commit d405891a0188a0a3e4cd59156775405b71e63aed >>> Author: Rob J. Goedman <goe...@mac.com> >>> Date: Mon Apr 21 09:07:30 2014 -0700 >>> >>> Update to tag v0.1.2 >>> >>> README.md | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> I was surprised v0.1.1 was not listed. And METADATA does not seem to have >>> been updated for HyperDualNumbers: >>> >>> robs-15inch-2:HyperDualNumbers rob$ cd ~/.julia/v0.3/METADATA && git show >>> commit 9ece76e2246e1166aa2d0a0c59ab13e9f9dd747b >>> Merge: 0daf52c cc00e5e >>> Author: Robert J. Ennis <r...@sdf.org> >>> Date: Mon Apr 21 17:01:45 2014 +0200 >>> >>> Merge pull request #779 from rennis250/metadata-v2 >>> >>> Tag SDL v0.1.2 >>> >>> julia> Pkg.available("HyperDualNumbers") >>> 2-element Array{VersionNumber,1}: >>> v"0.1.0" >>> v"0.1.1" >>> >>> I tried Pkg.publish() anyway and expected to get a rejection because I >>> don't have write permissions, but I think it did not even get to that point: >>> >>> julia> Pkg.update() >>> INFO: Updating METADATA... >>> INFO: INFO: INFO: INFO: INFO: INFO: Updating ApproxFun...INFO: Updating >>> HyperDualNumbers...Updating NumericalMath...Updating RevMode...Updating >>> Calculus2...Updating RmathDist...Updating PGM... >>> >>> INFO: Computing changes... >>> INFO: No packages to install, update or remove >>> >>> julia> Pkg.publish() >>> ERROR: METADATA is behind origin/metadata-v2 – run `Pkg.update()` before >>> publishing >>> in publish at pkg/entry.jl:308 >>> in anonymous at pkg/dir.jl:28 >>> in cd at file.jl:20 >>> in cd at pkg/dir.jl:28 >>> in publish at pkg.jl:57 >>> >>> >> >