recommendations for log enhancement

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

 



Our team studies the consistent edits of git during evolution. And we find several missed edits in the latest release of git. For example, there are two consist edits we have figured out from historical commits:
1) . Version: git 2.3.9 – git-2.3.10
       File: builtin/merge-tree.c

 	dst.size = size;
-	xdi_diff(&src, &dst, &xpp, &xecfg, &ecb);
+	if (xdi_diff(&src, &dst, &xpp, &xecfg, &ecb))
+		die("unable to generate diff");
 	free(src.ptr);
 	free(dst.ptr);
 }

2) .Version: git 2.3.9 – git-2.3.10
      File: combine-diff.c
  
-	xdi_diff_outf(&parent_file, result_file, consume_line, &state,
-		      &xpp, &xecfg);
+	if (xdi_diff_outf(&parent_file, result_file, consume_line, &state,
+			  &xpp, &xecfg))
+		die("unable to generate combined diff for %s",
+		    sha1_to_hex(parent));
 	free(parent_file.ptr);

Those two commits both add if structure and log messages for handling the return value of xdi_diff_outf(). 
And in the latest release, we find one candidate that may also need log statements inserted:
1)  File: git-2.14.2/builtin/rerere.c
    
     1	static int diff_two(const char *file1, const char *label1,
     2			const char *file2, const char *label2)
     3	{
….
    20		ret = xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
    21	
    22		free(minus.ptr);
    23		free(plus.ptr);
    24		return ret;
    25	}
...
}

There are more examples of consistent update and corresponding suggestions in attachment. It is so nice of you to read them and share me with your opinion on the correctness of our suggestion. Thanks a lot. 

Attachment: git_recommendation_3.doc
Description: MS-Word document

Attachment: git_recommendation_2.doc
Description: MS-Word document

Attachment: git_recommendation_1.doc
Description: MS-Word document


[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]

  Powered by Linux