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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jrnieder@xxxxxxxxx>
---
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@xxxxxxxxxxx>.
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();
 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]