{"thread":{"id":"7229","subject":"[PATCH] Remove tab character from conflicted files list part of the merge message","startedAt":"2007-03-13T13:09:43Z","lastAt":"2007-03-14T09:26:15Z","messageCount":6,"participants":["Andy Parkins","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"36995","messageId":"200703131309.43767.andyparkins@gmail.com","threadId":"7229","inReplyTo":null,"subject":"[PATCH] Remove tab character from conflicted files list part of the merge message","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-03-13T13:09:43Z","receivedAt":"2007-03-13T13:09:43Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Merge can generate sections like this:\n Conflicts:\n   file1\n   file2\n   file3\nThe filenames were moved forward by embedding a tab.  Tabs are variable\nwidth, so there is no guarantee that the appearance would be the same on\ndifferent systems.  In this case the tabs are being used for formatting,\nfor formatting, spaces are better.\n\nThis patch simply swaps the tab for four spaces in the \"Conflicts:\"\nsection.\n\nSigned-off-by: Andy Parkins <andyparkins@gmail.com>\n---\nThe reason this makes a difference (to me), is that I often edit the\nconflict section to say what the resolution of the conflict was,  I\nhappen to have expandtabs set for git log messages (to guarantee they\nlook the same regardless of the viewer's settings), and hadn't noticed\nthat git was putting tabs into the log message for me.\n\nSo what I thought I was formatting as (for example)\n\nConflicts:\n    file.c\n     * Chose upstream version over mine, but integrated my small typo fix.\n\nWas appearing in the log display as\n\nConflicts:\n        file.c\n     * Chose upstream version over mine, but integrated my small typo fix.\n\nWhich isn't how I'd intended at all.\n\nThe fix is of course - no tabs.  Tabs for formatting is always going to cause\ntrouble, so this patch swaps the tab for spaces.\n\nI don't think the actual number of spaces is important (I chose 4), as long\nas there are no tab-surprises in the log message (unless the user put them\nthere themselves of course - but that's their own fault).\n\n\n git-merge.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 6ce62c8..a03d22b 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -482,7 +482,7 @@ else\n Conflicts:\n '\n \t\tgit ls-files --unmerged |\n-\t\tsed -e 's/^[^\t]*\t/\t/' |\n+\t\tsed -e 's/^[^\t]*\t/    /' |\n \t\tuniq\n \t} >>\"$GIT_DIR/MERGE_MSG\"\n \tif test -d \"$GIT_DIR/rr-cache\"\n-- \n1.5.0.2.205.g74e20\n"},{"id":"36998","messageId":"Pine.LNX.4.63.0703131539430.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7229","inReplyTo":"200703131309.43767.andyparkins@gmail.com","subject":"Re: [PATCH] Remove tab character from conflicted files list part of the merge message","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-13T14:42:03Z","receivedAt":"2007-03-13T14:42:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Mar 2007, Andy Parkins wrote:\n\n> So what I thought I was formatting as (for example)\n> \n> Conflicts:\n>     file.c\n>      * Chose upstream version over mine, but integrated my small typo fix.\n> \n> Was appearing in the log display as\n> \n> Conflicts:\n>         file.c\n>      * Chose upstream version over mine, but integrated my small typo fix.\n> \n> Which isn't how I'd intended at all.\n> \n> The fix is of course - no tabs.  Tabs for formatting is always going to \n> cause trouble, so this patch swaps the tab for spaces.\n\nAnd of course the next guy will have the reverse problem, because he typed \n<TAB><SPACE> instead of <SPACE>*5. What do you tell _him_ after \"fixing\" \nthis issue? \"Do as _I_ do\"?\n\nCiao,\nDscho\n"},{"id":"36999","messageId":"200703131518.54076.andyparkins@gmail.com","threadId":"7229","inReplyTo":"Pine.LNX.4.63.0703131539430.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Remove tab character from conflicted files list part of the merge message","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-03-13T15:18:39Z","receivedAt":"2007-03-13T15:18:39Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 March 13 14:42, Johannes Schindelin wrote:\n\n> And of course the next guy will have the reverse problem, because he typed\n> <TAB><SPACE> instead of <SPACE>*5. What do you tell _him_ after \"fixing\"\n> this issue? \"Do as _I_ do\"?\n\nThat's basically what you're telling me by saying I can't have that change.  \nBut as it happens, no I wasn't doing this as a \"do it my way\" kind of thing.  \nAs it happens I /like/ tabs in my source code.  However, this isn't source \ncode.\n\nLet's forget my own problem - I was only offering it as backstory.  Consider a \nlog message with no additional comments about the conflicts.  The current \noutput looks like this:\n\nConflicts:\n\\tfile1.c\n\\tfile2.c\n\nNow, view this message on the terminal with git-log, now view it in gitk, now \nview it in qgit, now view it in git-gui.  All of these could be set for \ndifferent tab widths, and will hence display the log message differently.\n\ngit-merge has to pick one or the other - tabs or spaces - for me, I'd rather \npick the one that means the message displays the same regardless of what the \nauthor of the viewer/terminal thought tabs should be set to that day.  I'd \nalso prefer that when others view the log there is more chance that they'll \nsee the same as I do.\n\nOf course, there is nothing we can do if a log message author chooses to put \ntabs in - but at least if git uses spaces the choice isn't already made.\n\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"37001","messageId":"Pine.LNX.4.63.0703131643590.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7229","inReplyTo":"200703131518.54076.andyparkins@gmail.com","subject":"Re: [PATCH] Remove tab character from conflicted files list part of the merge message","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-13T15:44:28Z","receivedAt":"2007-03-13T15:44:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Mar 2007, Andy Parkins wrote:\n\n> Of course, there is nothing we can do if a log message author chooses to \n> put tabs in - but at least if git uses spaces the choice isn't already \n> made.\n\nHuh? s/isn't/is/, right?\n\nCiao,\nDscho\n"},{"id":"37007","messageId":"200703131622.53559.andyparkins@gmail.com","threadId":"7229","inReplyTo":"Pine.LNX.4.63.0703131643590.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Remove tab character from conflicted files list part of the merge message","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-03-13T16:22:51Z","receivedAt":"2007-03-13T16:22:51Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 March 13 15:44, Johannes Schindelin wrote:\n\n> Huh? s/isn't/is/, right?\n\n<sheepish grin>\n\nYes, it's impressive how I can render a point meaningless by not rereading \nbefore I send.\n\n\n\nAndy\n\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"37069","messageId":"7vslc8ch1k.fsf@assigned-by-dhcp.cox.net","threadId":"7229","inReplyTo":"Pine.LNX.4.63.0703131539430.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Remove tab character from conflicted files list part of the merge message","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-14T09:26:15Z","receivedAt":"2007-03-14T09:26:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Tue, 13 Mar 2007, Andy Parkins wrote:\n> ...\n>> Was appearing in the log display as\n>> \n>> Conflicts:\n>>         file.c\n>>      * Chose upstream version over mine, but integrated my small typo fix.\n>> \n>> Which isn't how I'd intended at all.\n>> \n>> The fix is of course - no tabs.  Tabs for formatting is always going to \n>> cause trouble, so this patch swaps the tab for spaces.\n>\n> And of course the next guy will have the reverse problem, because he typed \n> <TAB><SPACE> instead of <SPACE>*5. What do you tell _him_ after \"fixing\" \n> this issue? \"Do as _I_ do\"?\n\nActually, tabs are for indent and everybody knows that.  In\nAndy's example, I think the bug is in typing spaces before the\nexplanatory message \"* Chose upstream...\".  An obvious fix is to\ntype a tab instead.\n\nNon-email pretty formats give 4-space margin at the left, and it\nindeed is annoying if you drew ascii art in the commit message\nand later discover you mistakenly used tab when you meant\nspaces.\n\nHaving said that, I do not have a strong feeling either way.  If\nI have to choose, I would probably replace the TAB with two\nspaces, if only to match merge.summary output:\n\n        Merge branch 'blah'\n\n        * blah:\n          third commit on blah topic\n          second commit on blah topic\n          first commit on blah topic\n\n        Conflicts:\n\n          blah.c\n          xyzzy.h\n"}]}