Skip to content

Commit 55275b3

Browse files
author
Junio C Hamano
committed
Merge branch 'jc/withraw' into next
* jc/withraw: Separate the raw diff and patch with a newline Document --patch-with-raw
2 parents 8fcd421 + 90c1b08 commit 55275b3

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

Documentation/diff-options.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
-u::
55
Synonym for "-p".
66

7+
--patch-with-raw::
8+
Generate patch but keep also the default raw diff output.
9+
710
-z::
811
\0 line termination on output
912

combine-diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ const char *diff_tree_combined_merge(const unsigned char *sha1,
868868
header = NULL;
869869
}
870870
opt->output_format = saved_format;
871+
putchar(opt->line_termination);
871872
}
872873
for (p = paths; p; p = p->next) {
873874
if (show_combined_diff(p, num_parent, dense,

diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@ void diff_flush(struct diff_options *options)
13221322
struct diff_filepair *p = q->queue[i];
13231323
flush_one_pair(p, DIFF_FORMAT_RAW, options);
13241324
}
1325+
putchar(options->line_termination);
13251326
}
13261327
for (i = 0; i < q->nr; i++) {
13271328
struct diff_filepair *p = q->queue[i];

diff.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ extern void diffcore_std_no_resolve(struct diff_options *);
113113
" -z output diff-raw with lines terminated with NUL.\n" \
114114
" -p output patch format.\n" \
115115
" -u synonym for -p.\n" \
116+
" --patch-with-raw\n" \
117+
" output both a patch and the diff-raw format.\n" \
116118
" --name-only show only names of changed files.\n" \
117119
" --name-status show names and status of changed files.\n" \
118120
" --full-index show full object name on index lines.\n" \

0 commit comments

Comments
 (0)