From 56b82e0ecf58dd1f2b7585425dbdebbbbe5668a4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 19 Jun 2015 11:45:24 -0700 Subject: Git storage: change time encoding in directory names We used to use [[yyyy-]mm-]nn-ddd-hh:mm:ss[~hex] in our git storage format for directory that contained dives. Problem with the is that on Windows the colon ':' is an illegal character in a filename. So libgit2 refuses to clone such a repository on Windows. So instead we now always write dive directories in git repositories as [[yyyy-]mm-]nn-ddd-hh=mm=ss[~hex] which replaces the ':' with an '='. Of course we load / parse both formats so that older formats still work. The next time they are written all the names change which causes rather huge commits, but that's the only way I see for cloud storage to work on Windows. Signed-off-by: Dirk Hohndel --- save-git.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'save-git.c') diff --git a/save-git.c b/save-git.c index 7c564e533..e13847125 100644 --- a/save-git.c +++ b/save-git.c @@ -549,7 +549,8 @@ static void create_dive_name(struct dive *dive, struct membuffer *name, struct t if (tm.tm_mon != dirtm->tm_mon) put_format(name, "%02u-", tm.tm_mon+1); - put_format(name, "%02u-%s-%02u:%02u:%02u", + /* a colon is an illegal char in a file name on Windows - use an '=' instead */ + put_format(name, "%02u-%s-%02u=%02u=%02u", tm.tm_mday, weekday[tm.tm_wday], tm.tm_hour, tm.tm_min, tm.tm_sec); } -- cgit v1.2.3-70-g09d2