This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | [launchers] Launchers properties are not VCS friendly | ||
---|---|---|---|
Product: | cnd | Reporter: | Vladimir Voskresensky <vv159170> |
Component: | Project | Assignee: | Alexander Simon <alexvsimon> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 258806 |
Description
Vladimir Voskresensky
2016-04-14 23:08:06 UTC
Unfortunately launcher list contains ordered list of public and private launchers. IDE make the best to preserve launchers ID in the public list. IDE changed launchers only first time (to normalize numbering and content). Next editing should not change public file content if number and order public launchers is not changed. By the way the launcher file structure is not well designed to avoid a big difference with small changes. The following structure would minimize difference: [common] env.x=y rundir=/home [launcher=1] displayName=simple echo runCommand=echo Hi [launcer=2] displayName=directory runCommand=ls -la Apparently nobody do not think about VCS when launchers were introduced. better [launcher1] vs. [launcher=1] (In reply to Alexander Simon from comment #1) > Unfortunately launcher list contains ordered list of public and private > launchers. IDE make the best to preserve launchers ID in the public list. > IDE changed launchers only first time (to normalize numbering and content). > Next editing should not change public file content if number and order > public launchers is not changed. I do zero reordering or add/remove/copy activity. I only change property of existing launcher, so no numbers are changed. Please, preserve them as is (In reply to Vladimir Voskresensky from comment #4) > (In reply to Alexander Simon from comment #1) > > Unfortunately launcher list contains ordered list of public and private > > launchers. IDE make the best to preserve launchers ID in the public list. > > IDE changed launchers only first time (to normalize numbering and content). > > Next editing should not change public file content if number and order > > public launchers is not changed. > I do zero reordering or add/remove/copy activity. > I only change property of existing launcher, so no numbers are changed. > Please, preserve them as is As I said the initial reformatting will be done in any case. Please provide steps to reproduce the bug beside initial reformatting. The current grammar to define launchers are not VCS friendly. It's easy to see when change order of launchers and file completely changed + comments are lost. The new proposal is based on Alex's https://netbeans.org/bugzilla/show_bug.cgi?id=258843#c2 We should support loading old format, but when write we should use the new one which also persists comments: [common] env.x=y rundir=/home [launcher] position=10 displayName=simple echo runCommand=echo Hi #comments are attached #to the next non comment line [launcer] postion=20 displayName=directory #comment attached to the next property runCommand=ls -la (In reply to Vladimir Voskresensky from comment #6) > The current grammar to define launchers are not VCS friendly. It's easy to > see when change order of launchers and file completely changed + comments > are lost. > > The new proposal is based on Alex's > https://netbeans.org/bugzilla/show_bug.cgi?id=258843#c2 > > We should support loading old format, but when write we should use the new > one which also persists comments: > > [common] > env.x=y > rundir=/home > > [launcher] > position=10 > displayName=simple echo > runCommand=echo Hi > > #comments are attached > #to the next non comment line > [launcer] > postion=20 > displayName=directory > #comment attached to the next property > runCommand=ls -la Sections in property file should have different names. Please, fix section names (In reply to Alexander Simon from comment #7) > Sections in property file should have different names. Please, explain, why? (In reply to Vladimir Voskresensky from comment #8) > (In reply to Alexander Simon from comment #7) > > Sections in property file should have different names. > Please, explain, why? Your proposal is very different from standard properties/config files are used in real applications. It is not intuitive understandable that sections with same name are different. Compare your proposal with git config file: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/git/git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master I'm ok to have current launcher with Index as the section name, so [launcherNNNN] where NNNN is an integer number is OK from your POV? Then position attribute is not needed (In reply to Vladimir Voskresensky from comment #10) > I'm ok to have current launcher with Index as the section name, so > [launcherNNNN] > where NNNN is an integer number is OK from your POV? I'd prefer to avoid number (ordering) at all: [launcher "My Launcher"] Menu is created as sorted list (by name) public and private launchers. There is no default launcher name (currently as missing name is used command). (In reply to Vladimir Voskresensky from comment #6) > It's easy to > see when change order of launchers and file completely changed + comments > are lost. Launchers UI is not editor that keep all user additional comments. It supports predefined set of properties in property file and do not keep other extra stuff. And do not support user ordering of properties. As the user of launchers I can confirm that ability to reorder and keep of comments is the "request" for this feature to be comfortably usable (In reply to Vladimir Voskresensky from comment #14) > As the user of launchers I can confirm that ability to reorder and keep of > comments is the "request" for this feature to be comfortably usable Sorry, I do not understand where you see comments in launchers UI dialogue? Are you trying simultaneously work with UI and edit property file? What is your real use case? This is true. I comment and edit launchers in property file, because now it is simpler and allow me to keep in comments some previous states. I expected we were trying to make usable UI for that. (In reply to Vladimir Voskresensky from comment (In reply to Vladimir Voskresensky from comment #16) > This is true. > I comment and edit launchers in property file, because now it is simpler and > allow me to keep in comments some previous states. > I expected we were trying to make usable UI for that. As I understand you need a several previous command states? I can suggest a "Hide or Disable" launcher flag. So workflow is: - you going to modify command and want to keep a current command state. - create copy of a launcher, set "Disable" flag in a copied - modify the launcher. Change set: http://hg.netbeans.org/cnd-main/rev/656aec97f47c - introduced new launcher attribute "hide" which allows to hide launcher in pop-up menu. - separate modification flag for private and public meta data. - more accurate count new launcher id in Up/Down operations. Could you, please, write empty line between launcher's sections? Now all lines are adjusted. #Header Comment common.symbolFiles= common.env.LD_LIBRARY_PAPH launcher1000.displayName= launcher1000.runCommand= launcher2000.displayName= launcher2000.runCommand= Expected: #Header Comment common.symbolFiles= common.env.LD_LIBRARY_PAPH= launcher1000.displayName= launcher1000.runCommand= launcher2000.displayName= launcher2000.runCommand= and don't forget empty line after the last launcher to prevent VCS warning: <no empty line...> I think, it's done http://hg.netbeans.org/cnd-main/rev/7cc1c3f724c3 Integrated into 'main-silver', will be available in build *201604251813* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/656aec97f47c User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #258843 [launchers] Launchers properties are not VCS friendly |