[PATCH] Don't mark divelist changed for automated merges after all

Linus Torvalds torvalds at linux-foundation.org
Thu Jan 24 19:35:03 PST 2013


From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Thu, 24 Jan 2013 19:28:56 -0800
Subject: [PATCH] Don't mark divelist changed for automated merges after all

The intention was good, and this was added in commit 4982389ca762 ("Fix
setting of the dive_table.preexisting logic"), but it turns out to not
be that great idea after all.

So the thinking is that merging two dives clearly changes the dive list,
and it really does.  At the same time, because it's an automated merge,
if you re-read the old XML file, you'll get it done again, so saving the
changes doesn't really *matter*.

And it turns out to be somewhat annoying with test dives: we have

 - dives/test23.xml:
    <dive number='23' tripflag='INTRIP' date='2011-12-02' time='6:00:00' duration='30:00 min'>
 - dives/test25.xml:
    <dive number='26' date='2011-12-02' time='6:00:00' duration='30:00 min'>

that merge automatically if you run subsurface on all the test dives
together.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

This was well-intentioned and conceptually right, it's just not worth it.

Of course, the fact that the test-cases triggered the automatic merging is 
interesting, but it really _is_ true that we might as well not save for 
changes like this that we do automatically. After all, even though we 
change the dive state, if we exit and reload it, we'll end up with the 
same thing, so the saving doesn't really matter.

 main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/main.c b/main.c
index b471e5f9d588..44e814a19c54 100644
--- a/main.c
+++ b/main.c
@@ -184,7 +184,6 @@ void report_dives(gboolean is_imported, gboolean prefer_imported)
 		add_single_dive(i, merged);
 		delete_single_dive(i+1);
 		delete_single_dive(i+1);
-		mark_divelist_changed(TRUE);
 	}
 	/* make sure no dives are still marked as downloaded */
 	for (i = 1; i < dive_table.nr; i++)
-- 
1.8.1.1.271.g02f55e6



More information about the subsurface mailing list