aboutsummaryrefslogtreecommitdiffstats
path: root/core/save-git.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/save-git.c')
-rw-r--r--core/save-git.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/save-git.c b/core/save-git.c
index 4f6110eb1..daeae23a3 100644
--- a/core/save-git.c
+++ b/core/save-git.c
@@ -1044,9 +1044,12 @@ static void create_commit_message(struct membuffer *msg, bool create_empty)
{
int nr = dive_table.nr;
struct dive *dive = get_dive(nr-1);
+ char* changes_made = get_changes_made();
if (create_empty) {
put_string(msg, "Initial commit to create empty repo.\n\n");
+ } else if (!empty_string(changes_made)) {
+ put_format(msg, "Changes made: \n\n%s\n", changes_made);
} else if (dive) {
dive_trip_t *trip = dive->divetrip;
const char *location = get_dive_location(dive) ? : "no location";
@@ -1071,6 +1074,9 @@ static void create_commit_message(struct membuffer *msg, bool create_empty)
const char *user_agent = subsurface_user_agent();
put_format(msg, "Created by %s\n", user_agent);
free((void *)user_agent);
+ free(changes_made);
+ if (verbose)
+ fprintf(stderr, "Commit message:\n\n%s\n", mb_cstring(msg));
}
static int create_new_commit(git_repository *repo, const char *remote, const char *branch, git_oid *tree_id, bool create_empty)