Re: [PATCH 02/18] Add a new builtin: branch-diff
From: Johannes Schindelin <hidden>
Date: 2018-05-03 20:25:40
Hi Ramsay, On Thu, 3 May 2018, Ramsay Jones wrote:
On 03/05/18 16:30, Johannes Schindelin wrote:quoted
This builtin does not do a whole lot so far, apart from showing a usage that is oddly similar to that of `git tbdiff`. And for a good reason: the next commits will turn `branch-diff` into a full-blown replacement for `tbdiff`. At this point, we ignore tbdiff's color options, as they will all be implemented later and require some patches to the diff machinery. Signed-off-by: Johannes Schindelin <redacted> --- .gitignore | 1 + Makefile | 1 + builtin.h | 1 + builtin/branch-diff.c | 40 ++++++++++++++++++++++++++++++++++++++++ command-list.txt | 1 + git.c | 1 + 6 files changed, 45 insertions(+) create mode 100644 builtin/branch-diff.cdiff --git a/.gitignore b/.gitignore index 833ef3b0b78..1346a64492f 100644 --- a/.gitignore +++ b/.gitignore@@ -20,6 +20,7 @@ /git-bisect--helper /git-blame /git-branch +/git-branch-diff /git-bundle /git-cat-file /git-check-attrdiff --git a/Makefile b/Makefile index 96f2e76a904..9b1984776d8 100644 --- a/Makefile +++ b/Makefile@@ -953,6 +953,7 @@ BUILTIN_OBJS += builtin/archive.o BUILTIN_OBJS += builtin/bisect--helper.o BUILTIN_OBJS += builtin/blame.o BUILTIN_OBJS += builtin/branch.o +BUILTIN_OBJS += builtin/branch-diff.o BUILTIN_OBJS += builtin/bundle.o BUILTIN_OBJS += builtin/cat-file.o BUILTIN_OBJS += builtin/check-attr.odiff --git a/builtin.h b/builtin.h index 42378f3aa47..e1c4d2a529a 100644 --- a/builtin.h +++ b/builtin.h@@ -135,6 +135,7 @@ extern int cmd_archive(int argc, const char **argv, const char *prefix); extern int cmd_bisect__helper(int argc, const char **argv, const char *prefix); extern int cmd_blame(int argc, const char **argv, const char *prefix); extern int cmd_branch(int argc, const char **argv, const char *prefix); +extern int cmd_branch_diff(int argc, const char **argv, const char *prefix); extern int cmd_bundle(int argc, const char **argv, const char *prefix); extern int cmd_cat_file(int argc, const char **argv, const char *prefix); extern int cmd_checkout(int argc, const char **argv, const char *prefix);diff --git a/builtin/branch-diff.c b/builtin/branch-diff.c new file mode 100644 index 00000000000..97266cd326d --- /dev/null +++ b/builtin/branch-diff.c@@ -0,0 +1,40 @@ +#include "cache.h" +#include "parse-options.h" + +static const char * const builtin_branch_diff_usage[] = { + N_("git rebase--helper [<options>] ( A..B C..D | A...B | base A B )"),s/rebase--helper/branch-diff/
Whoops! BTW funny side note: when I saw that you replied, I instinctively thought "oh no, I forgot to mark a function as `static`!" ;-) Thank you for helping me improve the patches, Dscho