From: Ramsay Jones Date: Tue, 26 Jan 2016 16:43:44 GMT Subject: Re: [PATCH v2 1/1] merge-file: let conflict markers match end-of-line style of the context Message-ID: <56A7A240.7000102@ramsayjones.plus.com> In-Reply-To: On 26/01/16 08:54, Johannes Schindelin wrote: > Hi Ramsay, [snip] >> >> But you are only testing 3/4 conflict markers end in CR/LF. :-D > > The fact that ||| markers are present is the fault of previous test cases. > I tried to make a point of *not* relying on such a side effect (so as to > debug failures quicker by commenting out all previous test cases). > > So the fact that I am testing only 3 of the 4 conflict markers is very > much by design. I'm sorry, but I don't understand what you are trying to say here. :( > >>> Read: I am uncertain that I want to spend the additional lines on >>> testing more than actually necessary. >> >> If the here doc is too verbose for you, how about something like this >> (totally untested): >> >> test $(tr "\015" Q |].*Q$" | wc -l) -eq 4 >> >> instead? > > Hmm. I do not see the benefit over grepping for `txtQ$` it's essentially > the same. Well, as I said 'totally untested', but it _should_ be different. ;-) The output from the 'tr "\015" Q >>>>>> crlf-diff2.txtQ so that your 'grep "\\.txtQ$"' should select these lines: <<<<<<< crlf-diff1.txtQ ||||||| crlf-orig.txtQ >>>>>>> crlf-diff2.txtQ whereas my 'grep "^[<=>|].*Q$"' should select these lines: <<<<<<< crlf-diff1.txtQ ||||||| crlf-orig.txtQ =======Q >>>>>>> crlf-diff2.txtQ (ie. select all 4 conflict markers). > >> HTH > > How the hell? :-D Hope That Helps. > >> ATB, >> Ramsay Jones > > Authorization to Buy? All The Best. ATB, Ramsay Jones