Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2016, 23:53 UTC
- Message-ID
- <xmqqk2nes6cc.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <8c98523f8a3f2c6f2f3db1e4572e05c28f94688d.1452612112.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 22 quoted lines
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> builtin/remote.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/remote.c b/builtin/remote.c
> index 6694cf2..0af8300 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -251,7 +251,7 @@ static int add(int argc, const char **argv)
> struct branch_info {
> char *remote_name;
> struct string_list merge;
> - int rebase;
> + enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
> };
>
> static struct string_list branch_list;
> @@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
> info->rebase = v;
> else if (!strcmp(value, "preserve"))
> info->rebase = 1;This should become NORMAL_REBASE, I would think, even though the resulting machine code should be identical.
Show 16 quoted lines
> + else if (!strcmp(value, "interactive"))
> + info->rebase = INTERACTIVE_REBASE;
> }
> }
> return 0;
> @@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
>
> printf(" %-*s ", show_info->width, item->string);
> if (branch_info->rebase) {
> - printf_ln(_("rebases onto remote %s"), merge->items[0].string);
> + printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
> + "rebases interactively onto remote %s" :
> + "rebases onto remote %s"), merge->items[0].string);
> return 0;
> } else if (show_info->any_rebase) {
> printf_ln(_(" merges with remote %s"), merge->items[0].string);