{"thread":{"id":"8963","subject":"[PATCH] Work around a bad interaction between Tcl and cmd.exe with \"^{tree}\"","startedAt":"2007-07-10T13:09:29Z","lastAt":"2007-07-10T13:09:29Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46948","messageId":"11840729692004-git-send-email-j.sixt@eudaptics.com","threadId":"8963","inReplyTo":null,"subject":"[PATCH] Work around a bad interaction between Tcl and cmd.exe with \"^{tree}\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-07-10T13:09:29Z","receivedAt":"2007-07-10T13:09:29Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <johannes.sixt@telecom.at>\n\nIt seems that MSYS's wish does some quoting for Bourne shells, in\nparticular, escape the first '{' of the \"^{tree}\" suffix, but then it uses\ncmd.exe to run the \"git rev-parse\" command. However, cmd.exe does not remove\nthe backslash, so that the resulting ref expression ends up in git's guts\nas unrecognizable garbage.\n\nFortunately, recent versions of git can refer to the root tree object using\nthe notation \"$commit:\", which avoids the problematic case.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n lib/commit.tcl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/lib/commit.tcl b/lib/commit.tcl\nindex dc7c88c..43a5aca 100644\n--- a/lib/commit.tcl\n+++ b/lib/commit.tcl\n@@ -258,7 +258,7 @@ proc commit_committree {fd_wt curHEAD msg} {\n \t# -- Verify this wasn't an empty change.\n \t#\n \tif {$commit_type eq {normal}} {\n-\t\tset old_tree [git rev-parse \"$PARENT^{tree}\"]\n+\t\tset old_tree [git rev-parse \"$PARENT:\"]\n \t\tif {$tree_id eq $old_tree} {\n \t\t\tinfo_popup {No changes to commit.\n \n-- \n1.5.3.rc0.32.g2968f\n"}]}