Re: git diff --patience
От | Kevin Grittner |
---|---|
Тема | Re: git diff --patience |
Дата | |
Msg-id | 4CA5A6B202000025000362BD@gw.wicourts.gov обсуждение исходный текст |
Ответ на | Re: git diff --patience (Gurjeet Singh <singh.gurjeet@gmail.com>) |
Ответы |
Re: git diff --patience
|
Список | pgsql-hackers |
Gurjeet Singh <singh.gurjeet@gmail.com> wrote: > Alvaro Herrera <alvherre@commandprompt.com>wrote: >> There is a very simple example posted on some of the blog posts >> that goes something like >> >> aaaaaaaa >> aaaaaaaa >> aaaaaaaa >> bbbbbbbb >> bbbbbbbb >> bbbbbbbb >> xyz >> >> and the "xyz" is moved to the front. In this corner case, the >> patience diff is a lot worse. >> > > Sorry, but that example didn't make much sense to me. Can you > please elaborate, or maybe share those blog posts you are referring to. I tried it out. Here are the results: git diff --color diff --git a/a1 b/a1 index bd0586b..32736d1 100644 --- a/a1 +++ b/a1 @@ -1,7 +1,7 @@ +xyzaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbb -xyz git diff --color --patience diff --git a/a1 b/a1 index bd0586b..32736d1 100644 --- a/a1 +++ b/a1 @@ -1,7 +1,7 @@ -aaaaaaaa -aaaaaaaa -aaaaaaaa -bbbbbbbb -bbbbbbbb -bbbbbbbbxyz +aaaaaaaa +aaaaaaaa +aaaaaaaa +bbbbbbbb +bbbbbbbb +bbbbbbbb This is because lines which only occur once in a file are the "anchors" around which lines which occur multiple times move -- after keeping intact any leading and trailing lines which match between the files. An interesting exercise it so think about what real-life lines you could have which would have multiple occurrences in this pattern, and think about whether you would then prefer the --patience output, especially if this were part of a larger file. Even in this supposed "worst case" example, I'm not at all sure I wouldn't prefer --patience, personally, even though more lines are flagged. -Kevin
В списке pgsql-hackers по дате отправления: