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

Re: [PATCH] git diff -D: omit the preimage of deletes

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 3, 2011, 12:51 UTC
Message-ID
<4D986D4B.80208@drmicha.warpmail.net>
In-Reply-To
<7vbp0pg4d7.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 01.04.2011 21:26:
Show 30 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> diff --git a/diff.c b/diff.c
>> index 5422c43..9ea1de1 100644
>> --- a/diff.c
>> +++ b/diff.c
>> @@ -4205,7 +4211,7 @@ void diffcore_std(struct diff_options *options)
>>  			diffcore_break(options->break_opt);
>>  		if (options->detect_rename)
>>  			diffcore_rename(options);
>> -		if (options->break_opt != -1)
>> +		if (options->break_opt != -1 && !options->irreversible_delete)
>>  			diffcore_merge_broken();
>>  	}
>>  	if (options->pickaxe)
> 
> Thanks, but this hunk looks fishy.
> 
> What happens to a path that was tentatively broken for the purpose of
> rename detection with -B -M (break to match with another file) but then
> found to be with no counterpart after all after running diffcore_rename(),
> which now needs to get merged back?  Such a path is shown as a normal
> patch when the dissimlarity between the preimage and postimage is not
> large enough and merge-broken is the step that combines such a broken but
> unmatched pair back.
> 
> I would have expected that the patch relative to jc/diff-irreversible-delete
> topic would consist only of changes to diff.c:emit_rewrite_diff(), docs
> and tests.
> 

I think I misunderstood what you intended "-B -D" to do (and I even didn't know about -B until -D came up; my understanding of "-B" is still fishy). I just didn't want to let this die before 1.7.5. Thanks for taking this up and clarifying it.

Michael
Previous: Junio C HamanoNext: Jeff King
Message 10 of 13 in “What's cooking in git.git (Mar 2011, #06; Thu, 31)”
  1. Junio C HamanoMar 31, 2011
  2. Let's make our cycles shorterJunio C Hamano, Mar 31, 2011
  3. Sebastien DoucheApr 25, 2011
  4. Junio C HamanoApr 25, 2011
  5. Sebastien DoucheJun 13, 2011
  6. git diff -D: omit the preimage of deletesMichael J Gruber, Apr 1, 2011
  7. Junio C HamanoApr 1, 2011
  8. Junio C HamanoApr 3, 2011
  9. Junio C HamanoApr 3, 2011
  10. Michael J GruberApr 3, 2011
  11. Jeff KingApr 1, 2011
  12. Junio C HamanoApr 1, 2011
  13. Jeff KingApr 1, 2011

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.