From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id EDC5B1F404 for ; Fri, 10 Aug 2018 22:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727168AbeHKAqQ (ORCPT ); Fri, 10 Aug 2018 20:46:16 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:44660 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727033AbeHKAqQ (ORCPT ); Fri, 10 Aug 2018 20:46:16 -0400 Received: by mail-pl0-f66.google.com with SMTP id ba4-v6so4566496plb.11 for ; Fri, 10 Aug 2018 15:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=/aLUo0ESp4syeXDLBwRxK6plUus5IjCwAIBaeoNjDHE=; b=XLD+Z3l4IjFiYTNReJ7Tz69zfp7rdGKKimj5NIL8OiGn+pb6WQ0ncvk88vPzsdpGMK QZdxGOeIBczAw/AOu9ulFVFPxHNWt5UsCzykDD/vdPtRuflxmg7F1VXFDbJqFMga7ISS OnWGTCL1iORPLX4XTcf5pY2tEGvYH2WbXNqtjQ6uUvH5QGmxEvUHaHS+fpbHK/DUArID irH1f00QIvvUzS/fSljvkR6cg8jWfh1D1wWPtopxhQpJxzkeEk4t8KT/+nx6tZoTJ16v PIofCeFBSAn6BV27YEiafZfOSkcpJ/7XQyTsPm5Azmis9GuoYztjmgKlz+RjgbMtvpe5 krJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=/aLUo0ESp4syeXDLBwRxK6plUus5IjCwAIBaeoNjDHE=; b=q40ACf36KJFjyh5M8yOLX8waqb37QoAyLpx0jIn3BwzuFDOXEHz9EvQzcKTbeviz6q Tbyo7cPYAv93s1JyRlKDCYGf9QrjBjkuxnyelhqU1eQiSmj89qWQN425fyJUqT+QP8I8 2bMr6klWji/AP+SFFT0s8rbsuxFwHlhNBAXFs4hqHqkrSvP+AQCDqJM8+dbH7oM2fL+7 +PAHe8PB09NFTJCOTHBIJDfifKcZP/kfDEFAmpme+C5Bx7VrQ3mTSZdU2FjEksSTm6gl KknZXYcVc9rzffo9GQVlk1XRFWv6XSfpnoWExQ5KL2HZkDP+YFqpftzD6NH84XtuehFl NypA== X-Gm-Message-State: AOUpUlEouFekSXg1YdmLnmW80wVPLGx+MVu4MQxYa4vUrBX9jnbY98FI vwwW8SY7Rqfr+yd1kz6mTmt+MNTx X-Google-Smtp-Source: AA+uWPwW27o206FCGudQAeVBqrHXGAzxtZ+JK26Fp35yeJPsqtLiibg98lATa5q4C3ylyfUhZeVmkA== X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr7755737plt.141.1533939269415; Fri, 10 Aug 2018 15:14:29 -0700 (PDT) Received: from [127.0.0.1] ([40.112.142.204]) by smtp.gmail.com with ESMTPSA id s14-v6sm30263757pfj.105.2018.08.10.15.14.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 15:14:28 -0700 (PDT) Date: Fri, 10 Aug 2018 15:14:28 -0700 (PDT) X-Google-Original-Date: Fri, 10 Aug 2018 22:14:04 GMT Message-Id: <33758f361c4cbe47bca50d10d61ff36bf6da2b5a.1533939264.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v5 02/21] Introduce `range-diff` to compare iterations of a topic branch Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin This command 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 `range-branch` into a full-blown replacement for `tbdiff`. At this point, we ignore tbdiff's color options, as they will all be implemented later using diff_options. Since f318d739159 (generate-cmds.sh: export all commands to command-list.h, 2018-05-10), every new command *requires* a man page to build right away, so let's also add a blank man page, too. Signed-off-by: Johannes Schindelin --- .gitignore | 1 + Documentation/git-range-diff.txt | 10 ++++++++++ Makefile | 1 + builtin.h | 1 + builtin/range-diff.c | 25 +++++++++++++++++++++++++ command-list.txt | 1 + git.c | 1 + 7 files changed, 40 insertions(+) create mode 100644 Documentation/git-range-diff.txt create mode 100644 builtin/range-diff.c diff --git a/.gitignore b/.gitignore index 3284a1e9b..cc0ad74b4 100644 --- a/.gitignore +++ b/.gitignore @@ -113,6 +113,7 @@ /git-pull /git-push /git-quiltimport +/git-range-diff /git-read-tree /git-rebase /git-rebase--am diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt new file mode 100644 index 000000000..49f717db8 --- /dev/null +++ b/Documentation/git-range-diff.txt @@ -0,0 +1,10 @@ +git-range-diff(1) +================= + +NAME +---- +git-range-diff - Compare two commit ranges (e.g. two versions of a branch) + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Makefile b/Makefile index 1af719b44..7ff7eba42 100644 --- a/Makefile +++ b/Makefile @@ -1063,6 +1063,7 @@ BUILTIN_OBJS += builtin/prune-packed.o BUILTIN_OBJS += builtin/prune.o BUILTIN_OBJS += builtin/pull.o BUILTIN_OBJS += builtin/push.o +BUILTIN_OBJS += builtin/range-diff.o BUILTIN_OBJS += builtin/read-tree.o BUILTIN_OBJS += builtin/rebase--helper.o BUILTIN_OBJS += builtin/receive-pack.o diff --git a/builtin.h b/builtin.h index 0362f1ce2..99206df4b 100644 --- a/builtin.h +++ b/builtin.h @@ -201,6 +201,7 @@ extern int cmd_prune(int argc, const char **argv, const char *prefix); extern int cmd_prune_packed(int argc, const char **argv, const char *prefix); extern int cmd_pull(int argc, const char **argv, const char *prefix); extern int cmd_push(int argc, const char **argv, const char *prefix); +extern int cmd_range_diff(int argc, const char **argv, const char *prefix); extern int cmd_read_tree(int argc, const char **argv, const char *prefix); extern int cmd_rebase__helper(int argc, const char **argv, const char *prefix); extern int cmd_receive_pack(int argc, const char **argv, const char *prefix); diff --git a/builtin/range-diff.c b/builtin/range-diff.c new file mode 100644 index 000000000..36788ea4f --- /dev/null +++ b/builtin/range-diff.c @@ -0,0 +1,25 @@ +#include "cache.h" +#include "builtin.h" +#include "parse-options.h" + +static const char * const builtin_range_diff_usage[] = { +N_("git range-diff [] .. .."), +N_("git range-diff [] ..."), +N_("git range-diff [] "), +NULL +}; + +int cmd_range_diff(int argc, const char **argv, const char *prefix) +{ + int creation_factor = 60; + struct option options[] = { + OPT_INTEGER(0, "creation-factor", &creation_factor, + N_("Percentage by which creation is weighted")), + OPT_END() + }; + + argc = parse_options(argc, argv, NULL, options, + builtin_range_diff_usage, 0); + + return 0; +} diff --git a/command-list.txt b/command-list.txt index e1c26c1bb..a9dda3b8a 100644 --- a/command-list.txt +++ b/command-list.txt @@ -139,6 +139,7 @@ git-prune-packed plumbingmanipulators git-pull mainporcelain remote git-push mainporcelain remote git-quiltimport foreignscminterface +git-range-diff mainporcelain git-read-tree plumbingmanipulators git-rebase mainporcelain history git-receive-pack synchelpers diff --git a/git.c b/git.c index fc7d15d54..5b48cac3a 100644 --- a/git.c +++ b/git.c @@ -520,6 +520,7 @@ static struct cmd_struct commands[] = { { "prune-packed", cmd_prune_packed, RUN_SETUP }, { "pull", cmd_pull, RUN_SETUP | NEED_WORK_TREE }, { "push", cmd_push, RUN_SETUP }, + { "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER }, { "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX}, { "rebase--helper", cmd_rebase__helper, RUN_SETUP | NEED_WORK_TREE }, { "receive-pack", cmd_receive_pack }, -- gitgitgadget