@@ -63,6 +63,8 @@ static int read_patches(const char *range, struct string_list *list,
6363 "--output-indicator-old=<" ,
6464 "--output-indicator-context=#" ,
6565 "--no-abbrev-commit" ,
66+ "--pretty=medium" ,
67+ "--notes" ,
6668 NULL );
6769 if (other_arg )
6870 argv_array_pushv (& cp .args , other_arg -> argv );
@@ -106,20 +108,34 @@ static int read_patches(const char *range, struct string_list *list,
106108 continue ;
107109 }
108110
111+ if (!util ) {
112+ error (_ ("could not parse first line of `log` output: "
113+ "did not start with 'commit ': '%s'" ),
114+ line );
115+ string_list_clear (list , 1 );
116+ strbuf_release (& buf );
117+ strbuf_release (& contents );
118+ finish_command (& cp );
119+ return -1 ;
120+ }
121+
109122 if (starts_with (line , "diff --git" )) {
110123 struct patch patch = { 0 };
111124 struct strbuf root = STRBUF_INIT ;
112125 int linenr = 0 ;
126+ int orig_len ;
113127
114128 in_header = 0 ;
115129 strbuf_addch (& buf , '\n' );
116130 if (!util -> diff_offset )
117131 util -> diff_offset = buf .len ;
118132 line [len - 1 ] = '\n' ;
133+ orig_len = len ;
119134 len = parse_git_diff_header (& root , & linenr , 0 , line ,
120135 len , size , & patch );
121136 if (len < 0 )
122- die (_ ("could not parse git header '%.*s'" ), (int )len , line );
137+ die (_ ("could not parse git header '%.*s'" ),
138+ orig_len , line );
123139 strbuf_addstr (& buf , " ## " );
124140 if (patch .is_new > 0 )
125141 strbuf_addf (& buf , "%s (new)" , patch .new_name );
0 commit comments