{"thread":{"id":"55563","subject":"idea to tweak wording of CRLF warning","startedAt":"2021-04-26T17:32:03Z","lastAt":"2021-04-26T21:43:34Z","messageCount":3,"participants":["mark.yagnatinsky@barclays.com","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"422987","messageId":"AM6PR01MB4166BC567911A05016DE2918F9429@AM6PR01MB4166.eurprd01.prod.exchangelabs.com","threadId":"55563","inReplyTo":null,"subject":"idea to tweak wording of CRLF warning","fromName":"","fromEmail":"mark.yagnatinsky@barclays.com","sentAt":"2021-04-26T17:31:53Z","receivedAt":"2021-04-26T17:32:03Z","isPatch":false,"sender":{"key":"mark.yagnatinsky@barclays.com","avatar":null},"body":"If I'm on Windows and I \"git add\" a file with LF line endings, I get the following misleading warning:\n\nwarning: LF will be replaced by CRLF in t.txt\n\nThis makes me think something is about to happen \"now\" but actually the warning is about what will happen \"later\".\nIn particular, the file will be committed with LF, but git may convert to CRLF when it comes time to check out the file.\nThus, I propose to add the words \"on checkout\" somewhere in the warning message, to emphasize that the conversion will occur later instead of now.\nE.g., \"warning, LF will be replaced by CRLF on next checkout of t.txt\" or something along those lines.\n\nThis suggestion was inspired by the amazingly detailed answer to my question on Stack overflow, without which I would have been badly confused:\nhttps://stackoverflow.com/questions/67199433/git-line-endings-behavior-does-not-match-documentation\n\n\n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\n�This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer.\n\nFor important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; https://www.investmentbank.barclays.com/disclosures/barclays-global-markets-disclosures.html regarding our standard terms for the Investment Bank of Barclays where we trade with you in principal-to-principal wholesale markets transactions; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com.�  \n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\nIf you are incorporated or operating in Australia, please see https://www.home.barclays/disclosures/importantapacdisclosures.html for important disclosure.\n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\nHow we use personal information  see our privacy notice https://www.investmentbank.barclays.com/disclosures/personalinformationuse.html \n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\n"},{"id":"423041","messageId":"20210426205510.snoqwdipq47fkhbb@tb-raspi4","threadId":"55563","inReplyTo":"AM6PR01MB4166BC567911A05016DE2918F9429@AM6PR01MB4166.eurprd01.prod.exchangelabs.com","subject":"Re: idea to tweak wording of CRLF warning","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2021-04-26T20:55:10Z","receivedAt":"2021-04-26T20:55:14Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Mon, Apr 26, 2021 at 05:31:53PM +0000, mark.yagnatinsky@barclays.com wrote:\n> If I'm on Windows and I \"git add\" a file with LF line endings, I get the following misleading warning:\n>\n> warning: LF will be replaced by CRLF in t.txt\n>\n> This makes me think something is about to happen \"now\" but actually the warning is about what will happen \"later\".\n> In particular, the file will be committed with LF, but git may convert to CRLF when it comes time to check out the file.\n> Thus, I propose to add the words \"on checkout\" somewhere in the warning message, to emphasize that the conversion will occur later instead of now.\n> E.g., \"warning, LF will be replaced by CRLF on next checkout of t.txt\" or something along those lines.\n>\n> This suggestion was inspired by the amazingly detailed answer to my question on Stack overflow, without which I would have been badly confused:\n> https://stackoverflow.com/questions/67199433/git-line-endings-behavior-does-not-match-documentation\n>\n\nThanks for posting here.\n\nI think/hope that a couple of answers given on stackoverflow could have digged out from here\n(or may be they where ?)\n\nAbout the gitattributes:\nhttps://git-scm.com/docs/gitattributes\n\nOut of curiosity, please allow a question:\nIs that material too hard to understand, or too hard do find ?\nOr does it take too much time to read ?\n\nBack to the confusing message.\nIt is confusing even to me.\n\n... I like that message suggestion. You might consider offering it to the Git mailing list as a patch to Git ...\n\nIt may be, that someone sends a patch.\nHowever, as a very first step: \"or something along those lines.\" needs to be defined.\n\nWhich short text would have explained the whole story better ?\n\nThe attributes with \"* text=auto\" means different things:\nFiles with CRLF in the working tree will get LF in the index,\nwhen they are commited/added.\n\ngit checkout t.txt (which has LF) in your scenario\nwill not checkout the file with CRLF rigth now.\nIt is is not changed in the index.\n\nA checkout will only change the working tree if you checkout t.txt with\ndifferent content - checkout a different branch, switch to a tag,\nor checkout a commit id.\n\nOr if you delete it in the working tree, and check it out again.\n\nIn that sense: Suggestions (the complete new text) of the warning message\nare welcome.\n"},{"id":"423046","messageId":"AM6PR01MB4166CB21A23BC78D1757D918F9429@AM6PR01MB4166.eurprd01.prod.exchangelabs.com","threadId":"55563","inReplyTo":"20210426205510.snoqwdipq47fkhbb@tb-raspi4","subject":"RE: idea to tweak wording of CRLF warning","fromName":"","fromEmail":"mark.yagnatinsky@barclays.com","sentAt":"2021-04-26T21:43:24Z","receivedAt":"2021-04-26T21:43:34Z","isPatch":false,"sender":{"key":"mark.yagnatinsky@barclays.com","avatar":null},"body":"> Is that material too hard to understand, or too hard to find?\n> Or does it take too much time to read?\n\nEasy enough to find; first place I looked.\nToo hard to connect the stuff I was reading to the error message I was getting.\nI saw things like \"git will normalize CRLF to LF\", while git itself seems to be warning me that it will normalize in the exact opposite direction, when I'm already committing LF.\n\n> However, as a very first step: \"or something along those lines.\" needs to be defined.\n> Which short text would have explained the whole story better?\n\nIf the goal here is merely to explain the whole story \"better\", that is easy.\nAdd the words \"on checkout\" somewhere near the end of the existing error message.\n\n> git checkout t.txt (which has LF) in your scenario will not checkout the file with CRLF rigth now.\nThis shows that \"better\" is not the same as \"perfect\".\nMy suggestion is indeed a bit misleading in that department.\nBut I think it is less misleading than the current wording.\nIt doesn't take the user all the way to the final destination, but does point them in the right direction.\nThe current wording pointed me in the wrong direction.\nI think, but obviously can't prove, that if the words \"later\" or \"at checkout\" had been in the\nerror message, it would have been clear enough that I would have eventually figured out what's going\non without having to ask on stack overflow.\n\n> In that sense: Suggestions (the complete new text) of the warning message are welcome.\nOkay this is actually kind of hard, since there's a tension between being concise and being precise, or at least not lying too much.\n\nSomething like this might be a bit too verbose, but tells only one white lie (\"will be converted\" should really be \"will be converted unless your git settings (git config plus git attributes) change by then\"):\n\nwarning: t.txt will be committed with LF line endings, but will be converted to CRLF in your working directory the next time this file needs to be checked out.\nUntil then, it will have keep its LF line endings in your working directory.\n\nAlternatively, here's a less drastic change that's more concise but perhaps still \"hand-holdy\" enough:\n\nwarning: LF will be replaced by CRLF in t.txt the next time this file is checked out.\nUntil then, it will have keep its LF line endings in your working directory.\n\nI could come up with more variations on this theme but I think you see what I'm trying to gesture at.\n\nThoughts?\n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\nThis message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer.\n\nFor important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; https://www.investmentbank.barclays.com/disclosures/barclays-global-markets-disclosures.html regarding our standard terms for the Investment Bank of Barclays where we trade with you in principal-to-principal wholesale markets transactions; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com.  \n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\nIf you are incorporated or operating in Australia, please see https://www.home.barclays/disclosures/importantapacdisclosures.html for important disclosure.\n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\nHow we use personal information  see our privacy notice https://www.investmentbank.barclays.com/disclosures/personalinformationuse.html \n_________________________________________________________________________________________________________________________________________________________________________________________________________________________________\n"}]}