<commit_before>diff -rc make-3.81-orig/job.c make-3.81/job.c
*** make-3.81-orig/job.c	2006-03-20 04:03:04.000000000 +0100
--- make-3.81/job.c	2009-01-19 19:37:28.000000000 +0100
***************
*** 1083,1089 ****
       appear.  */
  
    message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
! 	   ? "%s" : (char *) 0, p);
  
    /* Tell update_goal_chain that a command has been started on behalf of
       this target.  It is important that this happens here and not in
--- 1083,1089 ----
       appear.  */
  
    message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
!           ? (enable_nested_output ? "\e[3s\e[a%s\e[b" : "%s") : (char *) 0, p);
  
    /* Tell update_goal_chain that a command has been started on behalf of
       this target.  It is important that this happens here and not in
diff -rc make-3.81-orig/main.c make-3.81/main.c
*** make-3.81-orig/main.c	2006-03-20 03:36:37.000000000 +0100
--- make-3.81/main.c	2009-01-19 19:41:41.000000000 +0100
***************
*** 886,891 ****
--- 886,900 ----
  }
  
  
+ static void close_nesting()
+ {
+   while (stdout_nesting_level--)
+     printf("\e[q");
+   while (stderr_nesting_level--)
+     fprintf(stderr, "\e[q");
+ }
+ 
+ 
  #ifdef _AMIGA
  int
  main (int argc, char **argv)
***************
*** 931,936 ****
--- 940,950 ----
    atexit (close_stdout);
  #endif
  
+   atexit(close_nesting);
+ 
+   if (getenv("NIX_INDENT_MAKE"))
+     enable_nested_output = 1;
+ 
    /* Needed for OS/2 */
    initialize_main(&argc, &argv);
  
***************
*** 3095,3100 ****
--- 3109,3120 ----
  
    /* Use entire sentences to give the translators a fighting chance.  */
  
+   if (entering && enable_nested_output)
+     {
+       printf("\e[p");
+       stdout_nesting_level++;
+     }
+   
    if (makelevel == 0)
      if (starting_directory == 0)
        if (entering)
***************
*** 3124,3129 ****
--- 3144,3159 ----
          printf (_("%s[%u]: Leaving directory `%s'\n"),
                  program, makelevel, starting_directory);
  
+   if (!entering && enable_nested_output)
+     {
+       printf("\e[q");
+       stdout_nesting_level--;
+     }
+  
    /* Flush stdout to be sure this comes before any stderr output.  */
    fflush (stdout);
  }
+ 
+ int enable_nested_output = 0;
+ int stdout_nesting_level = 0;
+ int stderr_nesting_level = 0;
diff -rc make-3.81-orig/make.h make-3.81/make.h
*** make-3.81-orig/make.h	2006-02-16 00:54:43.000000000 +0100
--- make-3.81/make.h	2009-01-19 19:32:03.000000000 +0100
***************
*** 609,611 ****
--- 609,614 ----
  #define ENULLLOOP(_v,_c)   do{ errno = 0; \
                                 while (((_v)=_c)==0 && errno==EINTR); }while(0)
  
+ extern int enable_nested_output;
+ extern int stdout_nesting_level;
+ extern int stderr_nesting_level;
diff -rc make-3.81-orig/remake.c make-3.81/remake.c
*** make-3.81-orig/remake.c	2006-03-20 03:36:37.000000000 +0100
--- make-3.81/remake.c	2009-01-19 19:39:40.000000000 +0100
***************
*** 1120,1126 ****
--- 1120,1137 ----
        /* The normal case: start some commands.  */
        if (!touch_flag || file->cmds->any_recurse)
  	{
+           if (enable_nested_output) 
+             {
+               log_working_directory (1);
+               fprintf(stderr, "\e[pbuilding %s\n", file->name);
+               stderr_nesting_level++;
+             }
  	  execute_file_commands (file);
+           if (enable_nested_output) 
+             {
+               fprintf(stderr, "\e[q");
+               stderr_nesting_level--;
+             }
  	  return;
  	}<commit_msg>Fixing the gnumake log.patch so it applies to the new gnumake<commit_after>diff -rc make-3.81-orig/job.c make-3.81/job.c
