git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git merge improvement - "remove spaces/tabs from beginning of line and end of line"

From
DADušan Červenka | ACRIOS <cervenka@acrios.com>
Date
Aug 13, 2021, 06:57 UTC
Message-ID
<2184244.VR8AQ8LyVX@kuhadatko-gl552vw>
In-Reply-To
<YRRZdmlfBjJTUimj@coredump.intra.peff.net>

Hi, Thank you for your respond. Actually in my case we have code formatted before pushing, so we shouldn't have issues with trailing spaces (i mentioned them as i they are doing some noise in comparison too). The issue is more about spaces on beginning of line. Changing indention of code may result in prepending code if some line with old indention match some line with indented block of code.

On štvrtok 12. augusta 2021 1:12:54 CEST Jeff King wrote:
Show 21 quoted lines
> On Wed, Aug 11, 2021 at 12:25:10AM +0200, Dušan Červenka | ACRIOS wrote:
> > Several times it happened that i added or removed condition in code but a
> > lot of code stayed. Only indention was changed. If there was also other
> > change on some line i had a conflict. And several times it happened that
> > a lot of code was appended instead of replaced (if some line was similar
> > with same indention). This made merging messed and confusing. If we would
> > remove this spaces noise from beginning and end, we could get more
> > acquired merge. What do you think? Of course this is only for looking for
> > most matching lines. At the end the code should keep all necessary
> > spaces.
> 
> Have you looked at the whitespace options you can pass to the
> merge-recursive strategy?  E.g.:
> 
>   git merge -Xignore-space-at-eol some-branch
> 
> It may not do quite what you want, though (it sounds like you are more
> interested in matching context with whitespace changes than ignoring
> spaces on modified lines).
> 
> -Peff
-- 
 

Dušan Červenka | Software Developer 
a: ACRIOS Systems s.r.o. | Razinova 2257/5 | Ostrava 700 30 
e: cervenka@acrios.com | w: www.acrios.com 
m: +421 918 715 117 
Previous: Jeff King
Message 3 of 3 in “Git merge improvement - "remove spaces/tabs from beginning of line and end of line"”
  1. Dušan Červenka | ACRIOSAug 10, 2021
  2. Jeff KingAug 11, 2021
  3. Dušan Červenka | ACRIOSAug 13, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.