Re: git status during interactive rebase
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jan 21, 2016, 08:23 UTC
- Message-ID
- <vpqpowvz6g0.fsf@anie.imag.fr>
- In-Reply-To
- <CAGZ79kbUwJ+CN=YoQUP=rm=EhU=fU2ynt_7Q-cd7Dic-bsx+TA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 13 quoted lines
> So I ran an interactive rebase, and while editing > .git/rebase-merge/git-rebase-todo I tried to run > `git status` in another terminal to inquire about a > filename of an untracked file. > > However, I got: > > $ git status > On branch submodule-groups-v3 > fatal: Could not open file .git/rebase-merge/done for reading: No such > file or directory > > Was this behavior always the case? (IIRC it worked a long time ago?)
>From the list of recipients, I guess you already found that the issue
probably comes from 84e6fb9 (status: give more information during rebase -i, 2015-07-06), which introduced read_rebase_todolist("rebase-merge/done", &have_done); in wt-status.c.
> Would it make sense to not abort completely but give a limited status?
Yes.
I guess read_rebase_todolist should be changed:
static void read_rebase_todolist(const char *fname, struct string_list *lines)
{
struct strbuf line = STRBUF_INIT;
FILE *f = fopen(git_path("%s", fname), "r"); if (!f)
die_errno("Could not open file %s for reading",
git_path("%s", fname));This should return an empty string_list instead of dying when the file does not exist. The case of an empty list is already dealt with later:
if (have_done.nr == 0)
status_printf_ln(s, color, _("No commands done."));No time to work on a patch for now :-(.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/