pcb

removing lines creates unnecessary diffs in saved pcb

Bug #699590 reported by Ben Jackson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
New
Wishlist
Unassigned

Bug Description

When you delete a line, there some code like (from memory):

list[victim] = list[--nlist];

that swaps the last element in to the hole generated by deleting 'victim'. That's great for efficiency, but since the saved output uses the array order for output, deleting a line creates extra text diffs where lines move in the file without changing.

It would be nice if simple edits like that also produced the "obvious" simple diff of deleting the one line from the output file.

Other than that, PCB's file format plays very well with source control.

One possible solution: Assign a sequence number to every line on load (in load order). Then all new object creation increments the sequence number. On save, the output order is the sequence number order. The sequence numbers themselves don't have to be saved or user visible, they just make it possible to keep the order.

Another possible solution: Define a sort order based on some existing parameter. Eg elements by refdes lexigraphically, lines by position on the pcb, etc. That would keep most of the benefit, although the first use of the PCB that did this would reorder the entire file.

Revision history for this message
Ben Jackson (ben.jackson) wrote :

Speaking of unnecessary diffs, perhaps there should be a setting to strip off UI flags like selectedflag and foundflag (and much to my surprise, rubberendflag!) which end up in files.

Revision history for this message
DJ Delorie (djdelorie) wrote :

As a counterpoint, I rely on selectedflag being saved... I often select something, save the file, and use the flag to find it in emacs to hand-tweak it.

Revision history for this message
DJ Delorie (djdelorie) wrote :

moving to the feature request tracker as this isn't a bug per se.

Traumflug (mah-jump-ing)
Changed in geda-project:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.