commit - 5a6c61ae36e76ef40d6bac927cc3adea2fa54079
commit + ee27b57e0fcb14468a5b8a9cd8414b475267cddb
blob - 4c1cec0823d60146457085b972328049ac986934
blob + aedab60cfd015c8f0ee324f24c2eaaabdb75d665
--- cvg/cvg.1
+++ cvg/cvg.1
option,
.Cm got import
opens a temporary file in an editor where a log message can be written.
+Quitting the editor without saving the file will abort the import operation.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
and
.Fl N
options are used together.
+Quitting the editor without saving the file will abort the commit operation.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
blob - ea3b833f1bc15d5ea3e276e75da0a16f1e29702c
blob + 19956b285901018b3d037f8f9a305d91091998ff
--- got/got.1
+++ got/got.1
option,
.Cm got import
opens a temporary file in an editor where a log message can be written.
+Quitting the editor without saving the file will abort the import operation.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
option,
.Cm got tag
opens a temporary file in an editor where a tag message can be written.
+Quitting the editor without saving the file will abort the tag operation.
.It Fl r Ar repository-path
Use the repository at the specified path.
If not specified, assume the repository is located at or above the current
and
.Fl N
options are used together.
+Quitting the editor without saving the file will abort the commit operation.
.Pp
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
or
.Fl m
options.
+Quitting the editor without saving the file will abort the histedit operation.
.Pp
The format of the histedit script is line-based.
Each line in the script begins with a command name, followed by
blob - e21a92523011eaf67089838f68f9e98950704b11
blob + 2a5d0bd5f3e513f26cad87624b5c5ebbb8eaef14
--- got/got.c
+++ got/got.c
struct got_repository *repo)
{
const struct got_error *err = NULL;
+ struct stat st, st2;
+ struct timespec timeout;
char *editor;
FILE *f = NULL;
if (err)
return err;
+ if (stat(path, &st) == -1) {
+ err = got_error_from_errno2("stat", path);
+ goto done;
+ }
+
if (spawn_editor(editor, path) == -1) {
err = got_error_from_errno("failed spawning editor");
goto done;
}
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 1;
+ nanosleep(&timeout, NULL);
+
+ if (stat(path, &st2) == -1) {
+ err = got_error_from_errno2("stat", path);
+ goto done;
+ }
+
+ if (st.st_size == st2.st_size &&
+ timespeccmp(&st.st_mtim, &st2.st_mtim, ==)) {
+ err = got_error_msg(GOT_ERR_EMPTY_HISTEDIT,
+ "no changes made to histedit script, aborting");
+ goto done;
+ }
+
f = fopen(path, "re");
if (f == NULL) {
err = got_error_from_errno("fopen");