Bug 14453 - Setting patience diff algorithm for Git causes exception to be thrown and no diff in the version control log window
Summary: Setting patience diff algorithm for Git causes exception to be thrown and no ...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 4.0.12
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Marius Ungureanu
URL:
Depends on:
Blocks:
 
Reported: 2013-09-05 07:38 UTC by Jools Adams
Modified: 2013-09-10 05:30 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jools Adams 2013-09-05 07:38:23 UTC
I have:

[diff]
        algorithm = patience

in ~/.gitconfig. When I select the "log" button at the bottom of the source window showing a .cs file and then click on a revision in the log and exception is thrown. It complains that patience is not a valid value for the diff algorithm. No diffs are shown. I'd expect to have a working Log window, even if the patience setting is ignored.

Exception details follow:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Invalid value: diff.algorithm=patience
  at NGit.Config.GetEnum[SupportedAlgorithm] (System.Array all, System.String section, System.String subsection, System.String name, SupportedAlgorithm defaultValue) [0x0015f] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/external/ngit/NGit/NGit/Config.cs:459 
  at NGit.Config.GetEnum[SupportedAlgorithm] (System.String section, System.String subsection, System.String name, SupportedAlgorithm defaultValue) [0x00010] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/external/ngit/NGit/NGit/Config.cs:366 
  at NGit.Diff.DiffFormatter.SetRepository (NGit.Repository repository) [0x000a7] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/external/ngit/NGit/NGit.Diff/DiffFormatter.cs:149 
  at NGit.Api.DiffCommand.Call () [0x00043] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/external/ngit/NGit/NGit.Api/DiffCommand.cs:113 
  at MonoDevelop.VersionControl.Git.GitUtil.CompareCommits (NGit.Repository repo, NGit.AnyObjectId reference, NGit.ObjectId compared) [0x00072] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs:122 
  at MonoDevelop.VersionControl.Git.GitUtil.GetCommitChanges (NGit.Repository repo, NGit.Revwalk.RevCommit commit) [0x0002e] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs:104 
  at MonoDevelop.VersionControl.Git.GitRepository.OnGetRevisionChanges (MonoDevelop.VersionControl.Revision revision) [0x00032] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs:230 
  at MonoDevelop.VersionControl.Repository.GetRevisionChanges (MonoDevelop.VersionControl.Revision revision) [0x00003] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:339 
  at MonoDevelop.VersionControl.Views.LogWidget.TreeSelectionChanged (System.Object o, System.EventArgs args) [0x0003d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.12-branch/593d7acb/source/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs:602 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:230 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:238 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System.Reflection/MethodBase.cs:114 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000d5] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System/Delegate.cs:424 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System/MulticastDelegate.cs:72 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.1/mcs/class/corlib/System/Delegate.cs:398 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
Comment 1 Marius Ungureanu 2013-09-06 14:31:10 UTC
Only diff algorithms that NGit currently supports are

MYERS and HISTOGRAM
Comment 2 Marius Ungureanu 2013-09-06 14:32:50 UTC
I will add a workaround that will tell the user that the diff algorithm set is not supported and give the user an option to change it.
Comment 3 Jools Adams 2013-09-06 14:37:41 UTC
It would be great to be notified once that patience diff isn't supported. However I don't want to change the setting (I also use 'c' git). After initial notification I'd really like to have the setting ignored (like nothing was in the file) and simply see diffs in Xamarin Studio.
Comment 4 Marius Ungureanu 2013-09-06 15:07:40 UTC
No, it wouldn't make any change to the way diffs are done externally through Git. I'll take a look at this.
Comment 5 Marius Ungureanu 2013-09-07 12:23:54 UTC
Since our Git backend only supports Myers or Histogram, I'll go with defaulting to Myers diff viewing for the push/log views. Changes view already defaults to Myers.
Comment 6 Marius Ungureanu 2013-09-10 05:11:39 UTC
This has been fixed and will be included in future releases.
Comment 7 Jools Adams 2013-09-10 05:30:18 UTC
Thanks :)