{"thread":{"id":"1616","subject":"[PATCH] Fix \"git-diff-script A B\"","startedAt":"2005-08-23T01:07:28Z","lastAt":"2005-08-23T01:07:28Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7636","messageId":"7vzmr9zcj3.fsf@assigned-by-dhcp.cox.net","threadId":"1616","inReplyTo":null,"subject":"[PATCH] Fix \"git-diff-script A B\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-23T01:07:28Z","receivedAt":"2005-08-23T01:07:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When \"git-diff-script A..B\" notation was introduced, it ended up breaking\nthe traditional two revisions notation.\n\n[jc: there are other issues with the current \"git diff\" I would like to\n address, but they would be left to later rounds.  For example, -M and -p flags\n should not be hardcoded default, and it shouldn't be too hard to rewrite\n the script without using shell arrays.]\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n git-diff-script |   10 ++++++++--\n 1 files changed, 8 insertions(+), 2 deletions(-)\n\n30e852431bd6b6f8395646749c5baa8cfca88b51\ndiff --git a/git-diff-script b/git-diff-script\n--- a/git-diff-script\n+++ b/git-diff-script\n@@ -8,8 +8,14 @@ case \"${#rev[*]}\" in\n 1)\n \tgit-diff-cache -M -p \"$@\";;\n 2)\n-\tbegin=$(echo \"${rev[1]}\" | tr -d '^')\n-\tend=\"${rev[0]}\"\n+\tcase \"${rev[1]}\" in\n+\t^?*)\n+\t\tbegin=$(echo \"${rev[1]}\" | tr -d '^')\n+\t\tend=\"${rev[0]}\" ;;\n+\t*)\n+\t\tbegin=\"${rev[0]}\"\n+\t\tend=\"${rev[1]}\"\t;;\n+\tesac\n \tgit-diff-tree -M -p $flags $begin $end $files;;\n *)\n \techo \"I don't understand\"\n"}]}