diff options
Diffstat (limited to 'save-git.c')
-rw-r--r-- | save-git.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/save-git.c b/save-git.c index 3fd8807c6..6abba601a 100644 --- a/save-git.c +++ b/save-git.c @@ -845,14 +845,23 @@ static void create_commit_message(struct membuffer *msg) if (dive) { dive_trip_t *trip = dive->divetrip; const char *location = dive->location ? : "no location"; + struct divecomputer *dc = &dive->dc; + const char *sep = "\n"; if (dive->number) nr = dive->number; put_format(msg, "dive %d: %s", nr, location); - if (trip->location && *trip->location && strcmp(trip->location, location)) + if (trip && trip->location && *trip->location && strcmp(trip->location, location)) put_format(msg, " (%s)", trip->location); - put_format(msg, "\n\n"); + put_format(msg, "\n"); + do { + if (dc->model && *dc->model) { + put_format(msg, "%s%s", sep, dc->model); + sep = ", "; + } + } while ((dc = dc->next) != NULL); + put_format(msg, "\n"); } put_format(msg, "Created by subsurface %s\n", VERSION_STRING); } |