Re: [PATCH/RFC] fast-import: treat SIGUSR1 as a request to access objects early

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH/RFC] fast-import: treat SIGUSR1 as a request to access objects early

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:06

Jonathan Nieder [off-list ref] writes:
+static void parse_checkpoint(void)
+{
+	do_checkpoint();
 	skip_optional_lf();
 }
I would have expected the new implementation of parse_checkpoint() to just
set the checkpoint_requested variable to true, so that the checkpoint
always happens in the main loop, which somehow feels cleaner.  But that is
a minor point.

Re: [PATCH/RFC] fast-import: treat SIGUSR1 as a request to access objects early

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:06

Junio C Hamano wrote:
I would have expected the new implementation of parse_checkpoint() to just
set the checkpoint_requested variable to true, so that the checkpoint
always happens in the main loop, which somehow feels cleaner.
Nice.  Here's that plus some minor cleanups I had in my tree.

Signed-off-by: Jonathan Nieder <redacted>
---
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 6be3938..5937cc0 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -1119,7 +1119,6 @@ operator can use this facility to peek at the objects and refs from an
 import in progress, at the cost of some added running time and worse
 compression.
 
-
 Author
 ------
 Written by Shawn O. Pearce <spearce@spearce.org>.
diff --git a/fast-import.c b/fast-import.c
index e8f08fb..a348994 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -490,7 +490,6 @@ static NORETURN void die_nicely(const char *err, va_list params)
 
 static void set_checkpoint_signal(void)
 {
-	/* nothing */
 }
 
 #else
@@ -2351,7 +2350,7 @@ static void parse_reset_branch(void)
 		unread_command_buf = 1;
 }
 
-static void do_checkpoint(void)
+static void checkpoint(void)
 {
 	checkpoint_requested = 0;
 	if (object_count) {
@@ -2364,7 +2363,7 @@ static void do_checkpoint(void)
 
 static void parse_checkpoint(void)
 {
-	do_checkpoint();
+	checkpoint_requested = 1;
 	skip_optional_lf();
 }
 
@@ -2524,7 +2523,7 @@ int main(int argc, const char **argv)
 			die("Unsupported command: %s", command_buf.buf);
 
 		if (checkpoint_requested)
-			do_checkpoint();
+			checkpoint();
 	}
 	end_packfile();
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help