You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2014/08/21 18:45:37 UTC

RE: svn commit: r1619476 - /subversion/trunk/subversion/libsvn_client/diff.c


> -----Original Message-----
> From: julianfoad@apache.org [mailto:julianfoad@apache.org]
> Sent: donderdag 21 augustus 2014 18:27
> To: commits@subversion.apache.org
> Subject: svn commit: r1619476 -
> /subversion/trunk/subversion/libsvn_client/diff.c
> 
> Author: julianfoad
> Date: Thu Aug 21 16:27:28 2014
> New Revision: 1619476
> 
> URL: http://svn.apache.org/r1619476
> Log:
> Fix missing diff header lines when diffing a file that has only property
> changes.
> 
> * subversion/libsvn_client/diff.c
>   (diff_content_changed): If the text diff was empty, assume no header was
>     printed (unless we printed one explicitly).
> 
> Modified:
>     subversion/trunk/subversion/libsvn_client/diff.c
> 
> Modified: subversion/trunk/subversion/libsvn_client/diff.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/di
> ff.c?rev=1619476&r1=1619475&r2=1619476&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_client/diff.c (original)
> +++ subversion/trunk/subversion/libsvn_client/diff.c Thu Aug 21 16:27:28
> 2014
> @@ -853,8 +853,9 @@ diff_content_changed(svn_boolean_t *wrot
>                                     NULL, NULL, scratch_pool));
>          }
> 
> -      /* We have a printed a diff for this path, mark it as visited. */
> -      *wrote_header = TRUE;
> +      /* If we have printed a diff for this path, mark it as visited. */
> +      if (exitcode == 1)
> +        *wrote_header = TRUE;

I don't think we can really trust the exit code of any diff tool, to imply whether it reported a diff or not?

We certainly don't document any of these dependencies.

Does this even work for our own diff tools?

	Bert


Re: svn commit: r1619476 - /subversion/trunk/subversion/libsvn_client/diff.c

Posted by Julian Foad <ju...@btopenworld.com>.
Bert Huijben wrote:
>>  URL: http://svn.apache.org/r1619476
>>  Log:
>>  Fix missing diff header lines when diffing a file that has only property
>>  changes.
>> 
>>  * subversion/libsvn_client/diff.c
>>    (diff_content_changed): If the text diff was empty, assume no header was
>>      printed (unless we printed one explicitly).

>>  -      /* We have a printed a diff for this path, mark it as visited. */
>>  -      *wrote_header = TRUE;
>>  +      /* If we have printed a diff for this path, mark it as visited. */
>>  +      if (exitcode == 1)
>>  +        *wrote_header = TRUE;
> 
> I don't think we can really trust the exit code of any diff tool, to imply 
> whether it reported a diff or not?
> 
> We certainly don't document any of these dependencies.
> 
> Does this even work for our own diff tools?

The book says:

"Subversion expects that your program return an error code of 1 if your program detected differences, or 0 if it did not - any other error code is considered a fatal error"

<http://svnbook.red-bean.com/nightly/en/svn.advanced.externaldifftools.html#svn.advanced.externaldifftools.diff>

- Julian