git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git merge improvement - "remove spaces/tabs from beginning of line and end of line"
@ 2021-08-10 22:25 Dušan Červenka | ACRIOS
  2021-08-11 23:12 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Dušan Červenka | ACRIOS @ 2021-08-10 22:25 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

Greetings,

i was interested if you already considered this as feature, or if you may 
consider this as good feature. I know that during merge every character need 
be considered. And at the end it will be. I described my problem to another 
developer and he named this feature as good noise merge reduction.


Issue:
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.

 

Thank you very much for your opinion.

-- 

 

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 


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git merge improvement - "remove spaces/tabs from beginning of line and end of line"
  2021-08-10 22:25 Git merge improvement - "remove spaces/tabs from beginning of line and end of line" Dušan Červenka | ACRIOS
@ 2021-08-11 23:12 ` Jeff King
  2021-08-13  6:57   ` Dušan Červenka | ACRIOS
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2021-08-11 23:12 UTC (permalink / raw)
  To: Dušan Červenka | ACRIOS; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git merge improvement - "remove spaces/tabs from beginning of line and end of line"
  2021-08-11 23:12 ` Jeff King
@ 2021-08-13  6:57   ` Dušan Červenka | ACRIOS
  0 siblings, 0 replies; 3+ messages in thread
From: Dušan Červenka | ACRIOS @ 2021-08-13  6:57 UTC (permalink / raw)
  To: Jeff King; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

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:
> 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 


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-13  6:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 22:25 Git merge improvement - "remove spaces/tabs from beginning of line and end of line" Dušan Červenka | ACRIOS
2021-08-11 23:12 ` Jeff King
2021-08-13  6:57   ` Dušan Červenka | ACRIOS

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).