git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug? ran into a "fatal" using interactive rebase

From
Ralf Thielow <ralf.thielow@gmail.com>
Date
Sep 7, 2016, 17:02 UTC
Message-ID
<CAN0XMOL7LEcJAHhmSwq8QWH7mD7+jQXRkAdQA+3hZ2JQUJ99Gw@mail.gmail.com>
In-Reply-To
<alpine.DEB.2.20.1609071714540.129229@virtualbox>
2016-09-07 17:19 GMT+02:00 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
Show 43 quoted lines
>
> So, something like this should help (if you are interested in seeing this
> patch included, please run with it, as I am running short on time):
>
> -- snipsnap --
> diff --git a/wt-status.c b/wt-status.c
> index 6225a2d..8e4d999 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -1072,14 +1072,17 @@ static void abbrev_sha1_in_line(struct strbuf *line)
>         strbuf_list_free(split);
>  }
>
> -static void read_rebase_todolist(const char *fname, struct string_list *lines)
> +static void read_rebase_todolist(const char *fname, struct string_list *lines, int gently)
>  {
>         struct strbuf line = STRBUF_INIT;
>         FILE *f = fopen(git_path("%s", fname), "r");
>
> -       if (!f)
> +       if (!f) {
> +               if (gently)
> +                       return;
>                 die_errno("Could not open file %s for reading",
>                           git_path("%s", fname));
> +       }
>         while (!strbuf_getline_lf(&line, f)) {
>                 if (line.len && line.buf[0] == comment_line_char)
>                         continue;
> @@ -1102,8 +1105,8 @@ static void show_rebase_information(struct wt_status *s,
>                 struct string_list have_done = STRING_LIST_INIT_DUP;
>                 struct string_list yet_to_do = STRING_LIST_INIT_DUP;
>
> -               read_rebase_todolist("rebase-merge/done", &have_done);
> -               read_rebase_todolist("rebase-merge/git-rebase-todo",
>                 &yet_to_do);
> +               read_rebase_todolist("rebase-merge/done", &have_done, 1);
> +               read_rebase_todolist("rebase-merge/git-rebase-todo", &yet_to_do, 0);
>
>                 if (have_done.nr == 0)
>                         status_printf_ln(s, color, _("No commands done."));
>
>
That works for me. Thanks.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 4 in “Bug? ran into a "fatal" using interactive rebase”
  1. Ralf ThielowSep 6, 2016
  2. Johannes SchindelinSep 7, 2016
  3. Ralf ThielowSep 7, 2016
  4. Johannes SchindelinSep 8, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.