Re: [PATCH 03/18] branch-diff: first rudimentary implementation
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 3, 2018, 20:44 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1805032242510.77@tvgsbejvaqbjf.bet>
- In-Reply-To
- <24af8d6e-da6f-2d0b-22a0-6a2a215ac55f@ramsayjones.plus.com>
Hi Ramsay,
On Thu, 3 May 2018, Ramsay Jones wrote:
Show 47 quoted lines
> On 03/05/18 16:30, Johannes Schindelin wrote:
> > At this stage, `git branch-diff` can determine corresponding commits of
> > two related commit ranges. This makes use of the recently introduced
> > implementation of the Hungarian algorithm.
> >
> > The core of this patch is a straight port of the ideas of tbdiff, the
> > seemingly dormant project at https://github.com/trast/tbdiff.
> >
> > The output does not at all match `tbdiff`'s output yet, as this patch
> > really concentrates on getting the patch matching part right.
> >
> > Note: due to differences in the diff algorithm (`tbdiff` uses the
> > Pythong module `difflib`, Git uses its xdiff fork), the cost matrix
> > calculated by `branch-diff` is different (but very similar) to the one
> > calculated by `tbdiff`. Therefore, it is possible that they find
> > different matching commits in corner cases (e.g. when a patch was split
> > into two patches of roughly equal length).
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> > builtin/branch-diff.c | 337 +++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 334 insertions(+), 3 deletions(-)
> >
> > diff --git a/builtin/branch-diff.c b/builtin/branch-diff.c
> > index 97266cd326d..02dc06a57ca 100644
> > --- a/builtin/branch-diff.c
> > +++ b/builtin/branch-diff.c
> > @@ -1,13 +1,17 @@
> > #include "cache.h"
> > #include "parse-options.h"
> > +#include "string-list.h"
> > +#include "run-command.h"
> > +#include "argv-array.h"
> > +#include "hashmap.h"
> > +#include "xdiff-interface.h"
> > +#include "hungarian.h"
> >
> > static const char * const builtin_branch_diff_usage[] = {
> > N_("git rebase--helper [<options>] ( A..B C..D | A...B | base A B )"),
> > NULL
> > };
> >
> > -#define COLOR_DUAL_MODE 2
> > -
>
> This #define was introduced in the previous patch, without being
> used in that patch, and is now deleted here.Darn, darn, darn. You know, this macro simply won't die. I tried to kill it off but it keeps showing its ugly head everywhere.
I *think* I finally killed it for good.
Thanks! Dscho