mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cloud storage: add list of changes made to commit messages
This should make it easier to figure out what operations lead to the commit that is written to git. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
160d2ab071
commit
8ce4e10ccb
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue