commit: Display subject/body in commit editor
This allows automation to prefill the subject/body for the editor. It could also be useful if some kind of "amend commit" functionality was implemented. Closes: #305 Approved by: cgwalters
This commit is contained in:
parent
b5bd28adae
commit
5e336333f3
|
|
@ -218,14 +218,18 @@ commit_editor (OstreeRepo *repo,
|
||||||
char **lines = NULL;
|
char **lines = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
*subject = NULL;
|
|
||||||
*body = NULL;
|
|
||||||
|
|
||||||
input = g_strdup_printf ("\n"
|
input = g_strdup_printf ("\n"
|
||||||
"# Please enter the commit message for your changes. The first line will\n"
|
"# Please enter the commit message for your changes. The first line will\n"
|
||||||
"# become the subject, and the remainder the body. Lines starting\n"
|
"# become the subject, and the remainder the body. Lines starting\n"
|
||||||
"# with '#' will be ignored, and an empty message aborts the commit."
|
"# with '#' will be ignored, and an empty message aborts the commit."
|
||||||
"%s%s\n", branch ? "\n#\n# Branch: " : "", branch ?: "");
|
"%s%s%s%s%s%s\n"
|
||||||
|
, branch ? "\n#\n# Branch: " : "", branch ? branch : ""
|
||||||
|
, *subject ? "\n" : "", *subject ? *subject : ""
|
||||||
|
, *body ? "\n" : "", *body ? *body : ""
|
||||||
|
);
|
||||||
|
|
||||||
|
*subject = NULL;
|
||||||
|
*body = NULL;
|
||||||
|
|
||||||
output = ot_editor_prompt (repo, input, cancellable, error);
|
output = ot_editor_prompt (repo, input, cancellable, error);
|
||||||
if (output == NULL)
|
if (output == NULL)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue