[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Bug or feature ? Edited project-generated targets are saved
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2024-02-08 21:39:35
Message-ID: 1976960.usQuhbGJ8B () unknownc4d9870202f1
[Download RAW message or body]

Hi,

On Mittwoch, 7. Februar 2024 23:02:36 CET Alexander Neundorf wrote:
> Hi,
> 
> the project plugin can generated targets for the build plugin.
> The entries in the build plugin are editable by the user.
> This may be useful, e.g. to change the "-j8" flag for make, or maybe add
> some other option.
> 
> But, such a change is also saved. And from that moment on, it seems kate
> always loads the saved, edited targets, no matter whether the project
> plugins generates different targets now (e.g. because the cmake files for
> that project have been changed).
> 
> To me this feels like a bug.
> I think it may be useful that the build commands are editable, it provides
> some flexibility. If they were not editable at all, this would be also Ok
> for me.
> But that my edits are saved and then override the "new" targets from the
> project plugin feels like a bug, the targets are then not up to date anymore
> with the current state of the actual project.

Ok, I found it, it's a feature:
https://invent.kde.org/utilities/kate/-/commit/
678e8a3bd98d5110da21091aefef00aa9cf3097f[1]

TBH, this feels like a bug.
I add a new target in cmake, and it doesn't appear in the build plugin.
I remove a target, it's still there.
There is no indication that this was read from a file, and that the input from the project 
plugin is ignored now.

I understand the motivation: the user changes something, so this should be kept.
Nevertheless, how about removing this questionable feature ?
This would make the code a bit simpler.

Or, keep it, but instead of storing the full override, just store what has been changed ? E.g. 
"target foo moved 2 rows up" or "command target for target bar edited" etc. and then 
apply those modifcation to what comes from the project plugin. Sounds like it would result 
in relatively complicated code.

Or, maybe store a hash of the targets as they come from the project plugin, store the hash 
together with the override, and only use the override if the targets from the project plugin 
still have the same hash ?

Something else ?

Alex


--------
[1] https://invent.kde.org/utilities/kate/-/commit/
678e8a3bd98d5110da21091aefef00aa9cf3097f

[Attachment #3 (unknown)]

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Hi,</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">On \
Mittwoch, 7. Februar 2024 23:02:36 CET Alexander Neundorf wrote:</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; Hi,</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; </p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; the project \
plugin can generated targets for the build plugin.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; The entries \
in the build plugin are editable by the user.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; This may be \
useful, e.g. to change the &quot;-j8&quot; flag for make, or maybe add</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; some other \
option.</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; \
</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; But, \
such a change is also saved. And from that moment on, it seems kate</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; always loads \
the saved, edited targets, no matter whether the project</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; plugins \
generates different targets now (e.g. because the cmake files for</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; that project \
have been changed).</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; </p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; To me this \
feels like a bug.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; I think it \
may be useful that the build commands are editable, it provides</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; some \
flexibility. If they were not editable at all, this would be also Ok</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; for me.</p> \
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; But that \
my edits are saved and then override the &quot;new&quot; targets from the</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; project \
plugin feels like a bug, the targets are then not up to date anymore</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">&gt; with the \
current state of the actual project.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Ok, I found it, \
it's a feature:</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"><a \
href="https://invent.kde.org/utilities/kate/-/commit/678e8a3bd98d5110da21091aefef00aa9 \
cf3097f">https://invent.kde.org/utilities/kate/-/commit/678e8a3bd98d5110da21091aefef00aa9cf3097f</a></p>
 <br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">TBH, \
this feels like a bug.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I add a new target \
in cmake, and it doesn't appear in the build plugin.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I remove a target, \
it's still there.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">There is no \
indication that this was read from a file, and that the input from the project plugin \
is ignored now.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I understand the \
motivation: the user changes something, so this should be kept.</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Nevertheless, how \
about removing this questionable feature ?</p> <p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">This would make \
the code a bit simpler.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Or, keep it, but \
instead of storing the full override, just store what has been changed ? E.g. \
&quot;target foo moved 2 rows up&quot; or &quot;command target for target bar \
edited&quot; etc. and then apply those modifcation to what comes from the project \
plugin. Sounds like it would result in relatively complicated code.</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Or, maybe store a \
hash of the targets as they come from the project plugin, store the hash together \
with the override, and only use the override if the targets from the project plugin \
still have the same hash ?</p> <br /><p \
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Something else \
?</p> <br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Alex</p>
 <br /></body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic