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

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/
Previous: Stefan BellerNext: Stefan Beller
Message 2 of 6 in “git status during interactive rebase”
  1. Stefan BellerJan 20, 2016
  2. Matthieu MoyJan 21, 2016
  3. Stefan BellerJan 21, 2016
  4. Junio C HamanoJan 21, 2016
  5. Johannes SchindelinJan 22, 2016
  6. Johannes SchindelinJan 21, 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.