Skip to main content
Topic: Avoid saving ActiveStaff, CaretIndex and CaretPos in nwctxt (Read 588 times) previous topic - next topic

Avoid saving ActiveStaff, CaretIndex and CaretPos in nwctxt

Is there any chance that the position of the cursor/caret in the editor could be excluded from the nwctxt file?

Background: In my choir we use git (distrbuted version control system, popularized by github among others) to store our digital music and pdfs. When multiple people fix errors in the nwc-files, we sometimes run into conflicts, because each user will (unknowingly) modify the line in the file that stores the position of the caret. Git is good at resolving simultaneous changes as long as they occur on different lines, but when two users edits the same line, there will be a merge conflict that needs to be resolved by hand.

I'm a developer by trade and resolving merge conflicts is part of my job description, but far from everyone in my choir is comfortable with 3 way diff tools... Avoiding unnecessary conflicts would reduce the number of times they need to ask me for help :)

/Jonas

Re: Avoid saving ActiveStaff, CaretIndex and CaretPos in nwctxt

Reply #1
Hi Jonas,
These things also occur in the NWC file.  For completely different reasons sometimes I'm fine with it and sometimes it's an irritation.  I forget when this was introduced, and a quick look at the change information available on the main NWC site doesn't seem to say, but I'm sure it wasn't always like this.

I think I would like to see your proposal changed just slightly.  Rather than limit it to nwctxt files, make it so that there is an option whether or not to save these positional data at all.

If you want to add complexity, have 2 toggles: one for NWC files, and one for nwctxt files.

As a workaround maybe try to educate your other users to remember to move the cursor to the start of the top staff and press <0> (zero) before saving.  This will position the cursor at staff pos 0, current duration 1/4, standard notehead etc. at the start of the top staff.  If everyone can remember to do this then the positional data will always be the same.  Not a solution I know, and it depends on users being able to remember to do it...  Why do I feel like it'd be the same as trying to push a piece of string uphill?  :))
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: Avoid saving ActiveStaff, CaretIndex and CaretPos in nwctxt

Reply #2
Well, Lawrie, as you can see here it's at least 17 years old...  :D

Re: Avoid saving ActiveStaff, CaretIndex and CaretPos in nwctxt

Reply #3
Yes, but I've been using NWC for longer than that ;)

I was fortunate enough to be part of the V2.0 beta test team when we communicated with each other on a newsgroup.
Can't remember for sure but I think I started with NWC in 2001 or 2002...  That was V1.x - I think 1.75... though it may have been 1.70.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: Avoid saving ActiveStaff, CaretIndex and CaretPos in nwctxt

Reply #4
I tried to create a githook that would strip this line out of nwctxt-files before adding them to the git repo. I think I'm close, but sometimes the git operation will fail for no apparent reason when I have my githook active. need some more debugging.