mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
git save: add list of dive computers to the commit message
This makes it much more obvious what is going on when you save in between importing multiple dive computers, since the last dive description otherwise stays the same. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4f29a47afb
commit
531a5db2f1
1 changed files with 10 additions and 1 deletions
11
save-git.c
11
save-git.c
|
@ -845,6 +845,8 @@ 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;
|
||||
|
@ -852,7 +854,14 @@ static void create_commit_message(struct membuffer *msg)
|
|||
put_format(msg, "dive %d: %s", nr, 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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue