Mafia SVN for Scripts?

fronobulax

Developer
Staff member
People connecting through proxies can try the latest revision, I have no idea if that will help.

Also, putting stuff in ccs/ is permissible now.



It's not technically impossible to let users move things around. Much as validate script.ash will use KoLMafiaCLI.findScriptFile( final String filename ) to find which .ash file you're talking about, svn could do the same thing when it's resolving the "rebase" of a file based in scripts/. This has a number of unintended consequences, since that rebase behavior also applies to delete operations.

I'm also not averse to telling people that they're being unreasonable in asking for legacy behavior to be maintained and telling them Sorry But No. When windows update (or apt-get, whatever) installs new drivers, you can't arbitrarily move those files around and expect everything to work. I don't see why you should here.

I'm not proposing moving anything around. I am proposing letting me continue to do things the way I do now :)

Regardless of whether my point of view prevails or not, I do think there is an issue with trying to characterize scripts by how they are invoked and assuming that there is either only one way to do things or that, in the presence of multiple ways, one takes precedence. For example there are several ash files that are essentially a collection of things that are expected to be called by other scripts but also include a main that does one useful thing. Such a script needs to be in the main directory to be executed by the person who wants do do that one useful thing, right?

As a development philosophy I am uncomfortable with requiring users to start or cease using sub-directories for scripts in order to take advantage of the SVN capabilities. We should probably keep discussing.
 

Winterbay

Active member
Then I would like to make a request for zarqon, Winterbay and anyone else who writes functions like BatBrain, zlib, newLife and WHAM which are designed to be consulted by mafia or other scripts, without being called directly by the user from the script menu.

Please, please, please! How about we put all those scripts in the "/scripts/consult scripts" directory? I'll also put newLife and other hook scripts of my own into the "consult scripts" subdirectory so that they won't clutter up people's script menu. Would my fellow scripters hate this as a standard? Surely I'm not the only one who likes to put them in a subdirectory, but unless we can agree on the subdirectory's name we'll make a lot of clutter.

If you don't like the name consult scripts, hopefully we can agree on another name for a directory to put these consulting and mafia hook scripts into.

