{"thread":{"id":"16037","subject":"[PATCH] add -p: warn if only binary changes present","startedAt":"2008-10-24T21:48:36Z","lastAt":"2008-10-26T19:38:01Z","messageCount":6,"participants":["Thomas Rast","Jeff King","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"93886","messageId":"1224884916-20369-1-git-send-email-trast@student.ethz.ch","threadId":"16037","inReplyTo":null,"subject":"[PATCH] add -p: warn if only binary changes present","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-10-24T21:48:36Z","receivedAt":"2008-10-24T21:48:36Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Current 'git add -p' will say \"No changes.\" if there are no changes to\ntext files, which can be confusing if there _are_ changes to binary\nfiles.  Add some code to distinguish the two cases, and give a\ndifferent message in the latter one.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n git-add--interactive.perl |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex da768ee..a560133 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -811,11 +811,16 @@ EOF\n }\n \n sub patch_update_cmd {\n-\tmy @mods = grep { !($_->{BINARY}) } list_modified('file-only');\n+\tmy @all_mods = list_modified('file-only');\n+\tmy @mods = grep { !($_->{BINARY}) } @all_mods;\n \tmy @them;\n \n \tif (!@mods) {\n-\t\tprint STDERR \"No changes.\\n\";\n+\t\tif (@all_mods) {\n+\t\t\tprint STDERR \"No changes except to binary files.\\n\";\n+\t\t} else {\n+\t\t\tprint STDERR \"No changes.\\n\";\n+\t\t}\n \t\treturn 0;\n \t}\n \tif ($patch_mode) {\n-- \ntg: (759ad19..) t/add-p-binary-warn (depends on: origin/master)\n"},{"id":"93968","messageId":"20081026051013.GD21178@coredump.intra.peff.net","threadId":"16037","inReplyTo":"1224884916-20369-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH] add -p: warn if only binary changes present","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-26T05:10:13Z","receivedAt":"2008-10-26T05:10:13Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 24, 2008 at 11:48:36PM +0200, Thomas Rast wrote:\n\n> Current 'git add -p' will say \"No changes.\" if there are no changes to\n> text files, which can be confusing if there _are_ changes to binary\n> files.  Add some code to distinguish the two cases, and give a\n> different message in the latter one.\n\nHaving just looked at this code (for potentially handling \"git add -p\"\nof new files), I think this change is sane.\n\n> +\t\t\tprint STDERR \"No changes except to binary files.\\n\";\n\nThis wording seems a little awkward to me, though. Maybe\n\n  No changed text files.\n\n?\n\n-Peff\n"},{"id":"93971","messageId":"200810261128.14735.trast@student.ethz.ch","threadId":"16037","inReplyTo":"20081026051013.GD21178@coredump.intra.peff.net","subject":"Re: [PATCH] add -p: warn if only binary changes present","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-10-26T10:28:09Z","receivedAt":"2008-10-26T10:28:09Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jeff King wrote:\n> > +\t\t\tprint STDERR \"No changes except to binary files.\\n\";\n> \n> This wording seems a little awkward to me, though. Maybe\n> \n>   No changed text files.\n> \n> ?\n\nI tried to make a more precise statement.  \"No changed text files\"\nalso holds if no files at all were changed.  A user can only infer\nthat there _are_ binary changes if he knows that the message in the\nlatter case would have been \"No changes\".\n\nThat being said, it is somewhat awkward, I just couldn't come up with\na better message with this meaning.  I considered some other options,\nsuch as giving a hint to use git-add or running git-status for the\nuser, but these would have been far more verbose.\n\n- Thomas\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n\n\n"},{"id":"93972","messageId":"20081026104006.GA18969@neumann","threadId":"16037","inReplyTo":"200810261128.14735.trast@student.ethz.ch","subject":"Re: [PATCH] add -p: warn if only binary changes present","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2008-10-26T10:40:06Z","receivedAt":"2008-10-26T10:40:06Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Oct 26, 2008 at 12:28:09PM +0200, Thomas Rast wrote:\n> Jeff King wrote:\n> > > +\t\t\tprint STDERR \"No changes except to binary files.\\n\";\n> >   No changed text files.\n> I tried to make a more precise statement.  \"No changed text files\"\n> also holds if no files at all were changed.  A user can only infer\n> that there _are_ binary changes if he knows that the message in the\n> latter case would have been \"No changes\".\n> \n> That being said, it is somewhat awkward, I just couldn't come up with\n> a better message with this meaning.\nWhat about\n\n   Only binary files changed.\n\nor something of the sort?\n\nGábor\n"},{"id":"93996","messageId":"1225049826-14941-1-git-send-email-trast@student.ethz.ch","threadId":"16037","inReplyTo":"20081026104006.GA18969@neumann","subject":"[PATCH v2] add -p: warn if only binary changes present","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-10-26T19:37:06Z","receivedAt":"2008-10-26T19:37:06Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Current 'git add -p' will say \"No changes.\" if there are no changes to\ntext files, which can be confusing if there _are_ changes to binary\nfiles.  Add some code to distinguish the two cases, and give a\ndifferent message in the latter one.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n\nSZEDER GÃ¡bor wrote:\n> What about\n> \n>    Only binary files changed.\n> \n> or something of the sort?\n\nYes, why not.\n\n\n git-add--interactive.perl |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex da768ee..b0223c3 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -811,11 +811,16 @@ EOF\n }\n \n sub patch_update_cmd {\n-\tmy @mods = grep { !($_->{BINARY}) } list_modified('file-only');\n+\tmy @all_mods = list_modified('file-only');\n+\tmy @mods = grep { !($_->{BINARY}) } @all_mods;\n \tmy @them;\n \n \tif (!@mods) {\n-\t\tprint STDERR \"No changes.\\n\";\n+\t\tif (@all_mods) {\n+\t\t\tprint STDERR \"Only binary files changed.\\n\";\n+\t\t} else {\n+\t\t\tprint STDERR \"No changes.\\n\";\n+\t\t}\n \t\treturn 0;\n \t}\n \tif ($patch_mode) {\n-- \ntg: (759ad19..) t/add-p-binary-warn (depends on: origin/master)\n"},{"id":"93997","messageId":"20081026193801.GA1105@coredump.intra.peff.net","threadId":"16037","inReplyTo":"1225049826-14941-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH v2] add -p: warn if only binary changes present","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-26T19:38:01Z","receivedAt":"2008-10-26T19:38:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Oct 26, 2008 at 08:37:06PM +0100, Thomas Rast wrote:\n\n> > What about\n> > \n> >    Only binary files changed.\n> > \n> > or something of the sort?\n> \n> Yes, why not.\n\nThat is better, IMHO.\n\n-Peff\n"}]}