Merge branch 'jc/withraw' into next
authorJunio C Hamano <junkio@cox.net>
Tue, 11 Apr 2006 18:52:01 +0000 (11:52 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 11 Apr 2006 18:52:01 +0000 (11:52 -0700)
* jc/withraw:
Separate the raw diff and patch with a newline
Document --patch-with-raw

Documentation/diff-options.txt
combine-diff.c
diff.c
diff.h
index ec6811c71885a9aa0a28626c46e0645cd79864ac..338014c8162c1576796a57ab61498612948fe9dc 100644 (file)
@@ -4,6 +4,9 @@
 -u::
        Synonym for "-p".
 
+--patch-with-raw::
+       Generate patch but keep also the default raw diff output.
+
 -z::
        \0 line termination on output
 
index 011bb8db2dd4b5cbc22591c6e613247c14de4d2b..5f6048b397f41f00362c9d83c38a28e420340093 100644 (file)
@@ -868,6 +868,7 @@ const char *diff_tree_combined_merge(const unsigned char *sha1,
                                        header = NULL;
                        }
                        opt->output_format = saved_format;
+                       putchar(opt->line_termination);
                }
                for (p = paths; p; p = p->next) {
                        if (show_combined_diff(p, num_parent, dense,
diff --git a/diff.c b/diff.c
index 99d76d01e3c0b14e96742292addf4d121afb6ab7..a14e6644ca9a39d0a0e1702ccefadf7a5bb64081 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1322,6 +1322,7 @@ void diff_flush(struct diff_options *options)
                        struct diff_filepair *p = q->queue[i];
                        flush_one_pair(p, DIFF_FORMAT_RAW, options);
                }
+               putchar(options->line_termination);
        }
        for (i = 0; i < q->nr; i++) {
                struct diff_filepair *p = q->queue[i];
diff --git a/diff.h b/diff.h
index 07b153b56702e2271295dcea832c95afc55deb93..c5372b984a457d0e5bddcf0b334a1a3cdc149cec 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -113,6 +113,8 @@ extern void diffcore_std_no_resolve(struct diff_options *);
 "  -z            output diff-raw with lines terminated with NUL.\n" \
 "  -p            output patch format.\n" \
 "  -u            synonym for -p.\n" \
+"  --patch-with-raw\n" \
+"                output both a patch and the diff-raw format.\n" \
 "  --name-only   show only names of changed files.\n" \
 "  --name-status show names and status of changed files.\n" \
 "  --full-index  show full object name on index lines.\n" \