Re: git status during interactive rebase

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

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

> 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]