Re: [PATCH 02/18] Add a new builtin: branch-diff
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- May 3, 2018, 16:10 UTC
- Message-ID
- <71b00bbf-07e7-11e1-046b-f0241b82ebd3@ramsayjones.plus.com>
- In-Reply-To
- <8bc517e35d4842f8d9d98f3b99adb9475d6db2d2.1525361419.git.johannes.schindelin@gmx.de>
On 03/05/18 16:30, Johannes Schindelin wrote:
Show 66 quoted lines
> 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 <johannes.schindelin@gmx.de>
> ---
> .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.c
>
> diff --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-attr
> diff --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.o
> diff --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/
ATB, Ramsay Jones