{"thread":{"id":"44420","subject":"ignore blank line removals","startedAt":"2016-11-03T15:57:29Z","lastAt":"2016-11-15T19:32:54Z","messageCount":4,"participants":["John Rood","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"305358","messageId":"CALj-rGcSrbAiyxPOYD1KCacK_gqi3T5_R=e0H_UfBTqLb5VRmg@mail.gmail.com","threadId":"44420","inReplyTo":null,"subject":"ignore blank line removals","fromName":"John Rood","fromEmail":"mr.john.rood@gmail.com","sentAt":"2016-11-03T15:57:23Z","receivedAt":"2016-11-03T15:57:29Z","isPatch":false,"sender":{"key":"mr.john.rood@gmail.com","avatar":"https://gravatar.com/avatar/7d2af963b361d158a37938d662661cc74f00437b86ed837ab2bf45fb28bbfe3b?d=mp&s=160"},"body":"If the contents of a file initially are:\n  one\n\n  three\nand on branch A there is a commit, removing the blank line:\n  one\n  three\nand on branch B there is a commit, adding 'two':\n  one\n  two\n  three\nNormally, if you try to merge A into B (or B into A), git recognizes a\ndecision needs to be made between removing the second line or add\n\"two\" to the second line. It would be convenient to have a merge\nstrategy that defaults to the latter in cases where the removed line\nwas a blank line (or a line containing only whitespace) ...something\nlike -Xignore-blank-line-removals.\n"},{"id":"305971","messageId":"CALj-rGdRDa0EU6AeMHWYketr5QBOnV7-3RKraiuPCk=Aepz=pQ@mail.gmail.com","threadId":"44420","inReplyTo":"CALj-rGcSrbAiyxPOYD1KCacK_gqi3T5_R=e0H_UfBTqLb5VRmg@mail.gmail.com","subject":"Re: ignore blank line removals","fromName":"John Rood","fromEmail":"mr.john.rood@gmail.com","sentAt":"2016-11-15T17:56:58Z","receivedAt":"2016-11-15T17:57:04Z","isPatch":false,"sender":{"key":"mr.john.rood@gmail.com","avatar":"https://gravatar.com/avatar/7d2af963b361d158a37938d662661cc74f00437b86ed837ab2bf45fb28bbfe3b?d=mp&s=160"},"body":"Is there any push-back on this, or is there a backlog that we can add\nthis feature to?\n\nOn Thu, Nov 3, 2016 at 10:57 AM, John Rood <mr.john.rood@gmail.com> wrote:\n> If the contents of a file initially are:\n>   one\n>\n>   three\n> and on branch A there is a commit, removing the blank line:\n>   one\n>   three\n> and on branch B there is a commit, adding 'two':\n>   one\n>   two\n>   three\n> Normally, if you try to merge A into B (or B into A), git recognizes a\n> decision needs to be made between removing the second line or add\n> \"two\" to the second line. It would be convenient to have a merge\n> strategy that defaults to the latter in cases where the removed line\n> was a blank line (or a line containing only whitespace) ...something\n> like -Xignore-blank-line-removals.\n"},{"id":"305975","messageId":"xmqqr36ctw47.fsf@gitster.mtv.corp.google.com","threadId":"44420","inReplyTo":"CALj-rGdRDa0EU6AeMHWYketr5QBOnV7-3RKraiuPCk=Aepz=pQ@mail.gmail.com","subject":"Re: ignore blank line removals","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-11-15T18:51:20Z","receivedAt":"2016-11-15T18:51:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Rood <mr.john.rood@gmail.com> writes:\n\n> On Thu, Nov 3, 2016 at 10:57 AM, John Rood <mr.john.rood@gmail.com> wrote:\n>> If the contents of a file initially are:\n>>   one\n>>\n>>   three\n>> and on branch A there is a commit, removing the blank line:\n>>   one\n>>   three\n>> and on branch B there is a commit, adding 'two':\n>>   one\n>>   two\n>>   three\n>> Normally, if you try to merge A into B (or B into A), git recognizes a\n>> decision needs to be made between removing the second line or add\n>> \"two\" to the second line. It would be convenient to have a merge\n>> strategy that defaults to the latter in cases where the removed line\n>> was a blank line (or a line containing only whitespace) ...something\n>> like -Xignore-blank-line-removals.\n>\n> Is there any push-back on this, or is there a backlog that we can add\n> this feature to?\n\nIf you mean by \"push-back\" objections that say \"this feature is evil\nand should not be added to Git, ever\", I do not think we saw any on\nthe list.  The lack of response is most likely that everybody\nthought \"Meh.\" aka \"It is not useful/interesting/valuable enough\nfeature to bother discussing.\"\n\nOne thing I wondered was what you would want if the contents were\none/three without blank, A added blank between the two and B\nreplaced blank with two.  As your example shows, in the filetype you\nare dealing with, a blank line has no significant meaning (otherwise\nyou won't be ignoring the change A made to remove the blank in your\noriginal example).  The outcome desired by you may be one/two/three\nwithout any blank in that case because of that.  Which would lead to\nthe suspicion that ignore-blank-line-removals is not a good general\nfeature (i.e. in this other example, you want to ignore blank line\naddition).  Which further leads to the suspicion that the desire you\nexpressed in the original post is not well thought through to be a\nuseful specifification to build anything out of (yet), but is merely\na potentially interesting discussion starter.  And nobody so far\nfound it interesting enough to spend time discussing it further to\nmake the wish detailed enough to be called a \"design\" of a new\nfeature.\n\nHaving said all that.\n\nI suspect that you may not have to make any change to Git to do what\nyou want; can't you just use the 'merge' attribute with a custom\n3-way merge driver that removes an empty line?\n\n"},{"id":"305978","messageId":"CALj-rGeXEQ6wtxHq3ZN29AD5AjNExrF7RUbvhS=oBRtqaQ-n=Q@mail.gmail.com","threadId":"44420","inReplyTo":"xmqqr36ctw47.fsf@gitster.mtv.corp.google.com","subject":"Re: ignore blank line removals","fromName":"John Rood","fromEmail":"mr.john.rood@gmail.com","sentAt":"2016-11-15T19:32:48Z","receivedAt":"2016-11-15T19:32:54Z","isPatch":false,"sender":{"key":"mr.john.rood@gmail.com","avatar":"https://gravatar.com/avatar/7d2af963b361d158a37938d662661cc74f00437b86ed837ab2bf45fb28bbfe3b?d=mp&s=160"},"body":"Yes that makes sense.\nI was not aware of custom merge drivers, but indeed that may address\nmy situation. I'll look into it.\nThanks!\n\nOn Tue, Nov 15, 2016 at 12:51 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> John Rood <mr.john.rood@gmail.com> writes:\n>\n>> On Thu, Nov 3, 2016 at 10:57 AM, John Rood <mr.john.rood@gmail.com> wrote:\n>>> If the contents of a file initially are:\n>>>   one\n>>>\n>>>   three\n>>> and on branch A there is a commit, removing the blank line:\n>>>   one\n>>>   three\n>>> and on branch B there is a commit, adding 'two':\n>>>   one\n>>>   two\n>>>   three\n>>> Normally, if you try to merge A into B (or B into A), git recognizes a\n>>> decision needs to be made between removing the second line or add\n>>> \"two\" to the second line. It would be convenient to have a merge\n>>> strategy that defaults to the latter in cases where the removed line\n>>> was a blank line (or a line containing only whitespace) ...something\n>>> like -Xignore-blank-line-removals.\n>>\n>> Is there any push-back on this, or is there a backlog that we can add\n>> this feature to?\n>\n> If you mean by \"push-back\" objections that say \"this feature is evil\n> and should not be added to Git, ever\", I do not think we saw any on\n> the list.  The lack of response is most likely that everybody\n> thought \"Meh.\" aka \"It is not useful/interesting/valuable enough\n> feature to bother discussing.\"\n>\n> One thing I wondered was what you would want if the contents were\n> one/three without blank, A added blank between the two and B\n> replaced blank with two.  As your example shows, in the filetype you\n> are dealing with, a blank line has no significant meaning (otherwise\n> you won't be ignoring the change A made to remove the blank in your\n> original example).  The outcome desired by you may be one/two/three\n> without any blank in that case because of that.  Which would lead to\n> the suspicion that ignore-blank-line-removals is not a good general\n> feature (i.e. in this other example, you want to ignore blank line\n> addition).  Which further leads to the suspicion that the desire you\n> expressed in the original post is not well thought through to be a\n> useful specifification to build anything out of (yet), but is merely\n> a potentially interesting discussion starter.  And nobody so far\n> found it interesting enough to spend time discussing it further to\n> make the wish detailed enough to be called a \"design\" of a new\n> feature.\n>\n> Having said all that.\n>\n> I suspect that you may not have to make any change to Git to do what\n> you want; can't you just use the 'merge' attribute with a custom\n> 3-way merge driver that removes an empty line?\n>\n"}]}