Re: [PATCH 1/3] rebase: teach rebase --keep-base

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 23, 2019 at 11:25 AM Denton Liu <liu.denton@xxxxxxxxx> wrote:>
> [...]
> Since rebasing onto the merge base of the branch and the upstream is
> such a common case, introduce the --keep-base option as a shortcut.
> [...]
> Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
> ---
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> @@ -1541,10 +1551,19 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
>         /* Make sure the branch to rebase onto is valid. */
> -       if (!options.onto_name)
> +       if (keep_base) {
> +           strbuf_reset(&buf);
> +           strbuf_addstr(&buf, options.upstream_name);
> +           strbuf_addstr(&buf, "...");
> +           options.onto_name = xstrdup(buf.buf);
> +       } else if (!options.onto_name)
>                 options.onto_name = options.upstream_name;
>         if (strstr(options.onto_name, "...")) {
>                 if (get_oid_mb(options.onto_name, &merge_base) < 0)
> +                   if (keep_base)
> +                       die(_("'%s': need exactly one merge base with branch"),
> +                               options.upstream_name);
> +                   else

Style: Indent with tabs, not spaces.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux