{"thread":{"id":"13400","subject":"[PATCH] git-format-patch: add --no-binary to omit binary changes in the patch.","startedAt":"2008-05-06T17:47:59Z","lastAt":"2008-05-09T22:55:43Z","messageCount":4,"participants":["Caio Marcelo de Oliveira Filho","Robin Rosenberg","Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"76216","messageId":"1210096079-32399-1-git-send-email-cmarcelo@gmail.com","threadId":"13400","inReplyTo":null,"subject":"[PATCH] git-format-patch: add --no-binary to omit binary changes in the patch.","fromName":"Caio Marcelo de Oliveira Filho","fromEmail":"cmarcelo@gmail.com","sentAt":"2008-05-06T17:47:59Z","receivedAt":"2008-05-06T17:47:59Z","isPatch":true,"sender":{"key":"cmarcelo@gmail.com","avatar":null},"body":"Add a new option --no-binary to git-format-patch so that no binary\nchanges are included in the generated patches, only notices that those\nfiles changed.  This generate patches that cannot be applied, but still\nis useful for generating mails for code review purposes.\n\nSee also: commit e47f306d4bf964def1a0b29e8f7cea419471dffd, where --binary\noption was turned on by default.\n\nSigned-off-by: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>\n---\n\nThis is a first try on the patch.  The extra option affects only\ngit-format-patch, since the special case (activating --binary if\n--text wasn't set) is only there.\n\n\n Documentation/git-format-patch.txt |    6 ++++++\n builtin-log.c                      |    5 ++++-\n 2 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex b5207b7..81c930a 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -150,6 +150,12 @@ include::diff-options.txt[]\n \tInstead of using `.patch` as the suffix for generated\n \tfilenames, use specified suffix.  A common alternative is\n \t`--suffix=.txt`.\n+\n+--no-binary::\n+\tDon't output contents of changes in binary files, just take note\n+\tthat they differ.  Note that this disable the patch to be properly\n+\tapplied.  By default the contents of changes in those files are\n+\tencoded in the patch.\n +\n Note that you would need to include the leading dot `.` if you\n want a filename like `0001-description-of-my-change.patch`, and\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 256bbac..80a01f8 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -757,6 +757,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tint thread = 0;\n \tint cover_letter = 0;\n \tint boundary_count = 0;\n+\tint no_binary_diff = 0;\n \tstruct commit *origin = NULL, *head = NULL;\n \tconst char *in_reply_to = NULL;\n \tstruct patch_ids ids;\n@@ -862,6 +863,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\tfmt_patch_suffix = argv[i] + 9;\n \t\telse if (!strcmp(argv[i], \"--cover-letter\"))\n \t\t\tcover_letter = 1;\n+\t\telse if (!strcmp(argv[i], \"--no-binary\"))\n+\t\t\tno_binary_diff = 1;\n \t\telse\n \t\t\targv[j++] = argv[i];\n \t}\n@@ -914,7 +917,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (!rev.diffopt.output_format)\n \t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;\n \n-\tif (!DIFF_OPT_TST(&rev.diffopt, TEXT))\n+\tif (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)\n \t\tDIFF_OPT_SET(&rev.diffopt, BINARY);\n \n \tif (!output_directory && !use_stdout)\n-- \n1.5.5.1.147.g867f.dirty\n"},{"id":"76468","messageId":"200805091924.39992.robin.rosenberg.lists@dewire.com","threadId":"13400","inReplyTo":"1210096079-32399-1-git-send-email-cmarcelo@gmail.com","subject":"Re: [PATCH] git-format-patch: add --no-binary to omit binary changes in the patch.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-05-09T17:24:39Z","receivedAt":"2008-05-09T17:24:39Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdagen den 6 maj 2008 19.47.59 skrev Caio Marcelo de Oliveira Filho:\n> Add a new option --no-binary to git-format-patch so that no binary\n> changes are included in the generated patches, only notices that those\n> files changed.  This generate patches that cannot be applied, but still\n> is useful for generating mails for code review purposes.\n>\n> See also: commit e47f306d4bf964def1a0b29e8f7cea419471dffd, where --binary\n> option was turned on by default.\n>\n> Signed-off-by: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>\n> ---\n>\n> This is a first try on the patch.  The extra option affects only\n> git-format-patch, since the special case (activating --binary if\n> --text wasn't set) is only there.\n\nFine with me.\n\n-- robin\n"},{"id":"76473","messageId":"2c6b72b30805091408i1924b755k3d1f5f4bb0cfaf08@mail.gmail.com","threadId":"13400","inReplyTo":"1210096079-32399-1-git-send-email-cmarcelo@gmail.com","subject":"Re: [PATCH] git-format-patch: add --no-binary to omit binary changes in the patch.","fromName":"Jonas Fonseca","fromEmail":"jonas.fonseca@gmail.com","sentAt":"2008-05-09T21:08:18Z","receivedAt":"2008-05-09T21:08:18Z","isPatch":true,"sender":{"key":"jonas.fonseca@gmail.com","avatar":"https://gravatar.com/avatar/9b7fa23cce50269e5d164312b6ac5ae818a180f837b38f28f3bdf689dd7f96cd?d=mp&s=160"},"body":"On Tue, May 6, 2008 at 7:47 PM, Caio Marcelo de Oliveira Filho\n<cmarcelo@gmail.com> wrote:\n> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\n> index b5207b7..81c930a 100644\n> --- a/Documentation/git-format-patch.txt\n> +++ b/Documentation/git-format-patch.txt\n> @@ -150,6 +150,12 @@ include::diff-options.txt[]\n>        Instead of using `.patch` as the suffix for generated\n>        filenames, use specified suffix.  A common alternative is\n>        `--suffix=.txt`.\n> +\n> +--no-binary::\n> +       Don't output contents of changes in binary files, just take note\n> +       that they differ.  Note that this disable the patch to be properly\n> +       applied.  By default the contents of changes in those files are\n> +       encoded in the patch.\n>  +\n>  Note that you would need to include the leading dot `.` if you\n>  want a filename like `0001-description-of-my-change.patch`, and\n> diff --git a/builtin-log.c b/builtin-log.c\n\nThe '+' on the start of a line means continue last list item. In other\nwords, your update to the manpage will result in the --no-binary\noption having a second paragraph that was really intended for the\n--suffix option.\n\n-- \nJonas Fonseca\n"},{"id":"76475","messageId":"1210373743-5646-1-git-send-email-cmarcelo@gmail.com","threadId":"13400","inReplyTo":"2c6b72b30805091408i1924b755k3d1f5f4bb0cfaf08@mail.gmail.com","subject":"[PATCH] git-format-patch: add --no-binary to omit binary changes in the patch.","fromName":"Caio Marcelo de Oliveira Filho","fromEmail":"cmarcelo@gmail.com","sentAt":"2008-05-09T22:55:43Z","receivedAt":"2008-05-09T22:55:43Z","isPatch":true,"sender":{"key":"cmarcelo@gmail.com","avatar":null},"body":"Add a new option --no-binary to git-format-patch so that no binary\nchanges are included in the generated patches, only notices that those\nfiles changed.  This generate patches that cannot be applied, but still\nis useful for generating mails for code review purposes.\n\nSee also: commit e47f306d4bf964def1a0b29e8f7cea419471dffd, where --binary\noption was turned on by default.\n\nSigned-off-by: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>\n---\n\nFixed the manpage, thanks Jonas Fonseca.\n\n Documentation/git-format-patch.txt |    6 ++++++\n builtin-log.c                      |    5 ++++-\n 2 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 87e491b..7548a21 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -156,6 +156,12 @@ want a filename like `0001-description-of-my-change.patch`, and\n the first letter does not have to be a dot.  Leaving it empty would\n not add any suffix.\n \n+--no-binary::\n+\tDon't output contents of changes in binary files, just take note\n+\tthat they differ.  Note that this disable the patch to be properly\n+\tapplied.  By default the contents of changes in those files are\n+\tencoded in the patch.\n+\n CONFIGURATION\n -------------\n You can specify extra mail header lines to be added to each message\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 256bbac..80a01f8 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -757,6 +757,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tint thread = 0;\n \tint cover_letter = 0;\n \tint boundary_count = 0;\n+\tint no_binary_diff = 0;\n \tstruct commit *origin = NULL, *head = NULL;\n \tconst char *in_reply_to = NULL;\n \tstruct patch_ids ids;\n@@ -862,6 +863,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\tfmt_patch_suffix = argv[i] + 9;\n \t\telse if (!strcmp(argv[i], \"--cover-letter\"))\n \t\t\tcover_letter = 1;\n+\t\telse if (!strcmp(argv[i], \"--no-binary\"))\n+\t\t\tno_binary_diff = 1;\n \t\telse\n \t\t\targv[j++] = argv[i];\n \t}\n@@ -914,7 +917,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (!rev.diffopt.output_format)\n \t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;\n \n-\tif (!DIFF_OPT_TST(&rev.diffopt, TEXT))\n+\tif (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)\n \t\tDIFF_OPT_SET(&rev.diffopt, BINARY);\n \n \tif (!output_directory && !use_stdout)\n-- \n1.5.5.1.147.g867f.dirty\n"}]}