This is the thing I like the least about script smoving to SVN, losing control over my folder structure. I tend to sort my scripts in subfolders after the script author (so all of zarqon's scripts are in /scripts/zarqon and so on). This is also why I've never seen the point of the MRU-list since that turns my carefully set up folder structure back into the list it was before only shorter...
Currently my SVN is set up according to this principle as well so /scripts/winterbay/WHAM.ash. I'm not opposed to having a common way of working so to say, but I think it is possible that we have way too many ways of working for it to be possible to come to one solution.

So who would like an SVN repo?

I've set up a sourceforge-one since I already had an account there anyway due to bumcheekascend, but I'd not be opposed to using kolmafia.us instead of that.
 

roippi

Developer
I'm still not particularly convinced. If the general objection with losing control of directories is "it messes up my Scripts menu" then let's fix the Scripts menu rather than fixing the symptom six degrees abstracted from the problem. I don't know why people always fixate on the thing that is not the actual problem.

Such a script needs to be in the main directory to be executed by the person who wants do do that one useful thing, right?

Are you under that impression? Because no.
 

Winterbay

Active member
I'm still not particularly convinced. If the general objection with losing control of directories is "it messes up my Scripts menu" then let's fix the Scripts menu rather than fixing the symptom six degrees abstracted from the problem. I don't know why people always fixate on the thing that is not the actual problem.

My main problem with the scripts menu is that if you have many scripts it gets so long it's unwieldy so I trim it down with sub-folders. Since I use the scripts-menu to launch the script-editor as well a MRU-list does not help since most of the scripts I want to edit/look at are scripts like batbrain, zlib and similar that are not directly called and thus would not show up in the list. With no control over where scripts end up I fear that the list will once again get really long and unwieldy.
 

roippi

Developer
My main problem with the scripts menu is that if you have many scripts it gets so long it's unwieldy so I trim it down with sub-folders.

Yes, okay. Open up your firefox menu (or whatever browser you're in) and go to bookmarks. See how you can arrange things in subfolders there.

Now, are you under the impression that those bookmarks are laid out exactly in files and folders like that somewhere on the file system? More to the point, do you even care? No, because the user interface is completely abstracted from the physical data storage layer.
 

heeheehee

Developer
Staff member
people said:
stuff about putting scripts in the scriptMenu as desired
Wouldn't symlinks do the trick, without having to move scripts around?

I tend to sort my scripts in subfolders after the script author (so all of zarqon's scripts are in /scripts/zarqon and so on). This is also why I've never seen the point of the MRU-list since that turns my carefully set up folder structure back into the list it was before only shorter...

I think what can be currently done to work around this is to use "svn checkout $URL/scripts scripts/$PREFIX", assuming that svn commands are passed directly to a shell executing in $MAFIA_ROOT/svn/$SOME_PREFIX

You'd then need to check out anything in relay/, images/, data/, etc. manually, in that case, though. (i.e. use "svn co $URL/relay relay" and so forth)

I haven't played around with this new feature yet, although it looks... interesting.
 

Bale

Minion
My problem with the script menu is a lot like Winterbay's problem. I simply organize my subfolders diferently. Like him I can't make good use of the MRU list solution.

Open up your firefox menu (or whatever browser you're in) and go to bookmarks. See how you can arrange things in subfolders there.

Now, are you under the impression that those bookmarks are laid out exactly in files and folders like that somewhere on the file system? More to the point, do you even care? No, because the user interface is completely abstracted from the physical data storage layer.

I would totally like that solution! How hard would it be to implement that kind of script menu?
 

roippi

Developer
I would totally like that solution! How hard would it be to implement that kind of script menu?

Difficult! But not overwhelmingly so. I'll tell you right now it won't be slick like FF's with drag-and-drop, right click context insertions, etc. Unless someone can find a slick 3rd party JMenu extension that does the legwork.

If I'm homebrewing it, I'd just handle configuring it in a tab of the (eventual) script manager.
 

Bale

Minion
I don't care if it is slick. I just want it to work and I'll be happy.

You could make it a tab in preferences for now since for me it is a higher priority than a GUI for the SVN. This is a prerequisite for me (and perhaps Winterbay) befire BatBrain, etc all start updating with svn.
 
Where do I define a project's name? Does the end user specify that when they checkout? Or is it up to the script author?
Similarly, since the topic of file structure is up, does one have to specify the directory when using "import"? What if there are multiple scripts with the same name in different directories (not a great structure, sure, but likely to happen if people don't delete old files when the new ones change location)?
 

Winterbay

Active member
Yes, okay. Open up your firefox menu (or whatever browser you're in) and go to bookmarks. See how you can arrange things in subfolders there.

Now, are you under the impression that those bookmarks are laid out exactly in files and folders like that somewhere on the file system? More to the point, do you even care? No, because the user interface is completely abstracted from the physical data storage layer.

That would completely alleviate the need to modify the underlying folder structure :)

Also, why is my fsvn-folder (for WHAM and similar) named f3a93235-48a6-433b-87e5-419ffddcf400 while all other projects I've checked out have normal names according to their project names?
 

roippi

Developer
Where do I define a project's name? Does the end user specify that when they checkout? Or is it up to the script author?

Project name is regex'ed out of the svn URL.


Similarly, since the topic of file structure is up, does one have to specify the directory when using "import"?

No.

What if there are multiple scripts with the same name in different directories (not a great structure, sure, but likely to happen if people don't delete old files when the new ones change location)?

I don't think svn behaves like you think it does when you move local files, for one. But to answer your question, the same thing that's always happened. It uses the first one that it finds.

It's in my opinion a bug that we allow a name to be defined twice in the same namespace. I would prefer that we throw a runtime exception there.
 

roippi

Developer
Also, why is my fsvn-folder (for WHAM and similar) named f3a93235-48a6-433b-87e5-419ffddcf400 while all other projects I've checked out have normal names according to their project names?

If your svn URL does not match the sourceforge naming schema, the fallback is to use the UUID of the svn repo. This came up earlier in the thread.
 
Top