{"thread":{"id":"53450","subject":"git-gui patch staging errors","startedAt":"2020-05-12T01:07:56Z","lastAt":"2020-07-26T22:15:13Z","messageCount":7,"participants":["J. Paul Reed","Pratyush Yadav","Kerry, Richard"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"397589","messageId":"20200512010750.GA7127@sigkill.com","threadId":"53450","inReplyTo":null,"subject":"git-gui patch staging errors","fromName":"J. Paul Reed","fromEmail":"preed@sigkill.com","sentAt":"2020-05-12T01:07:50Z","receivedAt":"2020-05-12T01:07:56Z","isPatch":false,"sender":{"key":"preed@sigkill.com","avatar":"https://gravatar.com/avatar/a6d898ae24f856b851376d22623fd35bb37134ad6df0483b84b2b135c4878237?d=mp&s=160"},"body":"\nHey all,\n\nI ran into an interesting problem this week where git gui was erroring out\non staging partial patches in a particular file I was working on.\n\nI worked around it with \"git add -i,\" which worked like a champ.\n\nI later realized the source file has some special characters (Unicode,\nprobably) in it to print emojis (or colors or whatever fun animations the\nkids want on their terminals these days).\n\nInterestingly, lines/hunks before the first Unicode character will\npartial-stage appropriately, but attempting to stage any hunks/lines after\nthe characters produces a \"Failed to stage selected line. error: patch\nfailed ... error: ... patch does not apply\" error dialog.\n\nThis can be reproduced by cloning\nhttps://github.com/debek/aws-glacier-multipart-upload.git and editing\nglacierupload.sh; the special characters are in echo statements on lines\n60, 74, and 97.\n\nRemoving these control characters seems to calm git gui's indigestion on\nthis file.\n\n[preed@underworld ~]$ git --version\ngit version 2.26.2\n[preed@underworld ~]$ git gui --version\ngit-gui version 0.21.0.66.ga5728\n\nbest,\npreed\n-- \nJ. Paul Reed\nhttps://jpaulreed.com\nPGP: 0xDF8708F8\n\n"},{"id":"397596","messageId":"20200512121511.dyyd6n5gdfbesy2j@yadavpratyush.com","threadId":"53450","inReplyTo":"20200512010750.GA7127@sigkill.com","subject":"Re: git-gui patch staging errors","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-05-12T12:15:11Z","receivedAt":"2020-05-12T12:15:23Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi,\n\nOn 11/05/20 06:07PM, J. Paul Reed wrote:\n> \n> Hey all,\n> \n> I ran into an interesting problem this week where git gui was erroring out\n> on staging partial patches in a particular file I was working on.\n> \n> I worked around it with \"git add -i,\" which worked like a champ.\n> \n> I later realized the source file has some special characters (Unicode,\n> probably) in it to print emojis (or colors or whatever fun animations the\n> kids want on their terminals these days).\n> \n> Interestingly, lines/hunks before the first Unicode character will\n> partial-stage appropriately, but attempting to stage any hunks/lines after\n> the characters produces a \"Failed to stage selected line. error: patch\n> failed ... error: ... patch does not apply\" error dialog.\n> \n> This can be reproduced by cloning\n> https://github.com/debek/aws-glacier-multipart-upload.git and editing\n> glacierupload.sh; the special characters are in echo statements on lines\n> 60, 74, and 97.\n\nI can't reproduce it. I cloned the repo and then edited the file at line \n60 with a diff that looks something like:\n\n  diff --git a/glacierupload.sh b/glacierupload.sh\n  index 3b956c7..265349b 100755\n  --- a/glacierupload.sh\n  +++ b/glacierupload.sh\n  @@ -57,7 +57,9 @@ fi\n   \n   # count the number of files that begin with \"$prefix\"\n   fileCount=$(ls -1 | grep \"^$prefix\" | wc -l)\n  -echo \"📦 Glacier Upload with $AWS_PROFILE\"\n  +bar\n  +echo \"📦 Glacier s Upload with $AWS_PROFILE\"\n  +foo\n   echo \"Total parts to upload: \" $fileCount\n   \n   # get the list of part files to upload.  Edit this if you chose a different prefix in the split command\n\nI tried a bunch of combinations if partially staging parts of this diff, \nbut everything worked fine without any error message. The emoji didn't \nrender properly (though that might be my font's problem), but there were \nno problems in partial staging or unstaging.\n\nDoes this example work fine on your system or does it error out? Could \nyou give an example diff where git-gui has problems while staging? Maybe \nsomething in your config is different?\n \n> Removing these control characters seems to calm git gui's indigestion on\n> this file.\n> \n> [preed@underworld ~]$ git --version\n> git version 2.26.2\n> [preed@underworld ~]$ git gui --version\n> git-gui version 0.21.0.66.ga5728\n> \n> best,\n> preed\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"397601","messageId":"AM0PR02MB371505CA3EE36FBDB44B3A409CBE0@AM0PR02MB3715.eurprd02.prod.outlook.com","threadId":"53450","inReplyTo":"20200512121511.dyyd6n5gdfbesy2j@yadavpratyush.com","subject":"RE: git-gui patch staging errors","fromName":"Kerry, Richard","fromEmail":"richard.kerry@atos.net","sentAt":"2020-05-12T14:27:22Z","receivedAt":"2020-05-12T14:28:57Z","isPatch":false,"sender":{"key":"richard.kerry@atos.net","avatar":null},"body":"\n-----Original Message-----\nFrom: git-owner@vger.kernel.org <git-owner@vger.kernel.org> On Behalf Of Pratyush Yadav\nSent: 12 May 2020 13:15\nTo: J. Paul Reed <preed@sigkill.com>\nCc: git@vger.kernel.org\nSubject: Re: git-gui patch staging errors\n\nHi,\n\nOn 11/05/20 06:07PM, J. Paul Reed wrote:\n> \n> Hey all,\n> \n> I ran into an interesting problem this week where git gui was erroring \n> out on staging partial patches in a particular file I was working on.\n> \n> I worked around it with \"git add -i,\" which worked like a champ.\n> \n> I later realized the source file has some special characters (Unicode,\n> probably) in it to print emojis (or colors or whatever fun animations \n> the kids want on their terminals these days).\n> \n> Interestingly, lines/hunks before the first Unicode character will \n> partial-stage appropriately, but attempting to stage any hunks/lines \n> after the characters produces a \"Failed to stage selected line. error: \n> patch failed ... error: ... patch does not apply\" error dialog.\n> \n> This can be reproduced by cloning\nI can't reproduce it. I cloned the repo and then edited the file at line\n60 with a diff that looks something like:\n\n  diff --git a/glacierupload.sh b/glacierupload.sh\n  index 3b956c7..265349b 100755\n  --- a/glacierupload.sh\n  +++ b/glacierupload.sh\n  @@ -57,7 +57,9 @@ fi\n   \n   # count the number of files that begin with \"$prefix\"\n   fileCount=$(ls -1 | grep \"^$prefix\" | wc -l)\n  -echo \"📦 Glacier Upload with $AWS_PROFILE\"\n  +bar\n  +echo \"📦 Glacier s Upload with $AWS_PROFILE\"\n  +foo\n   echo \"Total parts to upload: \" $fileCount\n   \n   # get the list of part files to upload.  Edit this if you chose a different prefix in the split command\n\nI tried a bunch of combinations if partially staging parts of this diff, but everything worked fine without any error message. The emoji didn't render properly (though that might be my font's problem), but there were no problems in partial staging or unstaging.\n\nDoes this example work fine on your system or does it error out? Could you give an example diff where git-gui has problems while staging? Maybe something in your config is different?\n \n> Removing these control characters seems to calm git gui's indigestion \n> on this file.\n> \n> [preed@underworld ~]$ git --version\n> git version 2.26.2\n> [preed@underworld ~]$ git gui --version git-gui version \n> 0.21.0.66.ga5728\n> \n> best,\n> preed\n\n-----------------------\n\nI've recently found  something very similar to this using the Fork Gui.  I am tempted to report it to that project, but on seeing something similar here perhaps both Fork and Gut-Gui have a similar issue relating to Gui applications for Git?\nIf the chunk I want to stage includes characters  in some category [1], then an attempt to Stage that chunk will fail with a similar fault to what is described here.  (I don't have one available to me at the moment to check whether it is exactly this failure)\nI have recently found myself cutting and pasting some chunks of text from a PDF into my C++ source, and in particular that includes \"handed\" quotes, rather than the usual use of the usual single quote character (ie the apostrophe).  If I then use Fork's ability to Stage chunks of text containing these (or possibly not containing, but close after) I get this failure reported.\nThe work-around is to do it from the command line using \"git add --patch\", which works fine.\n\nRegards,\nRichard.\n\n[1] \nI can't be entirely sure of the category as I haven't looked for the codes yet, but it is presumably some group of characters outside the basic ASCII page.\n\nPS Sorry about posting style, I'm using Outlook and I've yet to find a way of getting it to help out by indenting everything using \">\".\n\n\n"},{"id":"397617","messageId":"20200512190054.4s3pm7543stuhu4w@yadavpratyush.com","threadId":"53450","inReplyTo":"AM0PR02MB371505CA3EE36FBDB44B3A409CBE0@AM0PR02MB3715.eurprd02.prod.outlook.com","subject":"Re: git-gui patch staging errors","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-05-12T19:00:54Z","receivedAt":"2020-05-12T19:01:03Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 12/05/20 02:27PM, Kerry, Richard wrote:\n> \n> -----Original Message-----\n> From: git-owner@vger.kernel.org <git-owner@vger.kernel.org> On Behalf Of Pratyush Yadav\n> Sent: 12 May 2020 13:15\n> To: J. Paul Reed <preed@sigkill.com>\n> Cc: git@vger.kernel.org\n> Subject: Re: git-gui patch staging errors\n> \n> Hi,\n> \n> On 11/05/20 06:07PM, J. Paul Reed wrote:\n> > \n> > Hey all,\n> > \n> > I ran into an interesting problem this week where git gui was erroring \n> > out on staging partial patches in a particular file I was working on.\n> > \n> > I worked around it with \"git add -i,\" which worked like a champ.\n> > \n> > I later realized the source file has some special characters (Unicode,\n> > probably) in it to print emojis (or colors or whatever fun animations \n> > the kids want on their terminals these days).\n> > \n> > Interestingly, lines/hunks before the first Unicode character will \n> > partial-stage appropriately, but attempting to stage any hunks/lines \n> > after the characters produces a \"Failed to stage selected line. error: \n> > patch failed ... error: ... patch does not apply\" error dialog.\n> > \n> > This can be reproduced by cloning\n> I can't reproduce it. I cloned the repo and then edited the file at line\n> 60 with a diff that looks something like:\n> \n>   diff --git a/glacierupload.sh b/glacierupload.sh\n>   index 3b956c7..265349b 100755\n>   --- a/glacierupload.sh\n>   +++ b/glacierupload.sh\n>   @@ -57,7 +57,9 @@ fi\n>    \n>    # count the number of files that begin with \"$prefix\"\n>    fileCount=$(ls -1 | grep \"^$prefix\" | wc -l)\n>   -echo \"📦 Glacier Upload with $AWS_PROFILE\"\n>   +bar\n>   +echo \"📦 Glacier s Upload with $AWS_PROFILE\"\n>   +foo\n>    echo \"Total parts to upload: \" $fileCount\n>    \n>    # get the list of part files to upload.  Edit this if you chose a different prefix in the split command\n> \n> I tried a bunch of combinations if partially staging parts of this diff, but everything worked fine without any error message. The emoji didn't render properly (though that might be my font's problem), but there were no problems in partial staging or unstaging.\n> \n> Does this example work fine on your system or does it error out? Could you give an example diff where git-gui has problems while staging? Maybe something in your config is different?\n>  \n> > Removing these control characters seems to calm git gui's indigestion \n> > on this file.\n> > \n> > [preed@underworld ~]$ git --version\n> > git version 2.26.2\n> > [preed@underworld ~]$ git gui --version git-gui version \n> > 0.21.0.66.ga5728\n> > \n> > best,\n> > preed\n> \n> -----------------------\n> \n> I've recently found  something very similar to this using the Fork Gui.  I am tempted to report it to that project, but on seeing something similar here perhaps both Fork and Gut-Gui have a similar issue relating to Gui applications for Git?\n> If the chunk I want to stage includes characters  in some category [1], then an attempt to Stage that chunk will fail with a similar fault to what is described here.  (I don't have one available to me at the moment to check whether it is exactly this failure)\n> I have recently found myself cutting and pasting some chunks of text from a PDF into my C++ source, and in particular that includes \"handed\" quotes, rather than the usual use of the usual single quote character (ie the apostrophe).  If I then use Fork's ability to Stage chunks of text containing these (or possibly not containing, but close after) I get this failure reported.\n> The work-around is to do it from the command line using \"git add --patch\", which works fine.\n\nI suspect this is an encoding mismatch, but I wonder why it doesn't show \nup on my system but does on Paul's. Anyway, I would be surprised if the \ntwo bugs in Git Gui and Fork Gui are related in any way other than two \nprogrammers making the same mistake by chance.\n \n> Regards,\n> Richard.\n> \n> [1] \n> I can't be entirely sure of the category as I haven't looked for the codes yet, but it is presumably some group of characters outside the basic ASCII page.\n> \n> PS Sorry about posting style, I'm using Outlook and I've yet to find a way of getting it to help out by indenting everything using \">\".\n\nI use Outlook 2010 for reading HTML emails at $DAYJOB. I went and \nchecked, and there is an option to use \"> \" in Options -> Mail -> \nReplies and Forwards.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"397625","messageId":"20200512204233.GA31807@sigkill.com","threadId":"53450","inReplyTo":"AM0PR02MB371505CA3EE36FBDB44B3A409CBE0@AM0PR02MB3715.eurprd02.prod.outlook.com","subject":"Re: git-gui patch staging errors","fromName":"J. Paul Reed","fromEmail":"preed@sigkill.com","sentAt":"2020-05-12T20:42:33Z","receivedAt":"2020-05-12T20:42:40Z","isPatch":false,"sender":{"key":"preed@sigkill.com","avatar":"https://gravatar.com/avatar/a6d898ae24f856b851376d22623fd35bb37134ad6df0483b84b2b135c4878237?d=mp&s=160"},"body":"\nHey Richard,\n\nUsing your test case, I still get the error (which is, specifically an\nerror dialog saying:\n\n   Failed to stage selected line.\n\n   error: patch failed: glacierupload.sh:55\n   error:glacierupload.sh: patch does not apply\n\nNote that I'm highlighting the change in the source code, then\nright-clicking it and selecting \"Stage lines for commit.\" (\"Stage hunk for\ncommit\" also results in the error.)\n\nIf I stage the entire file by clicking on it in the upper-lefthand pane,\nthings work fine.\n\nThis is a Gentoo box, so I wonder I happened to build Tcl without the\nappropriate unicode support (that one would find in most package-based\ndistros)?\n\nIn briefly digging a bit more, it would seem that git gui is foisting the\nwork onto \"git apply\" to create a patch and stage it? (If I'm reading the\nsource correctly, It looks like the error dialog title is from\nhttps://github.com/prati0100/git-gui/blob/master/lib/diff.tcl#L700\n\nand then the error strings that populate the dialog are bubbled up from git\napply.\n\nAny ideas on what would make \"git apply\" potentially choke? I wonder if it\nhas to do with a mixed file encoding?\n\nI tried setting both:\n\ncore.checkRoundTripEncoding true \ngui.encoding utf-8\n\non that repo; git gui still errored out in the same way. \n\nI also tried changing gui.encoding to utf-16; no dice...\n\nTo reiterate, git add -i worked fine...\n\nbest,\npreed\n-- \nJ. Paul Reed\nhttps://jpaulreed.com\nPGP: 0xDF8708F8\n\nOn 12 May 2020 at 14:27:22, Kerry, Richard arranged the bits on my disk to say:\n\n> \n> -----Original Message-----\n> From: git-owner@vger.kernel.org <git-owner@vger.kernel.org> On Behalf Of Pratyush Yadav\n> Sent: 12 May 2020 13:15\n> To: J. Paul Reed <preed@sigkill.com>\n> Cc: git@vger.kernel.org\n> Subject: Re: git-gui patch staging errors\n> \n> Hi,\n> \n> On 11/05/20 06:07PM, J. Paul Reed wrote:\n> > \n> > Hey all,\n> > \n> > I ran into an interesting problem this week where git gui was erroring \n> > out on staging partial patches in a particular file I was working on.\n> > \n> > I worked around it with \"git add -i,\" which worked like a champ.\n> > \n> > I later realized the source file has some special characters (Unicode,\n> > probably) in it to print emojis (or colors or whatever fun animations \n> > the kids want on their terminals these days).\n> > \n> > Interestingly, lines/hunks before the first Unicode character will \n> > partial-stage appropriately, but attempting to stage any hunks/lines \n> > after the characters produces a \"Failed to stage selected line. error: \n> > patch failed ... error: ... patch does not apply\" error dialog.\n> > \n> > This can be reproduced by cloning\n> I can't reproduce it. I cloned the repo and then edited the file at line\n> 60 with a diff that looks something like:\n> \n>   diff --git a/glacierupload.sh b/glacierupload.sh\n>   index 3b956c7..265349b 100755\n>   --- a/glacierupload.sh\n>   +++ b/glacierupload.sh\n>   @@ -57,7 +57,9 @@ fi\n>    \n>    # count the number of files that begin with \"$prefix\"\n>    fileCount=$(ls -1 | grep \"^$prefix\" | wc -l)\n>   -echo \"📦 Glacier Upload with $AWS_PROFILE\"\n>   +bar\n>   +echo \"📦 Glacier s Upload with $AWS_PROFILE\"\n>   +foo\n>    echo \"Total parts to upload: \" $fileCount\n>    \n>    # get the list of part files to upload.  Edit this if you chose a different prefix in the split command\n> \n> I tried a bunch of combinations if partially staging parts of this diff, but everything worked fine without any error message. The emoji didn't render properly (though that might be my font's problem), but there were no problems in partial staging or unstaging.\n> \n> Does this example work fine on your system or does it error out? Could you give an example diff where git-gui has problems while staging? Maybe something in your config is different?\n>  \n> > Removing these control characters seems to calm git gui's indigestion \n> > on this file.\n> > \n> > [preed@underworld ~]$ git --version\n> > git version 2.26.2\n> > [preed@underworld ~]$ git gui --version git-gui version \n> > 0.21.0.66.ga5728\n> > \n> > best,\n> > preed\n> \n> -----------------------\n> \n> I've recently found  something very similar to this using the Fork Gui.  I am tempted to report it to that project, but on seeing something similar here perhaps both Fork and Gut-Gui have a similar issue relating to Gui applications for Git?\n> If the chunk I want to stage includes characters  in some category [1], then an attempt to Stage that chunk will fail with a similar fault to what is described here.  (I don't have one available to me at the moment to check whether it is exactly this failure)\n> I have recently found myself cutting and pasting some chunks of text from a PDF into my C++ source, and in particular that includes \"handed\" quotes, rather than the usual use of the usual single quote character (ie the apostrophe).  If I then use Fork's ability to Stage chunks of text containing these (or possibly not containing, but close after) I get this failure reported.\n> The work-around is to do it from the command line using \"git add --patch\", which works fine.\n> \n> Regards,\n> Richard.\n> \n> [1] \n> I can't be entirely sure of the category as I haven't looked for the codes yet, but it is presumably some group of characters outside the basic ASCII page.\n> \n> PS Sorry about posting style, I'm using Outlook and I've yet to find a way of getting it to help out by indenting everything using \">\".\n> \n> \n"},{"id":"398485","messageId":"20200525130807.4ydporgaeva27del@yadavpratyush.com","threadId":"53450","inReplyTo":"20200512204233.GA31807@sigkill.com","subject":"Re: git-gui patch staging errors","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2020-05-25T13:08:07Z","receivedAt":"2020-05-25T13:08:17Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi,\n\nSorry for the late reply.\n\nOn 12/05/20 01:42PM, J. Paul Reed wrote:\n> \n> Hey Richard,\n\nYou replied to the wrong person ;-)\n\n> Using your test case, I still get the error (which is, specifically an\n> error dialog saying:\n> \n>    Failed to stage selected line.\n> \n>    error: patch failed: glacierupload.sh:55\n>    error:glacierupload.sh: patch does not apply\n> \n> Note that I'm highlighting the change in the source code, then\n> right-clicking it and selecting \"Stage lines for commit.\" (\"Stage hunk for\n> commit\" also results in the error.)\n> \n> If I stage the entire file by clicking on it in the upper-lefthand pane,\n> things work fine.\n> \n> This is a Gentoo box, so I wonder I happened to build Tcl without the\n> appropriate unicode support (that one would find in most package-based\n> distros)?\n> \n> In briefly digging a bit more, it would seem that git gui is foisting the\n> work onto \"git apply\" to create a patch and stage it? (If I'm reading the\n> source correctly, It looks like the error dialog title is from\n> https://github.com/prati0100/git-gui/blob/master/lib/diff.tcl#L700\n\nYou are close, but not quite there. We don't use \"git apply\" to _create_ \na patch. We create the patch ourselves, and then pass it to git apply to \nstage/unstage the lines selected.\n\nI suspect it is some encoding mismatch. Can you apply this patch below \nand send what the output is?\n\n-- 8< --\ndiff --git a/lib/diff.tcl b/lib/diff.tcl\nindex 871ad48..6226a89 100644\n--- a/lib/diff.tcl\n+++ b/lib/diff.tcl\n@@ -851,8 +851,13 @@ proc apply_or_revert_range_or_line {x y revert} {\n \t\tset first_l [$ui_diff index \"$next_l + 1 lines\"]\n \t}\n \n+\tputs \"Diff we will send to git-apply:\"\n+\tputs -nonewline \"$current_diff_header\"\n+\tputs -nonewline \"$wholepatch\"\n+\n \tif {[catch {\n \t\tset enc [get_path_encoding $current_diff_path]\n+\t\tputs \"\\nEncoding: $enc\"\n \t\tset p [eval git_write $apply_cmd]\n \t\tfconfigure $p -translation binary -encoding $enc\n \t\tputs -nonewline $p $current_diff_header\n-- >8 --\n \n> and then the error strings that populate the dialog are bubbled up from git\n> apply.\n> \n> Any ideas on what would make \"git apply\" potentially choke? I wonder if it\n> has to do with a mixed file encoding?\n\ngit-gui not preparing the patch text properly would be a prime \ncandidate.\n \n> I tried setting both:\n> \n> core.checkRoundTripEncoding true \n> gui.encoding utf-8\n> \n> on that repo; git gui still errored out in the same way. \n> \n> I also tried changing gui.encoding to utf-16; no dice...\n> \n> To reiterate, git add -i worked fine...\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"402106","messageId":"20200726221508.GA8735@sigkill.com","threadId":"53450","inReplyTo":"20200525130807.4ydporgaeva27del@yadavpratyush.com","subject":"Re: git-gui patch staging errors","fromName":"J. Paul Reed","fromEmail":"preed@sigkill.com","sentAt":"2020-07-26T22:15:08Z","receivedAt":"2020-07-26T22:15:13Z","isPatch":false,"sender":{"key":"preed@sigkill.com","avatar":"https://gravatar.com/avatar/a6d898ae24f856b851376d22623fd35bb37134ad6df0483b84b2b135c4878237?d=mp&s=160"},"body":"\nHey Pratyush,\n\nApologies for the late reply myself! Oof... been a long couple of months.\n\nSee further responses inline:\n\nlater,\npreed\n-- \nJ. Paul Reed\nhttps://jpaulreed.com\nPGP: 0xDF8708F8\n\nOn 25 May 2020 at 18:38:07, Pratyush Yadav arranged the bits on my disk to say:\n\n> Hi,\n> \n> Sorry for the late reply.\n> \n> On 12/05/20 01:42PM, J. Paul Reed wrote:\n> > \n> > Hey Richard,\n> \n> You replied to the wrong person ;-)\n\nSorry about that!\n\n> I suspect it is some encoding mismatch. Can you apply this patch below \n> and send what the output is?\n> \n> -- 8< --\n> diff --git a/lib/diff.tcl b/lib/diff.tcl\n> index 871ad48..6226a89 100644\n> --- a/lib/diff.tcl\n> +++ b/lib/diff.tcl\n> @@ -851,8 +851,13 @@ proc apply_or_revert_range_or_line {x y revert} {\n>  \t\tset first_l [$ui_diff index \"$next_l + 1 lines\"]\n>  \t}\n>  \n> +\tputs \"Diff we will send to git-apply:\"\n> +\tputs -nonewline \"$current_diff_header\"\n> +\tputs -nonewline \"$wholepatch\"\n> +\n>  \tif {[catch {\n>  \t\tset enc [get_path_encoding $current_diff_path]\n> +\t\tputs \"\\nEncoding: $enc\"\n>  \t\tset p [eval git_write $apply_cmd]\n>  \t\tfconfigure $p -translation binary -encoding $enc\n>  \t\tputs -nonewline $p $current_diff_header\n> -- >8 --\n\nHere ya go:\n\n[preed@underworld aws-glacier-multipart-upload]$ ~/checkouts/git-gui/git-gui.sh \nDiff we will send to git-apply:\ndiff --git a/glacierupload.sh b/glacierupload.sh\nindex 3b956c7..c83150c 100755\n--- a/glacierupload.sh\n+++ b/glacierupload.sh\n@@ -58,15 +58,14 @@\n # count the number of files that begin with \"$prefix\"\n fileCount=$(ls -1 | grep \"^$prefix\" | wc -l)\n echo \"ð¦ Glacier Upload with $AWS_PROFILE\"\n echo \"Total parts to upload: \" $fileCount\n \n # get the list of part files to upload.  Edit this if you chose a\n # different prefix in the split command\n files=$(ls | grep \"^$prefix\")\n \n # initiate multipart upload connection to glacier\n-echo aws glacier initiate-multipart-upload --profile $AWS_PROFILE\n--account-id - --part-size $byteSize --vault-name $vaultName\n--archive-description \"$description\"\n init=$(aws glacier initiate-multipart-upload --profile $AWS_PROFILE\n--account-id - --part-size $byteSize --vault-name $vaultName\n--archive-description \"$description\")\n \n echo \"---------------------------------------\"\n # xargs trims off the quotes\n # jq pulls out the json element titled uploadId\n\nEncoding: utf-8\n\nThis is probably expected, but to be clear: with this patch, I do still get\nthe error popup in the gui (\"Failed to stage selected line; error: patch\nfailed: glacierupload:58 error: glacierupload.sh patch does not apply\"\n"}]}