*** make-3.81-orig/job.c	2006-03-20 04:03:04.000000000 +0100
--- make-3.81/job.c	2009-01-19 19:37:28.000000000 +0100
***************
*** 1083,1089 ****
       appear.  */
  
    message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
! 	   ? "%s" : (char *) 0, p);
  
    /* Tell update_goal_chain that a command has been started on behalf of
       this target.  It is important that this happens here and not in
--- 1083,1089 ----
       appear.  */
  
    message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
!           ? (enable_nested_output ? "\e[3s\e[a%s\e[b" : "%s") : (char *) 0, p);
  
    /* Tell update_goal_chain that a command has been started on behalf of
       this target.  It is important that this happens here and not in
diff -rc make-3.81-orig/main.c make-3.81/main.c
*** make-3.81-orig/main.c	2006-03-20 03:36:37.000000000 +0100
--- make-3.81/main.c	2009-01-19 19:41:41.000000000 +0100
***************
*** 886,891 ****
--- 886,900 ----
  }
  
  
+ static void close_nesting()
+ {
+   while (stdout_nesting_level--)
+     printf("\e[q");
+   while (stderr_nesting_level--)
+     fprintf(stderr, "\e[q");
+ }
+ 
+ 
  #ifdef _AMIGA
  int
  main (int argc, char **argv)
***************
*** 931,936 ****
--- 940,950 ----
    atexit (close_stdout);
  #endif
  
+   atexit(close_nesting);
+ 
+   if (getenv("NIX_INDENT_MAKE"))
+     enable_nested_output = 1;
+ 
    /* Needed for OS/2 */
    initialize_main(&argc, &argv);
  
***************
*** 3095,3100 ****
--- 3109,3120 ----
  
    /* Use entire sentences to give the translators a fighting chance.  */
  
+   if (entering && enable_nested_output)
+     {
+       printf("\e[p");
+       stdout_nesting_level++;
+     }
+   
    if (makelevel == 0)
      if (starting_directory == 0)
        if (entering)
***************
*** 3124,3129 ****
--- 3144,3159 ----
          printf (_("%s[%u]: Leaving directory `%s'\n"),
                  program, makelevel, starting_directory);
  
+   if (!entering && enable_nested_output)
+     {
+       printf("\e[q");
+       stdout_nesting_level--;
+     }
+  
    /* Flush stdout to be sure this comes before any stderr output.  */
    fflush (stdout);
  }
+ 
+ int enable_nested_output = 0;
+ int stdout_nesting_level = 0;
+ int stderr_nesting_level = 0;
diff -rc make-3.81-orig/make.h make-3.81/make.h
*** make-3.81-orig/make.h	2006-02-16 00:54:43.000000000 +0100
--- make-3.81/make.h	2009-01-19 19:32:03.000000000 +0100
***************
*** 609,611 ****
--- 609,614 ----
  
  #define ENULLLOOP(_v,_c)   do { errno = 0; (_v) = _c; } \
                             while((_v)==0 && errno==EINTR)
+ extern int enable_nested_output;
+ extern int stdout_nesting_level;
+ extern int stderr_nesting_level;
diff -rc make-3.81-orig/remake.c make-3.81/remake.c
*** make-3.81-orig/remake.c	2006-03-20 03:36:37.000000000 +0100
--- make-3.81/remake.c	2009-01-19 19:39:40.000000000 +0100
***************
*** 1120,1126 ****
--- 1120,1137 ----
        /* The normal case: start some commands.  */
        if (!touch_flag || file->cmds->any_recurse)
  	{
+           if (enable_nested_output) 
+             {
+               log_working_directory (1);
+               fprintf(stderr, "\e[pbuilding %s\n", file->name);
+               stderr_nesting_level++;
+             }
  	  execute_file_commands (file);
+           if (enable_nested_output) 
+             {
+               fprintf(stderr, "\e[q");
+               stderr_nesting_level--;
+             }
  	  return;
  	}
{'fraction_non_alphanumeric': 0.1986745823553776, 'fraction_numerical': 0.10479083252795802, 'mean_word_length': 2.3521517815826005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 16, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5559770', 'n_tokens_mistral': 3226, 'n_tokens_neox': 2678, 'n_words': 540}