{"thread":{"id":"65","subject":"[PATCH] Rename confusing variable in show-diff","startedAt":"2005-04-17T01:10:29Z","lastAt":"2005-04-17T01:26:52Z","messageCount":2,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"412","messageId":"7vzmvy2ooq.fsf@assigned-by-dhcp.cox.net","threadId":"65","inReplyTo":null,"subject":"[PATCH] Rename confusing variable in show-diff","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-17T01:10:29Z","receivedAt":"2005-04-17T01:10:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The show-diff command uses a variable \"new\" but it is always\nused to point at the original data recorded in the dircache\nbefore the user started editing in the working file.  Rename it\nto \"old\" to avoid confusion.\n\nTo be applied on top of my previous patches:\n\n    [PATCH] Optionally tell show-diff to show only named files.\n    [PATCH] show-diff -z option for machine readable output.\n    [PATCH] show-diff shell safety.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n show-diff.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\nshow-diff.c: e52eee21c2f682bef2dba06445699cca8e34c63a\n--- show-diff.c\n+++ show-diff.c\t2005-04-16 18:05:55.000000000 -0700\n@@ -162,7 +162,7 @@\n \t\tint changed;\n \t\tunsigned long size;\n \t\tchar type[20];\n-\t\tvoid *new;\n+\t\tvoid *old;\n \n \t\tif (1 <argc &&\n \t\t    ! matches_pathspec(ce, argv+1, argc-1))\n@@ -193,8 +193,8 @@\n \t\tif (silent)\n \t\t\tcontinue;\n \n-\t\tnew = read_sha1_file(ce->sha1, type, &size);\n-\t\tshow_differences(ce->name, new, size);\n+\t\told = read_sha1_file(ce->sha1, type, &size);\n+\t\tshow_differences(ce->name, old, size);\n \t\tfree(new);\n \t}\n \treturn 0;\n\n"},{"id":"415","messageId":"7vu0m62nxf.fsf@assigned-by-dhcp.cox.net","threadId":"65","inReplyTo":"7vzmvy2ooq.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] (take 2) Rename confusing variable in show-diff","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-17T01:26:52Z","receivedAt":"2005-04-17T01:26:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Oops, sorry I screwed up and sent a wrong patch.  Please discard\nthe previous one.\n\nThe show-diff command uses a variable \"new\" but it is always\nused to point at the original data recorded in the dircache\nbefore the user started editing in the working file.  Rename it\nto \"old\" to avoid confusion.\n\nTo be applied on top of my previous patches:\n\n    [PATCH] Optionally tell show-diff to show only named files.\n    [PATCH] show-diff -z option for machine readable output.\n    [PATCH] show-diff shell safety.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n show-diff.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\nshow-diff.c: e52eee21c2f682bef2dba06445699cca8e34c63a\n--- show-diff.c\n+++ show-diff.c\t2005-04-16 18:23:57.000000000 -0700\n@@ -162,7 +162,7 @@\n \t\tint changed;\n \t\tunsigned long size;\n \t\tchar type[20];\n-\t\tvoid *new;\n+\t\tvoid *old;\n \n \t\tif (1 <argc &&\n \t\t    ! matches_pathspec(ce, argv+1, argc-1))\n@@ -193,9 +193,9 @@\n \t\tif (silent)\n \t\t\tcontinue;\n \n-\t\tnew = read_sha1_file(ce->sha1, type, &size);\n-\t\tshow_differences(ce->name, new, size);\n-\t\tfree(new);\n+\t\told = read_sha1_file(ce->sha1, type, &size);\n+\t\tshow_differences(ce->name, old, size);\n+\t\tfree(old);\n \t}\n \treturn 0;\n }\n\n\n"}]}