On Wed, Apr 13, 2016 at 2:27 PM, John Van Ostrand <[email protected]> wrote:
>
> I want to get rid of an entire dive computer's logs. It's a duplicate of the
> same computer because of changes I made to LDC and after I imported I failed
> to realized I had re-imported dives so there's no reason to keep both. I'm
> going to try a couple dumb things to fix this. An XML editor looks like it
> will work. I love that the data file is in XML, even if I have a 58MB file,
> which is also why I'm doing this.

So an XML editor will certainly work, but _if_ you are comfortable
using git for other reasons (ie maybe you use git for development),
then the git format is actually *really* convenient.

In particular, it allows you to use regular filesystem interfaces to
do things like this.

For example, here's a real session I did to emulate the editing
behavior you'd want, just as an example:

   # Clone my cloud cache copy to a temporary git location. Your
   # cloud hash will obviously be something different

   git clone .subsurface/cloudstorage/96768970dcbc1b59 test-repo
   cd test-repo/

   # Find every dive computer that is not the *only* dive computer
   # for a dive (such a dive computer file would be named just plain
   # 'Divecomputer' without the number suffix), and remove it if it
   # has the model name "EON Steel" in it.

   find . -name 'Divecomputer-0*' |
         xargs grep -l "model.*EON.Steel" |
         xargs rm

   # Commit the result

   git commit -a -m "Remove all EON Steel when another dive computer exists"

   # check the end result in subsurface. Your git branch name will
   # obviously be something different

   subsurface ./[[email protected]]

   # throw that temporary git tree away, because the EON Steel is
   # actually my favorite dive computer, so I wouldn't actually want
   # to do this for real

   cd
   rm -rf test-repo

so _if_ you're a command line person, and _if_ you are comfy with git,
the git format actually ends up being very powerful. It's much more
powerful for these kinds of things than the XML one.

                    Linus
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to