[Geany-devel] Stub project files for sharing
Nick Treleaven
nick.treleaven at xxxxx
Fri Nov 4 15:05:53 UTC 2011
On 03/11/2011 23:46, Lex Trotman wrote:
> On 4 November 2011 01:45, Nick Treleaven<nick.treleaven at btinternet.com> wrote:
>> My solution:
>>
>> A foo.geanystub project file goes in version control. It is never written
>> to. It should be prepared by manually editing a copy of a local project
>> file.
>>
>> On opening a foo.geanystub file, Geany creates foo.geany in the same path
>> then opens it.
>>
>> When opening foo.geany, if foo.geanystub exists, then override settings with
>> the stub contents.
>>
>> This way the VC file can decide which settings are not overridable.
>>
>> My solution shouldn't require much code to implement. I've only noted the
>> bare bones of it, there are some things that could be added to make it
>> better. Even with these I think it's simpler and neater.
>
> Hi Nick,
>
> I like simple, why don't we just add a setting to projects, say "based
> on", that allows a project file to import settings from another. Then
> the user project is "based on" the one in the VCS working directory.
> Simple and explicit and can adapt to any locations, on opening the
> project, settings are taken from the "based on" file if it exists and
> the setting exists unless it is overridden by the user project file.
> Based on is not recursive.
I see that 'based on' could be useful for making subprojects, and could
be added to my proposal.
> Note that this requires that projects not write a setting unless it is
> set by the user, that is not always the case now IIRC and is an added
> complication.
I don't think this is a good requirement. Plugins already can write
settings so I think it will be hard to enforce. But also rewriting
existing code can be avoided and would be better.
Rewriting code is what made me think supporting VCS project files was
not worth it, but if that can be avoided and the new code is fairly
minimal I think it's acceptable.
> This way the VCS file is still a project file and can be edited using
> the Geany UI, albeit at the cost of writing session crap into it, but
> as that is overridden by the user session crap on next open so it
> doesn't matter.
I know that using Geany to create the VCS project would be easier, but
stub creation is something that needs to be done rarely. I don't think
it's worth rewriting existing code to support something that gets used
rarely - use of projects depending on a stub is something that might be
a popular feature (I realized eventually ;-)), but the actual stub
creation and modifications is probably rare.
I think having a separate filetype for the VCS file is good design
because it shouldn't be written to, so it is different from a normal
geany project file.
More information about the Devel
mailing list