@@ -63,6 +63,8 @@ static int read_patches(const char *range, struct string_list *list,
63
63
"--output-indicator-old=<" ,
64
64
"--output-indicator-context=#" ,
65
65
"--no-abbrev-commit" ,
66
+ "--pretty=medium" ,
67
+ "--notes" ,
66
68
NULL );
67
69
if (other_arg )
68
70
argv_array_pushv (& cp .args , other_arg -> argv );
@@ -106,20 +108,34 @@ static int read_patches(const char *range, struct string_list *list,
106
108
continue ;
107
109
}
108
110
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
+
109
122
if (starts_with (line , "diff --git" )) {
110
123
struct patch patch = { 0 };
111
124
struct strbuf root = STRBUF_INIT ;
112
125
int linenr = 0 ;
126
+ int orig_len ;
113
127
114
128
in_header = 0 ;
115
129
strbuf_addch (& buf , '\n' );
116
130
if (!util -> diff_offset )
117
131
util -> diff_offset = buf .len ;
118
132
line [len - 1 ] = '\n' ;
133
+ orig_len = len ;
119
134
len = parse_git_diff_header (& root , & linenr , 0 , line ,
120
135
len , size , & patch );
121
136
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 );
123
139
strbuf_addstr (& buf , " ## " );
124
140
if (patch .is_new > 0 )
125
141
strbuf_addf (& buf , "%s (new)" , patch .new_name );
0 commit comments